# darshankamate1254/codearchitect-ai-agent architecture

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

- Interactive diagram: https://gitdiagram.com/darshankamate1254/codearchitect-ai-agent
- Repository: https://github.com/darshankamate1254/codearchitect-ai-agent

## Overview

CodeArchitect AI turns a user’s project request into a structured plan, breaks it into implementation tasks, then uses a tool-enabled coder to create and refine project files. The CLI invokes a LangGraph workflow; planner and architect calls use Groq-backed structured outputs, while the coder iterates through tasks and reads or writes files under a bounded project root. Pydantic models define the plan and coder state. The README also describes visual execution debugging; the graph enables LangChain debug mode. Generated application examples in the tree are outputs, not runtime components. Relationships reflect the sampled workflow and README; unsampled capabilities are not expanded into speculative edges.

Main entry points: [`agent/graph.py`](https://github.com/darshankamate1254/codearchitect-ai-agent/blob/main/agent/graph.py) (Coder agent), [`agent/tools.py`](https://github.com/darshankamate1254/codearchitect-ai-agent/blob/main/agent/tools.py) (Filesystem tools), [`agent/prompts.py`](https://github.com/darshankamate1254/codearchitect-ai-agent/blob/main/agent/prompts.py) (Agent prompts), [`agent/states.py`](https://github.com/darshankamate1254/codearchitect-ai-agent/blob/main/agent/states.py) (Plan and state schemas)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry"]
  node_cli["Prompt CLI<br/>[main.py]"]
end

subgraph group_workflow["Agent workflow"]
  node_workflow_graph["LangGraph workflow<br/>[graph.py]"]
  node_planner["Planner agent<br/>[graph.py]"]
  node_architect["Architect agent<br/>[graph.py]"]
  node_coder["Coder agent<br/>[graph.py]"]
end

subgraph group_support["Models and tools"]
  node_prompts["Agent prompts<br/>[prompts.py]"]
  node_schemas["Plan and state schemas<br/>[states.py]"]
  node_file_tools["Filesystem tools<br/>[tools.py]"]
end

node_user(("Project requester"))
node_groq["Groq LLM"]
node_react_tools["Tool agent runtime"]
node_project_files["Generated project files"]

node_user -->|"enters request"| node_cli
node_cli -->|"invokes"| node_workflow_graph
node_workflow_graph -->|"starts at"| node_planner
node_planner -->|"dispatches"| node_architect
node_architect -->|"dispatches"| node_coder
node_coder -->|"repeats tasks"| node_coder
node_planner -->|"builds prompt"| node_prompts
node_architect -->|"builds prompt"| node_prompts
node_coder -->|"gets instructions"| node_prompts
node_planner -->|"validates Plan"| node_schemas
node_architect -->|"validates TaskPlan"| node_schemas
node_coder -->|"tracks progress"| node_schemas
node_planner -->|"requests structured output"| node_groq
node_architect -->|"requests structured output"| node_groq
node_coder -->|"creates tool agent"| node_react_tools
node_react_tools -->|"uses tools"| node_file_tools
node_coder -->|"reads task file"| node_file_tools
node_file_tools -->|"reads and writes"| node_project_files

click node_cli "https://github.com/darshankamate1254/codearchitect-ai-agent/blob/main/main.py"
click node_workflow_graph "https://github.com/darshankamate1254/codearchitect-ai-agent/blob/main/agent/graph.py"
click node_planner "https://github.com/darshankamate1254/codearchitect-ai-agent/blob/main/agent/graph.py"
click node_architect "https://github.com/darshankamate1254/codearchitect-ai-agent/blob/main/agent/graph.py"
click node_coder "https://github.com/darshankamate1254/codearchitect-ai-agent/blob/main/agent/graph.py"
click node_prompts "https://github.com/darshankamate1254/codearchitect-ai-agent/blob/main/agent/prompts.py"
click node_schemas "https://github.com/darshankamate1254/codearchitect-ai-agent/blob/main/agent/states.py"
click node_file_tools "https://github.com/darshankamate1254/codearchitect-ai-agent/blob/main/agent/tools.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 toneBlue
class node_workflow_graph,node_planner,node_architect,node_coder toneAmber
class node_prompts,node_schemas,node_file_tools,node_user toneMint
class node_groq,node_react_tools,node_project_files toneIndigo
```

## Components

### Entry

- [Prompt CLI](https://github.com/darshankamate1254/codearchitect-ai-agent/blob/main/main.py): `main.py`

### Agent workflow

- [LangGraph workflow](https://github.com/darshankamate1254/codearchitect-ai-agent/blob/main/agent/graph.py): `agent/graph.py`
- [Planner agent](https://github.com/darshankamate1254/codearchitect-ai-agent/blob/main/agent/graph.py): `agent/graph.py`
- [Architect agent](https://github.com/darshankamate1254/codearchitect-ai-agent/blob/main/agent/graph.py): `agent/graph.py`
- [Coder agent](https://github.com/darshankamate1254/codearchitect-ai-agent/blob/main/agent/graph.py): `agent/graph.py`

### Models and tools

- [Agent prompts](https://github.com/darshankamate1254/codearchitect-ai-agent/blob/main/agent/prompts.py): `agent/prompts.py`
- [Plan and state schemas](https://github.com/darshankamate1254/codearchitect-ai-agent/blob/main/agent/states.py): `agent/states.py`
- [Filesystem tools](https://github.com/darshankamate1254/codearchitect-ai-agent/blob/main/agent/tools.py): `agent/tools.py`

### Other components

- **Project requester**
- **Groq LLM**
- **Tool agent runtime**
- **Generated project files**

## Connections

- Project requester → Prompt CLI: enters request (evidence: `main.py`)
- Prompt CLI → LangGraph workflow: invokes (evidence: `main.py`)
- LangGraph workflow → Planner agent: starts at (evidence: `agent/graph.py`)
- Planner agent → Architect agent: dispatches (evidence: `agent/graph.py`)
- Architect agent → Coder agent: dispatches (evidence: `agent/graph.py`)
- Coder agent → Coder agent: repeats tasks (evidence: `agent/graph.py`)
- Planner agent → Agent prompts: builds prompt (evidence: `agent/graph.py`)
- Architect agent → Agent prompts: builds prompt (evidence: `agent/graph.py`)
- Coder agent → Agent prompts: gets instructions (evidence: `agent/graph.py`)
- Planner agent → Plan and state schemas: validates Plan (evidence: `agent/graph.py`)
- Architect agent → Plan and state schemas: validates TaskPlan (evidence: `agent/graph.py`)
- Coder agent → Plan and state schemas: tracks progress (evidence: `agent/graph.py`)
- Planner agent → Groq LLM: requests structured output (evidence: `agent/graph.py`)
- Architect agent → Groq LLM: requests structured output (evidence: `agent/graph.py`)
- Coder agent → Tool agent runtime: creates tool agent (evidence: `agent/graph.py`)
- Tool agent runtime → Filesystem tools: uses tools
- Coder agent → Filesystem tools: reads task file (evidence: `agent/graph.py`)
- Filesystem tools → Generated project files: reads and writes (evidence: `agent/tools.py`)
