# akash-2615/architect-ai architecture

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

- Interactive diagram: https://gitdiagram.com/akash-2615/architect-ai
- Repository: https://github.com/akash-2615/architect-ai

## Overview

ArchitectAI turns a project brief into a streamed, multi-agent architecture debate, then produces a synthesized design and downloadable reports. The principal flow runs from setup through API session creation, debate phases, persistence and SSE updates, to the final architecture view and report downloads. History is a separate user capability. Relationships are based on the README and source-index references; sampled code confirms only some calls, so unsampled subsystem links are omitted where their caller is not evidenced.

Main entry points: [`backend/app/api/routes.py`](https://github.com/akash-2615/architect-ai/blob/main/backend/app/api/routes.py) (Session API and SSE), [`backend/app/debate/engine.py`](https://github.com/akash-2615/architect-ai/blob/main/backend/app/debate/engine.py) (Debate orchestration), [`frontend/src/App.tsx`](https://github.com/akash-2615/architect-ai/blob/main/frontend/src/App.tsx) (Page router), [`frontend/src/pages/DebatePage.tsx`](https://github.com/akash-2615/architect-ai/blob/main/frontend/src/pages/DebatePage.tsx) (Live debate view)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web application"]
  node_app["Page router<br/>[App.tsx]"]
  node_setup["Brief setup<br/>[SetupPage.tsx]"]
  node_history["Session history<br/>[HistoryPage.tsx]"]
  node_debateview["Live debate view<br/>[DebatePage.tsx]"]
  node_api_client["API client<br/>[client.ts]"]
  node_stream_hook["SSE stream hook"]
  node_event_store["Event state store<br/>[debateStore.ts]"]
  node_results["Architecture results<br/>[ResultPanel.tsx]"]
  node_diagram["Diagram renderer<br/>[MermaidDiagram.tsx]"]
  node_scorecard["Scorecard chart<br/>[ScorecardChart.tsx]"]
end

subgraph group_api["Session API"]
  node_routes["Session API and SSE<br/>[routes.py]"]
end

subgraph group_debate["Debate system"]
  node_engine["Debate orchestration<br/>[engine.py]"]
  node_agents["Agent implementations<br/>[agents.py]"]
  node_prompts["Agent prompts<br/>[prompts.py]"]
  node_config["Runtime settings<br/>[config.py]"]
  node_publisher["SSE event publisher<br/>[sse_publisher.py]"]
end

subgraph group_data["Persistence and reports"]
  node_db[("Session database<br/>[database.py]")]
  node_models["Session data models<br/>[models.py]"]
  node_documents["PDF and DOCX reports"]
end

node_user(("Project user"))
node_anthropic["Anthropic API"]

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_setup
node_app -->|"routes to"| node_debateview
node_app -->|"routes to"| node_history
node_setup -->|"creates session"| node_api_client
node_history -->|"lists sessions"| node_api_client
node_debateview -->|"starts stream"| node_stream_hook
node_debateview -->|"reads state"| node_event_store
node_debateview -->|"renders results"| node_results
node_stream_hook -->|"loads session"| node_api_client
node_stream_hook -->|"dispatches events"| node_event_store
node_results -->|"renders diagram"| node_diagram
node_results -->|"renders scorecard"| node_scorecard
node_api_client -->|"calls API"| node_routes
node_routes -->|"starts debate"| node_engine
node_routes -->|"reads and writes"| node_db
node_routes -->|"streams events"| node_publisher
node_engine -->|"runs agents"| node_agents
node_agents -->|"uses prompts"| node_prompts
node_agents -->|"uses settings"| node_config
node_agents -.->|"calls LLM"| node_anthropic
node_engine -->|"persists debate"| node_db
node_engine -->|"emits events"| node_publisher
node_engine -->|"generates reports"| node_documents
node_db -->|"registers models"| node_models
node_publisher -->|"delivers SSE"| node_stream_hook
node_routes -->|"serves downloads"| node_documents

click node_app "https://github.com/akash-2615/architect-ai/blob/main/frontend/src/App.tsx"
click node_setup "https://github.com/akash-2615/architect-ai/blob/main/frontend/src/pages/SetupPage.tsx"
click node_history "https://github.com/akash-2615/architect-ai/blob/main/frontend/src/pages/HistoryPage.tsx"
click node_debateview "https://github.com/akash-2615/architect-ai/blob/main/frontend/src/pages/DebatePage.tsx"
click node_api_client "https://github.com/akash-2615/architect-ai/blob/main/frontend/src/api/client.ts"
click node_stream_hook "https://github.com/akash-2615/architect-ai/blob/main/frontend/src/hooks/useSessionStream.ts"
click node_event_store "https://github.com/akash-2615/architect-ai/blob/main/frontend/src/store/debateStore.ts"
click node_results "https://github.com/akash-2615/architect-ai/blob/main/frontend/src/components/ResultPanel.tsx"
click node_diagram "https://github.com/akash-2615/architect-ai/blob/main/frontend/src/components/MermaidDiagram.tsx"
click node_scorecard "https://github.com/akash-2615/architect-ai/blob/main/frontend/src/components/ScorecardChart.tsx"
click node_routes "https://github.com/akash-2615/architect-ai/blob/main/backend/app/api/routes.py"
click node_engine "https://github.com/akash-2615/architect-ai/blob/main/backend/app/debate/engine.py"
click node_agents "https://github.com/akash-2615/architect-ai/blob/main/backend/app/debate/agents.py"
click node_prompts "https://github.com/akash-2615/architect-ai/blob/main/backend/app/debate/prompts.py"
click node_config "https://github.com/akash-2615/architect-ai/blob/main/backend/app/config.py"
click node_publisher "https://github.com/akash-2615/architect-ai/blob/main/backend/app/services/sse_publisher.py"
click node_db "https://github.com/akash-2615/architect-ai/blob/main/backend/app/db/database.py"
click node_models "https://github.com/akash-2615/architect-ai/blob/main/backend/app/db/models.py"
click node_documents "https://github.com/akash-2615/architect-ai/blob/main/backend/app/services/document_generator.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,node_setup,node_history,node_debateview,node_api_client,node_stream_hook,node_event_store,node_results,node_diagram,node_scorecard,node_user toneBlue
class node_routes toneAmber
class node_engine,node_agents,node_prompts,node_config,node_publisher,node_anthropic toneMint
class node_db,node_models,node_documents toneRose
```

## Components

### Web application

- [Page router](https://github.com/akash-2615/architect-ai/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Brief setup](https://github.com/akash-2615/architect-ai/blob/main/frontend/src/pages/SetupPage.tsx): `frontend/src/pages/SetupPage.tsx`
- [Session history](https://github.com/akash-2615/architect-ai/blob/main/frontend/src/pages/HistoryPage.tsx): `frontend/src/pages/HistoryPage.tsx`
- [Live debate view](https://github.com/akash-2615/architect-ai/blob/main/frontend/src/pages/DebatePage.tsx): `frontend/src/pages/DebatePage.tsx`
- [API client](https://github.com/akash-2615/architect-ai/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [SSE stream hook](https://github.com/akash-2615/architect-ai/blob/main/frontend/src/hooks/useSessionStream.ts): `frontend/src/hooks/useSessionStream.ts`
- [Event state store](https://github.com/akash-2615/architect-ai/blob/main/frontend/src/store/debateStore.ts): `frontend/src/store/debateStore.ts`
- [Architecture results](https://github.com/akash-2615/architect-ai/blob/main/frontend/src/components/ResultPanel.tsx): `frontend/src/components/ResultPanel.tsx`
- [Diagram renderer](https://github.com/akash-2615/architect-ai/blob/main/frontend/src/components/MermaidDiagram.tsx): `frontend/src/components/MermaidDiagram.tsx`
- [Scorecard chart](https://github.com/akash-2615/architect-ai/blob/main/frontend/src/components/ScorecardChart.tsx): `frontend/src/components/ScorecardChart.tsx`

### Session API

- [Session API and SSE](https://github.com/akash-2615/architect-ai/blob/main/backend/app/api/routes.py): `backend/app/api/routes.py`

### Debate system

- [Debate orchestration](https://github.com/akash-2615/architect-ai/blob/main/backend/app/debate/engine.py): `backend/app/debate/engine.py`
- [Agent implementations](https://github.com/akash-2615/architect-ai/blob/main/backend/app/debate/agents.py): `backend/app/debate/agents.py`
- [Agent prompts](https://github.com/akash-2615/architect-ai/blob/main/backend/app/debate/prompts.py): `backend/app/debate/prompts.py`
- [Runtime settings](https://github.com/akash-2615/architect-ai/blob/main/backend/app/config.py): `backend/app/config.py`
- [SSE event publisher](https://github.com/akash-2615/architect-ai/blob/main/backend/app/services/sse_publisher.py): `backend/app/services/sse_publisher.py`

### Persistence and reports

- [Session database](https://github.com/akash-2615/architect-ai/blob/main/backend/app/db/database.py): `backend/app/db/database.py`
- [Session data models](https://github.com/akash-2615/architect-ai/blob/main/backend/app/db/models.py): `backend/app/db/models.py`
- [PDF and DOCX reports](https://github.com/akash-2615/architect-ai/blob/main/backend/app/services/document_generator.py): `backend/app/services/document_generator.py`

### Other components

- **Project user**
- **Anthropic API**

## Connections

- Project user → Page router: opens (evidence: `frontend/src/App.tsx`)
- Page router → Brief setup: routes to (evidence: `frontend/src/App.tsx`)
- Page router → Live debate view: routes to (evidence: `frontend/src/App.tsx`)
- Page router → Session history: routes to (evidence: `frontend/src/App.tsx`)
- Brief setup → API client: creates session (evidence: `frontend/src/pages/SetupPage.tsx`)
- Session history → API client: lists sessions (evidence: `frontend/src/pages/HistoryPage.tsx`)
- Live debate view → SSE stream hook: starts stream (evidence: `frontend/src/pages/DebatePage.tsx`)
- Live debate view → Event state store: reads state (evidence: `frontend/src/pages/DebatePage.tsx`)
- Live debate view → Architecture results: renders results (evidence: `frontend/src/pages/DebatePage.tsx`)
- SSE stream hook → API client: loads session (evidence: `frontend/src/hooks/useSessionStream.ts`)
- SSE stream hook → Event state store: dispatches events (evidence: `frontend/src/hooks/useSessionStream.ts`)
- Architecture results → Diagram renderer: renders diagram (evidence: `frontend/src/components/ResultPanel.tsx`)
- Architecture results → Scorecard chart: renders scorecard (evidence: `frontend/src/components/ResultPanel.tsx`)
- API client → Session API and SSE: calls API (evidence: `README.md`)
- Session API and SSE → Debate orchestration: starts debate (evidence: `backend/app/api/routes.py`)
- Session API and SSE → Session database: reads and writes (evidence: `backend/app/api/routes.py`)
- Session API and SSE → SSE event publisher: streams events (evidence: `backend/app/api/routes.py`)
- Debate orchestration → Agent implementations: runs agents (evidence: `backend/app/debate/engine.py`)
- Agent implementations → Agent prompts: uses prompts (evidence: `backend/app/debate/agents.py`)
- Agent implementations → Runtime settings: uses settings (evidence: `backend/app/debate/agents.py`)
- Agent implementations → Anthropic API: calls LLM (evidence: `README.md`)
- Debate orchestration → Session database: persists debate (evidence: `backend/app/debate/engine.py`)
- Debate orchestration → SSE event publisher: emits events (evidence: `backend/app/debate/engine.py`)
- Debate orchestration → PDF and DOCX reports: generates reports (evidence: `backend/app/debate/engine.py`)
- Session database → Session data models: registers models (evidence: `backend/app/db/database.py`)
- SSE event publisher → SSE stream hook: delivers SSE (evidence: `README.md`)
- Session API and SSE → PDF and DOCX reports: serves downloads (evidence: `README.md`)
