# nakulmaurya/chronosgraph architecture

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

- Interactive diagram: https://gitdiagram.com/nakulmaurya/chronosgraph
- Repository: https://github.com/nakulmaurya/chronosgraph

## Overview

ChronosGraph is a local visual oversight and shared-context product for coding-agent work. Its main workflow imports a repository into a graph, lets a reviewer explore code and governing evidence, preserves task context and handoffs, then supports exact-change review before a human decision. The graph separates static analysis, organizational knowledge, context and memory, and change review rather than implying these are one automatic pipeline. Relationships are limited to README statements and sampled-source/index evidence; several product capabilities have unsampled implementations, so their links are documented or left unverified.

Main entry points: [`backend/app/main.py`](https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/main.py) (FastAPI application), [`backend/app/mcp_server/server.py`](https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/mcp_server/server.py) (MCP tools), [`backend/app/db/client.py`](https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/db/client.py) (FalkorDB graph), [`frontend/src/components/CommandCenter.tsx`](https://github.com/nakulmaurya/chronosgraph/blob/main/frontend/src/components/CommandCenter.tsx) (Workbench UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Review interface"]
  node_workbench["Workbench UI<br/>[CommandCenter.tsx]"]
  node_repository_import_ui["Repository import"]
  node_api["FastAPI application<br/>[main.py]"]
  node_mcp["MCP tools<br/>[server.py]"]
end

subgraph group_repository["Repository graph"]
  node_import_jobs["Import jobs<br/>[import_jobs.py]"]
  node_ingestion["Repository ingestion<br/>[ingest_repo.py]"]
  node_ast_parser["Python AST analysis<br/>[ast_parser.py]"]
  node_graph_store[("FalkorDB graph<br/>[client.py]")]
  node_code_exploration["Code relationships<br/>[queries.py]"]
end

subgraph group_knowledge["Knowledge and context"]
  node_organization["Company brain<br/>[company_brain.py]"]
  node_context_locator["Context discovery<br/>[context_locator.py]"]
  node_wiki["Second-brain wiki"]
end

subgraph group_change["Task and change review"]
  node_task_memory["Task memory<br/>[task_memory.py]"]
  node_task_runtime["Task runtime<br/>[task_runtime.py]"]
  node_change_lifecycle["Change proposals"]
  node_impact_audit["Impact and audit<br/>[diff_impact.py]"]
end

subgraph group_integration["Agent integration"]
  node_opencode["OpenCode bridge<br/>[bridge.ts]"]
  node_opencode_candidate["Candidate validation<br/>[candidate.ts]"]
end

node_reviewer(("Human reviewer"))

node_reviewer -->|"reviews in"| node_workbench
node_workbench -->|"opens import"| node_repository_import_ui
node_repository_import_ui -.->|"starts import"| node_import_jobs
node_import_jobs -->|"dispatches import"| node_ingestion
node_ingestion -->|"parses source"| node_ast_parser
node_ingestion -->|"writes graph"| node_graph_store
node_ast_parser -.->|"supplies parsed records"| node_graph_store
node_workbench -.->|"inspects via"| node_api
node_api -->|"uses selected graph"| node_graph_store
node_mcp -->|"uses selected graph"| node_graph_store
node_api -->|"routes context lookup"| node_context_locator
node_api -->|"records and recalls"| node_task_memory
node_api -->|"routes impact analysis"| node_impact_audit
node_api -->|"routes wiki compile"| node_wiki
node_mcp -->|"calls brain tools"| node_organization
node_mcp -->|"recalls findings"| node_task_memory
node_mcp -->|"calls audit tools"| node_impact_audit
node_api -->|"mounts task routes"| node_task_runtime
node_change_lifecycle -->|"requests impact analysis"| node_impact_audit
node_change_lifecycle -->|"uses task evidence"| node_task_memory
node_opencode -->|"captures and compares"| node_opencode_candidate
node_opencode -.->|"submits task activity"| node_task_runtime

click node_workbench "https://github.com/nakulmaurya/chronosgraph/blob/main/frontend/src/components/CommandCenter.tsx"
click node_repository_import_ui "https://github.com/nakulmaurya/chronosgraph/blob/main/frontend/src/components/RepositoryImport.tsx"
click node_api "https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/main.py"
click node_mcp "https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/mcp_server/server.py"
click node_import_jobs "https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/services/import_jobs.py"
click node_ingestion "https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/ingestion/ingest_repo.py"
click node_ast_parser "https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/ingestion/ast_parser.py"
click node_graph_store "https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/db/client.py"
click node_code_exploration "https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/db/queries.py"
click node_organization "https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/services/company_brain.py"
click node_context_locator "https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/services/context_locator.py"
click node_wiki "https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/services/second_brain_wiki.py"
click node_task_memory "https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/services/task_memory.py"
click node_task_runtime "https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/services/task_runtime.py"
click node_change_lifecycle "https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/services/change_lifecycle.py"
click node_impact_audit "https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/services/diff_impact.py"
click node_opencode "https://github.com/nakulmaurya/chronosgraph/blob/main/integrations/opencode/src/bridge.ts"
click node_opencode_candidate "https://github.com/nakulmaurya/chronosgraph/blob/main/integrations/opencode/src/candidate.ts"

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_workbench,node_repository_import_ui,node_api,node_mcp,node_reviewer toneBlue
class node_import_jobs,node_ingestion,node_ast_parser,node_graph_store,node_code_exploration toneAmber
class node_organization,node_context_locator,node_wiki toneMint
class node_task_memory,node_task_runtime,node_change_lifecycle,node_impact_audit toneRose
class node_opencode,node_opencode_candidate toneIndigo
```

## Components

### Review interface

- [Workbench UI](https://github.com/nakulmaurya/chronosgraph/blob/main/frontend/src/components/CommandCenter.tsx): `frontend/src/components/CommandCenter.tsx`
- [Repository import](https://github.com/nakulmaurya/chronosgraph/blob/main/frontend/src/components/RepositoryImport.tsx): `frontend/src/components/RepositoryImport.tsx`
- [FastAPI application](https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/main.py): `backend/app/main.py`
- [MCP tools](https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/mcp_server/server.py): `backend/app/mcp_server/server.py`

### Repository graph

- [Import jobs](https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/services/import_jobs.py): `backend/app/services/import_jobs.py`
- [Repository ingestion](https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/ingestion/ingest_repo.py): `backend/app/ingestion/ingest_repo.py`
- [Python AST analysis](https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/ingestion/ast_parser.py): `backend/app/ingestion/ast_parser.py`
- [FalkorDB graph](https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/db/client.py): `backend/app/db/client.py`
- [Code relationships](https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/db/queries.py): `backend/app/db/queries.py`

### Knowledge and context

- [Company brain](https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/services/company_brain.py): `backend/app/services/company_brain.py`
- [Context discovery](https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/services/context_locator.py): `backend/app/services/context_locator.py`
- [Second-brain wiki](https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/services/second_brain_wiki.py): `backend/app/services/second_brain_wiki.py`

### Task and change review

- [Task memory](https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/services/task_memory.py): `backend/app/services/task_memory.py`
- [Task runtime](https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/services/task_runtime.py): `backend/app/services/task_runtime.py`
- [Change proposals](https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/services/change_lifecycle.py): `backend/app/services/change_lifecycle.py`
- [Impact and audit](https://github.com/nakulmaurya/chronosgraph/blob/main/backend/app/services/diff_impact.py): `backend/app/services/diff_impact.py`

### Agent integration

- [OpenCode bridge](https://github.com/nakulmaurya/chronosgraph/blob/main/integrations/opencode/src/bridge.ts): `integrations/opencode/src/bridge.ts`
- [Candidate validation](https://github.com/nakulmaurya/chronosgraph/blob/main/integrations/opencode/src/candidate.ts): `integrations/opencode/src/candidate.ts`

### Other components

- **Human reviewer**

## Connections

- Human reviewer → Workbench UI: reviews in (evidence: `README.md`)
- Workbench UI → Repository import: opens import (evidence: `frontend/src/components/CommandCenter.tsx`)
- Repository import → Import jobs: starts import
- Import jobs → Repository ingestion: dispatches import (evidence: `backend/app/services/import_jobs.py`)
- Repository ingestion → Python AST analysis: parses source (evidence: `backend/app/ingestion/ingest_repo.py`)
- Repository ingestion → FalkorDB graph: writes graph (evidence: `backend/app/ingestion/ingest_repo.py`)
- Python AST analysis → FalkorDB graph: supplies parsed records
- Workbench UI → FastAPI application: inspects via
- FastAPI application → FalkorDB graph: uses selected graph (evidence: `README.md`)
- MCP tools → FalkorDB graph: uses selected graph (evidence: `README.md`)
- FastAPI application → Context discovery: routes context lookup (evidence: `backend/app/main.py`)
- FastAPI application → Task memory: records and recalls (evidence: `backend/app/main.py`)
- FastAPI application → Impact and audit: routes impact analysis (evidence: `backend/app/main.py`)
- FastAPI application → Second-brain wiki: routes wiki compile (evidence: `backend/app/main.py`)
- MCP tools → Company brain: calls brain tools (evidence: `backend/app/mcp_server/server.py`)
- MCP tools → Task memory: recalls findings (evidence: `backend/app/mcp_server/server.py`)
- MCP tools → Impact and audit: calls audit tools (evidence: `backend/app/mcp_server/server.py`)
- FastAPI application → Task runtime: mounts task routes (evidence: `backend/app/main.py`)
- Change proposals → Impact and audit: requests impact analysis (evidence: `backend/app/services/change_lifecycle.py`)
- Change proposals → Task memory: uses task evidence (evidence: `backend/app/services/change_lifecycle.py`)
- OpenCode bridge → Candidate validation: captures and compares (evidence: `integrations/opencode/src/bridge.ts`)
- OpenCode bridge → Task runtime: submits task activity
