# bhuvaneshkumar1/jarvis architecture

> Architecture diagram of the GitHub repository bhuvaneshkumar1/jarvis, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bhuvaneshkumar1/jarvis
- Repository: https://github.com/bhuvaneshkumar1/jarvis

## Overview

JARVIS is a Windows-focused autonomous AI operating system. Its principal workflow starts with a user request entering the application kernel, which initializes and coordinates runtime components; security authentication and policy governance control operations, while the kernel can use LLM providers and task services. Tasks are persisted and supported by crash recovery, with an asynchronous event bus for dispatch. The README documents these major capabilities; source excerpts and the index confirm selected calls, but several subsystems were not sampled, so their links rely on README statements.

Main entry points: [`jarvis/core/runtime/application.py`](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/runtime/application.py) (Application Kernel), [`jarvis/core/tasks/manager.py`](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/tasks/manager.py) (Task Manager), [`jarvis/core/events/bus.py`](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/events/bus.py) (Priority Event Bus), [`jarvis/security/auth_manager.py`](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/security/auth_manager.py) (PIN Authentication)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime Kernel"]
  node_app_entry["Application Entry<br/>[main.py]"]
  node_kernel["Application Kernel<br/>[application.py]"]
  node_runtime_context["Runtime Context<br/>[context.py]"]
  node_event_bus["Priority Event Bus<br/>[bus.py]"]
  node_orchestrator["Workflow Orchestrator<br/>[orchestrator.py]"]
end

subgraph group_governance["Security Governance"]
  node_auth["PIN Authentication<br/>[auth_manager.py]"]
  node_lockout["Persistent Lockout<br/>[lockout_manager.py]"]
  node_policy["Policy Engine<br/>[engine.py]"]
  node_audit["Audit Logging<br/>[audit_log.py]"]
  node_redaction["Secret Redaction<br/>[logging.py]"]
end

subgraph group_intelligence["LLM Intelligence"]
  node_llm_router["LLM Router<br/>[llm_router.py]"]
  node_llm_factory["Provider Factory<br/>[factory.py]"]
  node_llm_contracts["LLM Contracts<br/>[contracts.py]"]
  node_nvidia["NVIDIA Provider<br/>[nvidia.py]"]
  node_openrouter["OpenRouter Provider<br/>[openrouter.py]"]
end

subgraph group_tasks["Tasks Persistence"]
  node_task_manager["Task Manager<br/>[manager.py]"]
  node_task_repository["Task Repository<br/>[repository.py]"]
  node_recovery["Crash Recovery<br/>[coordinator.py]"]
  node_outbox["Task Outbox<br/>[outbox.py]"]
  node_sqlite[("SQLite Store<br/>[manager.py]")]
end

node_user(("User"))
node_llm_service["LLM Service"]

node_user -->|"submits request"| node_app_entry
node_app_entry -->|"starts runtime"| node_kernel
node_kernel -->|"shares context"| node_runtime_context
node_kernel -->|"initializes"| node_event_bus
node_kernel -->|"initializes"| node_task_manager
node_kernel -->|"initializes"| node_orchestrator
node_kernel -->|"initializes"| node_recovery
node_auth -->|"uses lockout"| node_lockout
node_auth -.->|"authorizes through"| node_policy
node_policy -->|"publishes decisions"| node_event_bus
node_event_bus -->|"dispatches events"| node_task_manager
node_auth -->|"records security events"| node_audit
node_llm_router -.->|"selects provider"| node_llm_factory
node_llm_factory -->|"creates provider"| node_nvidia
node_llm_factory -->|"creates provider"| node_openrouter
node_nvidia -->|"uses contracts"| node_llm_contracts
node_openrouter -->|"uses contracts"| node_llm_contracts
node_nvidia -->|"calls inference"| node_llm_service
node_openrouter -.->|"calls inference"| node_llm_service
node_orchestrator -->|"coordinates tasks"| node_task_manager
node_task_manager -->|"persists tasks"| node_task_repository
node_task_manager -->|"uses outbox"| node_outbox
node_task_manager -->|"runs recovery"| node_recovery
node_task_repository -->|"stores task state"| node_sqlite
node_recovery -->|"restores task state"| node_sqlite
node_event_bus -->|"redacts event history"| node_redaction

