# sanju234-san/mini-devin architecture

> Architecture diagram of the GitHub repository sanju234-san/mini-devin, 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/sanju234-san/mini-devin
- Repository: https://github.com/sanju234-san/mini-devin

## Overview

Mini-Devin turns a GitHub issue into a reviewed pull request through an autonomous multi-agent workflow, with human approval of the plan before code changes. The backend also provides live run visibility, retrieval, sandbox verification, artifact and metrics APIs, and evaluation support. The README documents the product workflow and major capabilities; sampled routing code confirms approval and retry stages, but the graph builder and most API, agent, and integration implementations were not inspected, so detailed internal calls are not asserted.

Main entry points: [`backend/app/agents/graph.py`](https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/graph.py) (Agent orchestration), [`backend/app/websocket/live_stream.py`](https://github.com/sanju234-san/mini-devin/blob/main/backend/app/websocket/live_stream.py) (Live run stream), [`backend/app/agents/retrieval_agent.py`](https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/retrieval_agent.py) (Retrieval agent), [`backend/app/agents/planner_agent.py`](https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/planner_agent.py) (Plan authoring)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Agent workflow"]
  node_agent_graph["Agent orchestration<br/>[graph.py]"]
  node_routing["Workflow routing<br/>[routing.py]"]
  node_schemas["Run and plan schemas<br/>[schemas.py]"]
  node_guardrails["Input and output guardrails"]
  node_triage["Issue triage<br/>[triage_agent.py]"]
  node_retrieval_agent["Retrieval agent<br/>[retrieval_agent.py]"]
  node_planner["Plan authoring<br/>[planner_agent.py]"]
  node_coder["Code generation<br/>[coder_agent.py]"]
  node_debugger["Debug and revise<br/>[debugger_agent.py]"]
  node_reviewer["Change review<br/>[reviewer_agent.py]"]
  node_pr_agent["Pull request creation<br/>[pr_agent.py]"]
end

subgraph group_support["Knowledge and models"]
  node_retrieval[("Index and vector search")]
  node_embedding["Text embeddings<br/>[embedding_model.py]"]
  node_triage_model["Triage classifier"]
  node_model_router["Model selection<br/>[model_router.py]"]
  node_llm_client["LLM provider fallback"]
end

subgraph group_runtime["Backend services"]
  node_api["REST API"]
  node_sandbox["Isolated verification"]
  node_github["GitHub integration<br/>[github_client.py]"]
  node_live_stream["Live run stream<br/>[live_stream.py]"]
end

subgraph group_experience["Run experience"]
  node_dashboard["React dashboard<br/>[page.tsx]"]
  node_socket_hook["Run socket hook"]
  node_chainlit["Chainlit console<br/>[app.py]"]
end

subgraph group_evaluation["Evaluation"]
  node_eval["Benchmark evaluation<br/>[run_eval.py]"]
end

node_issue(("GitHub issue"))
node_human(("Plan approver"))

node_issue -->|"starts run"| node_agent_graph
node_agent_graph -->|"checks input"| node_guardrails
node_agent_graph -->|"routes triage"| node_triage
node_agent_graph -->|"routes retrieval"| node_retrieval_agent
node_agent_graph -->|"routes planning"| node_planner
node_planner -->|"requests approval"| node_human
node_human -->|"approves plan"| node_agent_graph
node_agent_graph -->|"routes coding"| node_coder
node_agent_graph -->|"verifies live"| node_sandbox
node_agent_graph -->|"revises failures"| node_debugger
node_agent_graph -->|"routes review"| node_reviewer
node_agent_graph -->|"creates pull request"| node_pr_agent
node_triage_model -.->|"classifies"| node_triage
node_retrieval_agent -.->|"queries index"| node_retrieval
node_embedding -->|"embeds chunks"| node_retrieval
node_model_router -->|"selects provider"| node_llm_client
node_agent_graph -->|"serves runs"| node_api
node_agent_graph -->|"emits run events"| node_live_stream
node_dashboard -->|"subscribes"| node_socket_hook
node_socket_hook -->|"receives events"| node_live_stream
node_chainlit -->|"renders stream"| node_live_stream
node_eval -.->|"evaluates runs"| node_agent_graph

click node_agent_graph "https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/graph.py"
click node_routing "https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/routing.py"
click node_schemas "https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/schemas.py"
click node_guardrails "https://github.com/sanju234-san/mini-devin/tree/main/backend/app/guardrails"
click node_triage "https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/triage_agent.py"
click node_retrieval_agent "https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/retrieval_agent.py"
click node_planner "https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/planner_agent.py"
click node_coder "https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/coder_agent.py"
click node_debugger "https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/debugger_agent.py"
click node_reviewer "https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/reviewer_agent.py"
click node_pr_agent "https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/pr_agent.py"
click node_retrieval "https://github.com/sanju234-san/mini-devin/tree/main/backend/app/retrieval"
click node_embedding "https://github.com/sanju234-san/mini-devin/blob/main/backend/app/ml_models/embedding_model.py"
click node_triage_model "https://github.com/sanju234-san/mini-devin/blob/main/backend/app/ml_models/triage_classifier.py"
click node_model_router "https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/model_router.py"
click node_llm_client "https://github.com/sanju234-san/mini-devin/blob/main/backend/app/integrations/llm_provider_client.py"
click node_api "https://github.com/sanju234-san/mini-devin/tree/main/backend/app/api"
click node_sandbox "https://github.com/sanju234-san/mini-devin/tree/main/backend/app/sandbox"
click node_github "https://github.com/sanju234-san/mini-devin/blob/main/backend/app/integrations/github_client.py"
click node_live_stream "https://github.com/sanju234-san/mini-devin/blob/main/backend/app/websocket/live_stream.py"
click node_dashboard "https://github.com/sanju234-san/mini-devin/blob/main/frontend/src/app/page.tsx"
click node_socket_hook "https://github.com/sanju234-san/mini-devin/blob/main/frontend/src/hooks/useAgentRunSocket.ts"
click node_chainlit "https://github.com/sanju234-san/mini-devin/blob/main/chainlit_console/app.py"
click node_eval "https://github.com/sanju234-san/mini-devin/blob/main/evaluation/swebench_lite/run_eval.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_agent_graph,node_routing,node_schemas,node_guardrails,node_triage,node_retrieval_agent,node_planner,node_coder,node_debugger,node_reviewer,node_pr_agent toneBlue
class node_retrieval,node_embedding,node_triage_model,node_model_router,node_llm_client toneAmber
class node_api,node_sandbox,node_github,node_live_stream toneMint
class node_dashboard,node_socket_hook,node_chainlit toneRose
class node_eval,node_issue,node_human toneIndigo
```

## Components

### Agent workflow

- [Agent orchestration](https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/graph.py): `backend/app/agents/graph.py`
- [Workflow routing](https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/routing.py): `backend/app/agents/routing.py`
- [Run and plan schemas](https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/schemas.py): `backend/app/agents/schemas.py`
- [Input and output guardrails](https://github.com/sanju234-san/mini-devin/tree/main/backend/app/guardrails): `backend/app/guardrails`
- [Issue triage](https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/triage_agent.py): `backend/app/agents/triage_agent.py`
- [Retrieval agent](https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/retrieval_agent.py): `backend/app/agents/retrieval_agent.py`
- [Plan authoring](https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/planner_agent.py): `backend/app/agents/planner_agent.py`
- [Code generation](https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/coder_agent.py): `backend/app/agents/coder_agent.py`
- [Debug and revise](https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/debugger_agent.py): `backend/app/agents/debugger_agent.py`
- [Change review](https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/reviewer_agent.py): `backend/app/agents/reviewer_agent.py`
- [Pull request creation](https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/pr_agent.py): `backend/app/agents/pr_agent.py`

### Knowledge and models

- [Index and vector search](https://github.com/sanju234-san/mini-devin/tree/main/backend/app/retrieval): `backend/app/retrieval`
- [Text embeddings](https://github.com/sanju234-san/mini-devin/blob/main/backend/app/ml_models/embedding_model.py): `backend/app/ml_models/embedding_model.py`
- [Triage classifier](https://github.com/sanju234-san/mini-devin/blob/main/backend/app/ml_models/triage_classifier.py): `backend/app/ml_models/triage_classifier.py`
- [Model selection](https://github.com/sanju234-san/mini-devin/blob/main/backend/app/agents/model_router.py): `backend/app/agents/model_router.py`
- [LLM provider fallback](https://github.com/sanju234-san/mini-devin/blob/main/backend/app/integrations/llm_provider_client.py): `backend/app/integrations/llm_provider_client.py`

### Backend services

- [REST API](https://github.com/sanju234-san/mini-devin/tree/main/backend/app/api): `backend/app/api`
- [Isolated verification](https://github.com/sanju234-san/mini-devin/tree/main/backend/app/sandbox): `backend/app/sandbox`
- [GitHub integration](https://github.com/sanju234-san/mini-devin/blob/main/backend/app/integrations/github_client.py): `backend/app/integrations/github_client.py`
- [Live run stream](https://github.com/sanju234-san/mini-devin/blob/main/backend/app/websocket/live_stream.py): `backend/app/websocket/live_stream.py`

### Run experience

- [React dashboard](https://github.com/sanju234-san/mini-devin/blob/main/frontend/src/app/page.tsx): `frontend/src/app/page.tsx`
- [Run socket hook](https://github.com/sanju234-san/mini-devin/blob/main/frontend/src/hooks/useAgentRunSocket.ts): `frontend/src/hooks/useAgentRunSocket.ts`
- [Chainlit console](https://github.com/sanju234-san/mini-devin/blob/main/chainlit_console/app.py): `chainlit_console/app.py`

### Evaluation

- [Benchmark evaluation](https://github.com/sanju234-san/mini-devin/blob/main/evaluation/swebench_lite/run_eval.py): `evaluation/swebench_lite/run_eval.py`

### Other components

- **GitHub issue**
- **Plan approver**

## Connections

- GitHub issue → Agent orchestration: starts run
- Agent orchestration → Input and output guardrails: checks input
- Agent orchestration → Issue triage: routes triage
- Agent orchestration → Retrieval agent: routes retrieval
- Agent orchestration → Plan authoring: routes planning
- Plan authoring → Plan approver: requests approval
- Plan approver → Agent orchestration: approves plan
- Agent orchestration → Code generation: routes coding
- Agent orchestration → Isolated verification: verifies live
- Agent orchestration → Debug and revise: revises failures
- Agent orchestration → Change review: routes review
- Agent orchestration → Pull request creation: creates pull request
- Triage classifier → Issue triage: classifies
- Retrieval agent → Index and vector search: queries index
- Text embeddings → Index and vector search: embeds chunks (evidence: `backend/app/ml_models/embedding_model.py`)
- Model selection → LLM provider fallback: selects provider (evidence: `backend/app/agents/model_router.py`)
- Agent orchestration → REST API: serves runs
- Agent orchestration → Live run stream: emits run events
- React dashboard → Run socket hook: subscribes (evidence: `frontend/src/hooks/useAgentRunSocket.ts`)
- Run socket hook → Live run stream: receives events
- Chainlit console → Live run stream: renders stream (evidence: `chainlit_console/app.py`)
- Benchmark evaluation → Agent orchestration: evaluates runs
