# raushan291/coding-agent architecture

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

- Interactive diagram: https://gitdiagram.com/raushan291/coding-agent
- Repository: https://github.com/raushan291/coding-agent

## Overview

Coding Agent is a CLI code assistant whose main workflow indexes the launched project, then answers `/ask` questions using an LLM agent with code search, citations, and optional cached answers. A separate `/plan` workflow creates an approved task DAG and runs scoped agents to build a project. The graph also preserves live indexing, persistent conversation memory, skills, and MCP integrations. Edges are limited to relationships shown in the README, excerpts, or SOURCE INDEX; unsampled wiring is not inferred.

Main entry points: [`coding_agent/main.py`](https://github.com/raushan291/coding-agent/blob/main/coding_agent/main.py) (Command interface), [`coding_agent/agent/factory.py`](https://github.com/raushan291/coding-agent/blob/main/coding_agent/agent/factory.py) (Tool-calling agent), [`coding_agent/tasks/orchestrator.py`](https://github.com/raushan291/coding-agent/blob/main/coding_agent/tasks/orchestrator.py) (Task orchestrator), [`coding_agent/context/indexers/semantic_chroma.py`](https://github.com/raushan291/coding-agent/blob/main/coding_agent/context/indexers/semantic_chroma.py) (Vector indexer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI and agent"]
  node_cli["Command interface<br/>[main.py]"]
  node_agent["Tool-calling agent<br/>[factory.py]"]
  node_query["Query handler<br/>[orchestrator.py]"]
  node_llm["LLM and embedder<br/>[factory.py]"]
end

subgraph group_index["Code indexing and retrieval"]
  node_parser["Code parser<br/>[code_parser.py]"]
  node_indexer[("Vector indexer<br/>[semantic_chroma.py]")]
  node_index_factory["Indexer selection<br/>[factory.py]"]
  node_watcher["File watcher<br/>[watcher.py]"]
  node_retriever_factory["Retriever selection<br/>[factory.py]"]
  node_hybrid_retriever["Hybrid retrieval<br/>[hybrid_chroma.py]"]
  node_search_tool["Code search tool<br/>[tools.py]"]
end

subgraph group_planning["Planning and execution"]
  node_planner["Task planner<br/>[planner.py]"]
  node_approval["Plan approval<br/>[approval.py]"]
  node_task_orchestrator["Task orchestrator<br/>[orchestrator.py]"]
  node_executor["Task executor<br/>[executor.py]"]
  node_task_store[("Task database<br/>[task_store.py]")]
  node_recovery["Task recovery<br/>[recovery.py]"]
end

subgraph group_context["Agent context and tools"]
  node_skills["Skills registry<br/>[registry.py]"]
  node_skill_tools["Skill tools<br/>[skill_tools.py]"]
  node_mcp["MCP tools client<br/>[mcp_client.py]"]
  node_terminal["Shell tools<br/>[terminal_tools.py]"]
end

subgraph group_state["Persistence and cache"]
  node_memory[("Conversation memory<br/>[short_term.py]")]
  node_session[("Session management<br/>[session.py]")]
  node_cache[("Semantic answer cache<br/>[semantic_cache.py]")]
  node_redis["Redis startup<br/>[redis_manager.py]"]
end

node_user(("Developer"))
node_project["Launched codebase"]

node_user -->|"enters commands"| node_cli
node_cli -->|"gets index"| node_index_factory
node_index_factory -->|"selects backend"| node_indexer
node_indexer -->|"parses files"| node_parser
node_project -->|"provides source"| node_indexer
node_cli -->|"starts watcher"| node_watcher
node_watcher -->|"reindexes edits"| node_indexer
node_cli -->|"builds agent"| node_agent
node_agent -->|"loads model"| node_llm
node_agent -->|"registers search"| node_search_tool
node_search_tool -->|"gets retriever"| node_retriever_factory
node_retriever_factory -->|"selects backend"| node_hybrid_retriever
node_hybrid_retriever -.->|"searches index"| node_indexer
node_agent -->|"summarizes context"| node_memory
node_cli -->|"handles questions"| node_query
node_query -.->|"runs agent"| node_agent
node_cli -->|"checks answers"| node_cache
node_cli -->|"ensures Redis"| node_redis
node_redis -.->|"enables cache"| node_cache
node_cli -->|"manages sessions"| node_session
node_agent -->|"registers skills"| node_skill_tools
node_skill_tools -->|"loads skills"| node_skills
node_agent -->|"loads MCP tools"| node_mcp
node_agent -->|"registers shell tools"| node_terminal
node_user -->|"submits goal"| node_cli
node_cli -->|"starts planning"| node_task_orchestrator
node_task_orchestrator -->|"requests plan"| node_planner
node_task_orchestrator -->|"requests approval"| node_approval
node_task_orchestrator -->|"persists tasks"| node_task_store
node_task_orchestrator -->|"recovers tasks"| node_recovery
node_task_orchestrator -->|"dispatches tasks"| node_executor
node_executor -->|"updates status"| node_task_store
node_executor -->|"uses shell tools"| node_terminal
node_task_orchestrator -->|"reindexes output"| node_index_factory

click node_cli "https://github.com/raushan291/coding-agent/blob/main/coding_agent/main.py"
click node_agent "https://github.com/raushan291/coding-agent/blob/main/coding_agent/agent/factory.py"
click node_query "https://github.com/raushan291/coding-agent/blob/main/coding_agent/agent/orchestrator.py"
click node_llm "https://github.com/raushan291/coding-agent/blob/main/coding_agent/llm/factory.py"
click node_parser "https://github.com/raushan291/coding-agent/blob/main/coding_agent/context/indexers/code_parser.py"
click node_indexer "https://github.com/raushan291/coding-agent/blob/main/coding_agent/context/indexers/semantic_chroma.py"
click node_index_factory "https://github.com/raushan291/coding-agent/blob/main/coding_agent/context/indexers/factory.py"
click node_watcher "https://github.com/raushan291/coding-agent/blob/main/coding_agent/context/indexers/watcher.py"
click node_retriever_factory "https://github.com/raushan291/coding-agent/blob/main/coding_agent/context/retrievers/factory.py"
click node_hybrid_retriever "https://github.com/raushan291/coding-agent/blob/main/coding_agent/context/retrievers/hybrid_chroma.py"
click node_search_tool "https://github.com/raushan291/coding-agent/blob/main/coding_agent/agent/tools.py"
click node_planner "https://github.com/raushan291/coding-agent/blob/main/coding_agent/tasks/planner.py"
click node_approval "https://github.com/raushan291/coding-agent/blob/main/coding_agent/tasks/approval.py"
click node_task_orchestrator "https://github.com/raushan291/coding-agent/blob/main/coding_agent/tasks/orchestrator.py"
click node_executor "https://github.com/raushan291/coding-agent/blob/main/coding_agent/tasks/executor.py"
click node_task_store "https://github.com/raushan291/coding-agent/blob/main/coding_agent/tasks/task_store.py"
click node_recovery "https://github.com/raushan291/coding-agent/blob/main/coding_agent/tasks/recovery.py"
click node_skills "https://github.com/raushan291/coding-agent/blob/main/coding_agent/skills/registry.py"
click node_skill_tools "https://github.com/raushan291/coding-agent/blob/main/coding_agent/skills/skill_tools.py"
click node_mcp "https://github.com/raushan291/coding-agent/blob/main/coding_agent/mcp/mcp_client.py"
click node_terminal "https://github.com/raushan291/coding-agent/blob/main/coding_agent/tools/terminal_tools.py"
click node_memory "https://github.com/raushan291/coding-agent/blob/main/coding_agent/memory/short_term.py"
click node_session "https://github.com/raushan291/coding-agent/blob/main/coding_agent/memory/session.py"
click node_cache "https://github.com/raushan291/coding-agent/blob/main/coding_agent/cache/semantic_cache.py"
click node_redis "https://github.com/raushan291/coding-agent/blob/main/coding_agent/cache/redis_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_cli,node_agent,node_query,node_llm toneBlue
class node_parser,node_indexer,node_index_factory,node_watcher,node_retriever_factory,node_hybrid_retriever,node_search_tool toneAmber
class node_planner,node_approval,node_task_orchestrator,node_executor,node_task_store,node_recovery toneMint
class node_skills,node_skill_tools,node_mcp,node_terminal toneRose
class node_memory,node_session,node_cache,node_redis,node_user,node_project toneIndigo
```

## Components

### CLI and agent

- [Command interface](https://github.com/raushan291/coding-agent/blob/main/coding_agent/main.py): `coding_agent/main.py`
- [Tool-calling agent](https://github.com/raushan291/coding-agent/blob/main/coding_agent/agent/factory.py): `coding_agent/agent/factory.py`
- [Query handler](https://github.com/raushan291/coding-agent/blob/main/coding_agent/agent/orchestrator.py): `coding_agent/agent/orchestrator.py`
- [LLM and embedder](https://github.com/raushan291/coding-agent/blob/main/coding_agent/llm/factory.py): `coding_agent/llm/factory.py`

### Code indexing and retrieval

- [Code parser](https://github.com/raushan291/coding-agent/blob/main/coding_agent/context/indexers/code_parser.py): `coding_agent/context/indexers/code_parser.py`
- [Vector indexer](https://github.com/raushan291/coding-agent/blob/main/coding_agent/context/indexers/semantic_chroma.py): `coding_agent/context/indexers/semantic_chroma.py`
- [Indexer selection](https://github.com/raushan291/coding-agent/blob/main/coding_agent/context/indexers/factory.py): `coding_agent/context/indexers/factory.py`
- [File watcher](https://github.com/raushan291/coding-agent/blob/main/coding_agent/context/indexers/watcher.py): `coding_agent/context/indexers/watcher.py`
- [Retriever selection](https://github.com/raushan291/coding-agent/blob/main/coding_agent/context/retrievers/factory.py): `coding_agent/context/retrievers/factory.py`
- [Hybrid retrieval](https://github.com/raushan291/coding-agent/blob/main/coding_agent/context/retrievers/hybrid_chroma.py): `coding_agent/context/retrievers/hybrid_chroma.py`
- [Code search tool](https://github.com/raushan291/coding-agent/blob/main/coding_agent/agent/tools.py): `coding_agent/agent/tools.py`

### Planning and execution

- [Task planner](https://github.com/raushan291/coding-agent/blob/main/coding_agent/tasks/planner.py): `coding_agent/tasks/planner.py`
- [Plan approval](https://github.com/raushan291/coding-agent/blob/main/coding_agent/tasks/approval.py): `coding_agent/tasks/approval.py`
- [Task orchestrator](https://github.com/raushan291/coding-agent/blob/main/coding_agent/tasks/orchestrator.py): `coding_agent/tasks/orchestrator.py`
- [Task executor](https://github.com/raushan291/coding-agent/blob/main/coding_agent/tasks/executor.py): `coding_agent/tasks/executor.py`
- [Task database](https://github.com/raushan291/coding-agent/blob/main/coding_agent/tasks/task_store.py): `coding_agent/tasks/task_store.py`
- [Task recovery](https://github.com/raushan291/coding-agent/blob/main/coding_agent/tasks/recovery.py): `coding_agent/tasks/recovery.py`

### Agent context and tools

- [Skills registry](https://github.com/raushan291/coding-agent/blob/main/coding_agent/skills/registry.py): `coding_agent/skills/registry.py`
- [Skill tools](https://github.com/raushan291/coding-agent/blob/main/coding_agent/skills/skill_tools.py): `coding_agent/skills/skill_tools.py`
- [MCP tools client](https://github.com/raushan291/coding-agent/blob/main/coding_agent/mcp/mcp_client.py): `coding_agent/mcp/mcp_client.py`
- [Shell tools](https://github.com/raushan291/coding-agent/blob/main/coding_agent/tools/terminal_tools.py): `coding_agent/tools/terminal_tools.py`

### Persistence and cache

- [Conversation memory](https://github.com/raushan291/coding-agent/blob/main/coding_agent/memory/short_term.py): `coding_agent/memory/short_term.py`
- [Session management](https://github.com/raushan291/coding-agent/blob/main/coding_agent/memory/session.py): `coding_agent/memory/session.py`
- [Semantic answer cache](https://github.com/raushan291/coding-agent/blob/main/coding_agent/cache/semantic_cache.py): `coding_agent/cache/semantic_cache.py`
- [Redis startup](https://github.com/raushan291/coding-agent/blob/main/coding_agent/cache/redis_manager.py): `coding_agent/cache/redis_manager.py`

### Other components

- **Developer**
- **Launched codebase**

## Connections

- Developer → Command interface: enters commands
- Command interface → Indexer selection: gets index (evidence: `coding_agent/main.py`)
- Indexer selection → Vector indexer: selects backend (evidence: `coding_agent/context/indexers/factory.py`)
- Vector indexer → Code parser: parses files (evidence: `coding_agent/context/indexers/semantic_chroma.py`)
- Launched codebase → Vector indexer: provides source
- Command interface → File watcher: starts watcher (evidence: `coding_agent/main.py`)
- File watcher → Vector indexer: reindexes edits (evidence: `coding_agent/context/indexers/watcher.py`)
- Command interface → Tool-calling agent: builds agent (evidence: `coding_agent/main.py`)
- Tool-calling agent → LLM and embedder: loads model (evidence: `coding_agent/agent/factory.py`)
- Tool-calling agent → Code search tool: registers search (evidence: `coding_agent/agent/factory.py`)
- Code search tool → Retriever selection: gets retriever (evidence: `coding_agent/agent/tools.py`)
- Retriever selection → Hybrid retrieval: selects backend (evidence: `coding_agent/context/retrievers/factory.py`)
- Hybrid retrieval → Vector indexer: searches index
- Tool-calling agent → Conversation memory: summarizes context (evidence: `coding_agent/agent/factory.py`)
- Command interface → Query handler: handles questions (evidence: `coding_agent/main.py`)
- Query handler → Tool-calling agent: runs agent
- Command interface → Semantic answer cache: checks answers (evidence: `coding_agent/main.py`)
- Command interface → Redis startup: ensures Redis (evidence: `coding_agent/main.py`)
- Redis startup → Semantic answer cache: enables cache
- Command interface → Session management: manages sessions (evidence: `coding_agent/main.py`)
- Tool-calling agent → Skill tools: registers skills (evidence: `coding_agent/agent/factory.py`)
- Skill tools → Skills registry: loads skills (evidence: `coding_agent/skills/skill_tools.py`)
- Tool-calling agent → MCP tools client: loads MCP tools (evidence: `coding_agent/agent/factory.py`)
- Tool-calling agent → Shell tools: registers shell tools (evidence: `coding_agent/agent/factory.py`)
- Developer → Command interface: submits goal
- Command interface → Task orchestrator: starts planning (evidence: `coding_agent/main.py`)
- Task orchestrator → Task planner: requests plan (evidence: `coding_agent/tasks/orchestrator.py`)
- Task orchestrator → Plan approval: requests approval (evidence: `coding_agent/tasks/orchestrator.py`)
- Task orchestrator → Task database: persists tasks (evidence: `coding_agent/tasks/orchestrator.py`)
- Task orchestrator → Task recovery: recovers tasks (evidence: `coding_agent/tasks/orchestrator.py`)
- Task orchestrator → Task executor: dispatches tasks (evidence: `coding_agent/tasks/orchestrator.py`)
- Task executor → Task database: updates status (evidence: `coding_agent/tasks/executor.py`)
- Task executor → Shell tools: uses shell tools (evidence: `coding_agent/tasks/executor.py`)
- Task orchestrator → Indexer selection: reindexes output (evidence: `coding_agent/tasks/orchestrator.py`)
