# vivek-c29/zenith architecture

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

- Interactive diagram: https://gitdiagram.com/vivek-c29/zenith
- Repository: https://github.com/vivek-c29/zenith

## Overview

Zenith is an autonomous code-bug fixing agent, also usable from CI: it takes a bug report or failed-test context, investigates repository code, proposes and reviews patches, runs tests in an isolated sandbox, and can prepare a pull request. Its separate audit mode looks for silent logic bugs in a diff after tests pass. The graph and node excerpts establish the agent stages; parser/indexer excerpts establish code indexing and retrieval capabilities. Wiring for some internal integrations is not shown, so those connections are omitted where uncertain.

Main entry points: [`zenith/agent/graph.py`](https://github.com/vivek-c29/zenith/blob/main/zenith/agent/graph.py) (Agent graph), [`zenith/vector_store/indexer.py`](https://github.com/vivek-c29/zenith/blob/main/zenith/vector_store/indexer.py) (Code indexer), [`zenith/cli.py`](https://github.com/vivek-c29/zenith/blob/main/zenith/cli.py) (CLI and CI), [`zenith/agent/nodes.py`](https://github.com/vivek-c29/zenith/blob/main/zenith/agent/nodes.py) (Test runner node)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and control"]
  node_cli["CLI and CI<br/>[cli.py]"]
  node_agent_graph["Agent graph<br/>[graph.py]"]
end

subgraph group_fix["Fix workflow"]
  node_manager["Manager<br/>[nodes.py]"]
  node_researcher["Researcher<br/>[nodes.py]"]
  node_coder["Coder<br/>[nodes.py]"]
  node_reviewer["Reviewer<br/>[nodes.py]"]
  node_auditor["Silent-bug auditor<br/>[nodes.py]"]
  node_sandbox_node["Test runner node<br/>[nodes.py]"]
  node_error_analyzer["Error analyzer<br/>[nodes.py]"]
  node_raise_pr["Patch and PR node<br/>[nodes.py]"]
end

subgraph group_knowledge["Code intelligence"]
  node_parser["Code parser"]
  node_language_map["Language detection<br/>[language_map.py]"]
  node_indexer["Code indexer<br/>[indexer.py]"]
  node_embedding["Embedding and reranking"]
  node_vector_store["Vector storage<br/>[vector_store.py]"]
  node_neo4j_store["Neo4j backend<br/>[neo4j_store.py]"]
end

subgraph group_integrations["Repository integrations"]
  node_git_manager["Git operations<br/>[git_manager.py]"]
  node_docker_manager["Docker sandbox<br/>[docker_manager.py]"]
  node_github_client["GitHub PR client<br/>[github_client.py]"]
end

node_user(("CLI user"))
node_llm(("LLM service"))
node_docker(("Docker daemon"))
node_github(("GitHub"))
node_repository[("Target repository")]
node_test_command(("Test command"))

node_user -->|"invokes"| node_cli
node_cli -->|"starts agent"| node_agent_graph
node_cli -->|"reads diff"| node_git_manager
node_cli -->|"starts audit"| node_auditor
node_cli -->|"runs"| node_test_command
node_agent_graph -->|"dispatches"| node_manager
node_agent_graph -->|"dispatches"| node_researcher
node_agent_graph -->|"dispatches"| node_coder
node_agent_graph -->|"dispatches"| node_reviewer
node_agent_graph -->|"dispatches"| node_sandbox_node
node_agent_graph -->|"dispatches"| node_error_analyzer
node_agent_graph -->|"dispatches"| node_raise_pr
node_reviewer -->|"retries"| node_coder
node_sandbox_node -->|"routes failures"| node_error_analyzer
node_error_analyzer -->|"feeds errors"| node_coder
node_sandbox_node -->|"routes success"| node_raise_pr
node_auditor -->|"requests analysis"| node_llm
node_coder -->|"requests patches"| node_llm
node_reviewer -->|"requests review"| node_llm
node_error_analyzer -->|"requests analysis"| node_llm
node_manager -->|"inspects repository"| node_git_manager
node_researcher -->|"retrieves context"| node_indexer
node_indexer -->|"parses files"| node_parser
node_parser -->|"detects language"| node_language_map
node_indexer -->|"embeds chunks"| node_embedding
node_indexer -->|"indexes and searches"| node_vector_store
node_indexer -->|"reads commit history"| node_git_manager
node_indexer -->|"writes graph index"| node_neo4j_store
node_docker_manager -->|"starts and executes"| node_docker
node_sandbox_node -->|"runs tests"| node_docker_manager
node_sandbox_node -->|"executes"| node_test_command
node_raise_pr -->|"applies and commits"| node_git_manager
node_raise_pr -->|"creates pull request"| node_github_client
node_github_client -->|"calls API"| node_github
node_git_manager -->|"reads and writes"| node_repository
node_docker_manager -->|"mounts workspace"| node_repository

click node_cli "https://github.com/vivek-c29/zenith/blob/main/zenith/cli.py"
click node_agent_graph "https://github.com/vivek-c29/zenith/blob/main/zenith/agent/graph.py"
click node_manager "https://github.com/vivek-c29/zenith/blob/main/zenith/agent/nodes.py"
click node_researcher "https://github.com/vivek-c29/zenith/blob/main/zenith/agent/nodes.py"
click node_coder "https://github.com/vivek-c29/zenith/blob/main/zenith/agent/nodes.py"
click node_reviewer "https://github.com/vivek-c29/zenith/blob/main/zenith/agent/nodes.py"
click node_auditor "https://github.com/vivek-c29/zenith/blob/main/zenith/agent/nodes.py"
click node_sandbox_node "https://github.com/vivek-c29/zenith/blob/main/zenith/agent/nodes.py"
click node_error_analyzer "https://github.com/vivek-c29/zenith/blob/main/zenith/agent/nodes.py"
click node_raise_pr "https://github.com/vivek-c29/zenith/blob/main/zenith/agent/nodes.py"
click node_parser "https://github.com/vivek-c29/zenith/blob/main/zenith/parser/tree_sitter_parser.py"
click node_language_map "https://github.com/vivek-c29/zenith/blob/main/zenith/parser/language_map.py"
click node_indexer "https://github.com/vivek-c29/zenith/blob/main/zenith/vector_store/indexer.py"
click node_embedding "https://github.com/vivek-c29/zenith/blob/main/zenith/vector_store/embedding_engine.py"
click node_vector_store "https://github.com/vivek-c29/zenith/blob/main/zenith/vector_store/vector_store.py"
click node_neo4j_store "https://github.com/vivek-c29/zenith/blob/main/zenith/vector_store/neo4j_store.py"
click node_git_manager "https://github.com/vivek-c29/zenith/blob/main/zenith/git_manager/git_manager.py"
click node_docker_manager "https://github.com/vivek-c29/zenith/blob/main/zenith/sandbox/docker_manager.py"
click node_github_client "https://github.com/vivek-c29/zenith/blob/main/zenith/github/github_client.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_cli,node_agent_graph,node_user toneBlue
class node_manager,node_researcher,node_coder,node_reviewer,node_auditor,node_sandbox_node,node_error_analyzer,node_raise_pr,node_repository toneAmber
class node_parser,node_language_map,node_indexer,node_embedding,node_vector_store,node_neo4j_store toneMint
class node_git_manager,node_docker_manager,node_github_client toneRose
class node_llm,node_docker,node_github,node_test_command toneIndigo
```

## Components

### Entry and control

- [CLI and CI](https://github.com/vivek-c29/zenith/blob/main/zenith/cli.py): `zenith/cli.py`
- [Agent graph](https://github.com/vivek-c29/zenith/blob/main/zenith/agent/graph.py): `zenith/agent/graph.py`

### Fix workflow

- [Manager](https://github.com/vivek-c29/zenith/blob/main/zenith/agent/nodes.py): `zenith/agent/nodes.py`
- [Researcher](https://github.com/vivek-c29/zenith/blob/main/zenith/agent/nodes.py): `zenith/agent/nodes.py`
- [Coder](https://github.com/vivek-c29/zenith/blob/main/zenith/agent/nodes.py): `zenith/agent/nodes.py`
- [Reviewer](https://github.com/vivek-c29/zenith/blob/main/zenith/agent/nodes.py): `zenith/agent/nodes.py`
- [Silent-bug auditor](https://github.com/vivek-c29/zenith/blob/main/zenith/agent/nodes.py): `zenith/agent/nodes.py`
- [Test runner node](https://github.com/vivek-c29/zenith/blob/main/zenith/agent/nodes.py): `zenith/agent/nodes.py`
- [Error analyzer](https://github.com/vivek-c29/zenith/blob/main/zenith/agent/nodes.py): `zenith/agent/nodes.py`
- [Patch and PR node](https://github.com/vivek-c29/zenith/blob/main/zenith/agent/nodes.py): `zenith/agent/nodes.py`

### Code intelligence

- [Code parser](https://github.com/vivek-c29/zenith/blob/main/zenith/parser/tree_sitter_parser.py): `zenith/parser/tree_sitter_parser.py`
- [Language detection](https://github.com/vivek-c29/zenith/blob/main/zenith/parser/language_map.py): `zenith/parser/language_map.py`
- [Code indexer](https://github.com/vivek-c29/zenith/blob/main/zenith/vector_store/indexer.py): `zenith/vector_store/indexer.py`
- [Embedding and reranking](https://github.com/vivek-c29/zenith/blob/main/zenith/vector_store/embedding_engine.py): `zenith/vector_store/embedding_engine.py`
- [Vector storage](https://github.com/vivek-c29/zenith/blob/main/zenith/vector_store/vector_store.py): `zenith/vector_store/vector_store.py`
- [Neo4j backend](https://github.com/vivek-c29/zenith/blob/main/zenith/vector_store/neo4j_store.py): `zenith/vector_store/neo4j_store.py`

### Repository integrations

- [Git operations](https://github.com/vivek-c29/zenith/blob/main/zenith/git_manager/git_manager.py): `zenith/git_manager/git_manager.py`
- [Docker sandbox](https://github.com/vivek-c29/zenith/blob/main/zenith/sandbox/docker_manager.py): `zenith/sandbox/docker_manager.py`
- [GitHub PR client](https://github.com/vivek-c29/zenith/blob/main/zenith/github/github_client.py): `zenith/github/github_client.py`

### Other components

- **CLI user**
- **LLM service**
- **Docker daemon**
- **GitHub**
- **Target repository**
- **Test command**

## Connections

- CLI user → CLI and CI: invokes
- CLI and CI → Agent graph: starts agent
- CLI and CI → Git operations: reads diff
- CLI and CI → Silent-bug auditor: starts audit
- CLI and CI → Test command: runs
- Agent graph → Manager: dispatches
- Agent graph → Researcher: dispatches
- Agent graph → Coder: dispatches
- Agent graph → Reviewer: dispatches
- Agent graph → Test runner node: dispatches
- Agent graph → Error analyzer: dispatches
- Agent graph → Patch and PR node: dispatches
- Reviewer → Coder: retries
- Test runner node → Error analyzer: routes failures
- Error analyzer → Coder: feeds errors
- Test runner node → Patch and PR node: routes success
- Silent-bug auditor → LLM service: requests analysis
- Coder → LLM service: requests patches
- Reviewer → LLM service: requests review
- Error analyzer → LLM service: requests analysis
- Manager → Git operations: inspects repository
- Researcher → Code indexer: retrieves context
- Code indexer → Code parser: parses files
- Code parser → Language detection: detects language
- Code indexer → Embedding and reranking: embeds chunks
- Code indexer → Vector storage: indexes and searches
- Code indexer → Git operations: reads commit history
- Code indexer → Neo4j backend: writes graph index
- Docker sandbox → Docker daemon: starts and executes
- Test runner node → Docker sandbox: runs tests
- Test runner node → Test command: executes
- Patch and PR node → Git operations: applies and commits
- Patch and PR node → GitHub PR client: creates pull request
- GitHub PR client → GitHub: calls API
- Git operations → Target repository: reads and writes
- Docker sandbox → Target repository: mounts workspace