click node_app_entry "https://github.com/bhuvaneshkumar1/jarvis/blob/main/main.py"
click node_kernel "https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/runtime/application.py"
click node_runtime_context "https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/runtime/context.py"
click node_event_bus "https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/events/bus.py"
click node_orchestrator "https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/orchestration/orchestrator.py"
click node_auth "https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/security/auth_manager.py"
click node_lockout "https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/security/lockout_manager.py"
click node_policy "https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/security/policy/engine.py"
click node_audit "https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/audit_log.py"
click node_redaction "https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/logging.py"
click node_llm_router "https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/llm_router.py"
click node_llm_factory "https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/llm/factory.py"
click node_llm_contracts "https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/llm/contracts.py"
click node_nvidia "https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/llm/providers/nvidia.py"
click node_openrouter "https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/llm/providers/openrouter.py"
click node_task_manager "https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/tasks/manager.py"
click node_task_repository "https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/tasks/repository.py"
click node_recovery "https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/recovery/coordinator.py"
click node_outbox "https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/tasks/outbox.py"
click node_sqlite "https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/database/manager.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app_entry,node_kernel,node_runtime_context,node_event_bus,node_orchestrator,node_user toneBlue
class node_auth,node_lockout,node_policy,node_audit,node_redaction toneAmber
class node_llm_router,node_llm_factory,node_llm_contracts,node_nvidia,node_openrouter toneMint
class node_task_manager,node_task_repository,node_recovery,node_outbox,node_sqlite toneRose
class node_llm_service toneIndigo
```

## Components

### Runtime Kernel

- [Application Entry](https://github.com/bhuvaneshkumar1/jarvis/blob/main/main.py): `main.py`
- [Application Kernel](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/runtime/application.py): `jarvis/core/runtime/application.py`
- [Runtime Context](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/runtime/context.py): `jarvis/core/runtime/context.py`
- [Priority Event Bus](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/events/bus.py): `jarvis/core/events/bus.py`
- [Workflow Orchestrator](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/orchestration/orchestrator.py): `jarvis/core/orchestration/orchestrator.py`

### Security Governance

- [PIN Authentication](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/security/auth_manager.py): `jarvis/security/auth_manager.py`
- [Persistent Lockout](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/security/lockout_manager.py): `jarvis/security/lockout_manager.py`
- [Policy Engine](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/security/policy/engine.py): `jarvis/security/policy/engine.py`
- [Audit Logging](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/audit_log.py): `jarvis/core/audit_log.py`
- [Secret Redaction](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/logging.py): `jarvis/core/logging.py`

### LLM Intelligence

- [LLM Router](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/llm_router.py): `jarvis/core/llm_router.py`
- [Provider Factory](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/llm/factory.py): `jarvis/llm/factory.py`
- [LLM Contracts](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/llm/contracts.py): `jarvis/llm/contracts.py`
- [NVIDIA Provider](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/llm/providers/nvidia.py): `jarvis/llm/providers/nvidia.py`
- [OpenRouter Provider](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/llm/providers/openrouter.py): `jarvis/llm/providers/openrouter.py`

### Tasks Persistence

- [Task Manager](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/tasks/manager.py): `jarvis/core/tasks/manager.py`
- [Task Repository](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/tasks/repository.py): `jarvis/core/tasks/repository.py`
- [Crash Recovery](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/recovery/coordinator.py): `jarvis/core/recovery/coordinator.py`
- [Task Outbox](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/core/tasks/outbox.py): `jarvis/core/tasks/outbox.py`
- [SQLite Store](https://github.com/bhuvaneshkumar1/jarvis/blob/main/jarvis/database/manager.py): `jarvis/database/manager.py`

### Other components

- **User**
- **LLM Service**

## Connections

- User → Application Entry: submits request
- Application Entry → Application Kernel: starts runtime (evidence: `jarvis/core/runtime/application.py`)
- Application Kernel → Runtime Context: shares context (evidence: `jarvis/core/runtime/application.py`)
- Application Kernel → Priority Event Bus: initializes (evidence: `jarvis/core/runtime/application.py`)
- Application Kernel → Task Manager: initializes (evidence: `jarvis/core/runtime/application.py`)
- Application Kernel → Workflow Orchestrator: initializes (evidence: `jarvis/core/runtime/application.py`)
- Application Kernel → Crash Recovery: initializes (evidence: `jarvis/core/runtime/application.py`)
- PIN Authentication → Persistent Lockout: uses lockout (evidence: `jarvis/security/auth_manager.py`)
- PIN Authentication → Policy Engine: authorizes through
- Policy Engine → Priority Event Bus: publishes decisions
- Priority Event Bus → Task Manager: dispatches events
- PIN Authentication → Audit Logging: records security events (evidence: `jarvis/security/auth_manager.py`)
- LLM Router → Provider Factory: selects provider
- Provider Factory → NVIDIA Provider: creates provider
- Provider Factory → OpenRouter Provider: creates provider
- NVIDIA Provider → LLM Contracts: uses contracts (evidence: `jarvis/llm/providers/nvidia.py`)
- OpenRouter Provider → LLM Contracts: uses contracts (evidence: `jarvis/llm/providers/openrouter.py`)
- NVIDIA Provider → LLM Service: calls inference
- OpenRouter Provider → LLM Service: calls inference
- Workflow Orchestrator → Task Manager: coordinates tasks (evidence: `jarvis/core/orchestration/orchestrator.py`)
- Task Manager → Task Repository: persists tasks (evidence: `jarvis/core/tasks/manager.py`)
- Task Manager → Task Outbox: uses outbox (evidence: `jarvis/core/tasks/manager.py`)
- Task Manager → Crash Recovery: runs recovery (evidence: `jarvis/core/tasks/manager.py`)
- Task Repository → SQLite Store: stores task state
- Crash Recovery → SQLite Store: restores task state
- Priority Event Bus → Secret Redaction: redacts event history (evidence: `jarvis/core/events/bus.py`)
