# ld-singh/ai-sdlc-architecture-review-agent architecture

> Architecture diagram of the GitHub repository ld-singh/ai-sdlc-architecture-review-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ld-singh/ai-sdlc-architecture-review-agent
- Repository: https://github.com/ld-singh/ai-sdlc-architecture-review-agent

## Overview

AI-SDLC is a human-in-the-loop architecture review agent: a user submits an issue or PR change, repository context is retrieved, specialist agents assess delivery risks, and the system emits an auditable decision pack and approval recommendation. The main review path is supported by the README and sampled CLI, retrieval, agent, and graph sources. Optional vector retrieval, live GitHub input, model comparison, and evaluation are shown as separate capabilities; unsampled wiring is not inferred beyond documented or indexed references.

Main entry points: [`src/ai_sdlc/graph.py`](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/graph.py) (Agent Graph), [`src/ai_sdlc/llm.py`](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/llm.py) (LLM Client), [`src/ai_sdlc/main.py`](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/main.py) (Review CLI), [`src/ai_sdlc/agents/context_agent.py`](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/agents/context_agent.py) (Context Agent)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Inputs and CLI"]
  node_issue_pr["Issue or PR"]
  node_cli["Review CLI<br/>[main.py]"]
  node_diff["Diff Parser<br/>[diff_parser.py]"]
end

subgraph group_knowledge["Repository Context"]
  node_repo["Review Repository"]
  node_loader["File Loader<br/>[file_loader.py]"]
  node_indexer["Chunk and Index<br/>[indexer.py]"]
  node_retriever["Context Retrieval<br/>[retriever.py]"]
  node_embeddings["Embeddings<br/>[embeddings.py]"]
  node_vector_store[("Vector Store<br/>[vector_store.py]")]
end

subgraph group_review["Review Agents"]
  node_graph["Agent Graph<br/>[graph.py]"]
  node_context_agent["Context Agent<br/>[context_agent.py]"]
  node_architecture["Architecture Impact"]
  node_cicd["CI/CD Risk<br/>[cicd_agent.py]"]
  node_security["Security Governance<br/>[security_agent.py]"]
  node_testing["Testing Strategy<br/>[testing_agent.py]"]
  node_adr["ADR and PR Comment<br/>[adr_agent.py]"]
end

subgraph group_runtime["Runtime Services"]
  node_state["Review State<br/>[models.py]"]
  node_llm["LLM Client<br/>[llm.py]"]
  node_guardrails["Output Guardrails<br/>[guardrails.py]"]
  node_metrics["Run Metrics<br/>[metrics.py]"]
  node_token_estimator["Token Estimator<br/>[token_estimator.py]"]
  node_markdown["Markdown Renderer<br/>[markdown.py]"]
end

subgraph group_outputs["Decision and Evaluation"]
  node_outputs["Decision Pack"]
  node_eval["Golden-case Eval<br/>[runner.py]"]
  node_benchmarks["Model Comparison<br/>[benchmarks.py]"]
end

node_user(("Engineer"))
node_github["GitHub CLI"]
node_provider["LLM Provider"]
node_human(("Named Reviewer"))

node_user -->|"submits"| node_issue_pr
node_issue_pr -->|"reviews"| node_cli
node_github -.->|"fetches read-only"| node_cli
node_cli -.->|"parses diff"| node_diff
node_cli -.->|"runs review"| node_graph
node_repo -->|"loads files"| node_loader
node_loader -->|"chunks files"| node_indexer
node_retriever -->|"loads files"| node_loader
node_retriever -->|"ranks chunks"| node_indexer
node_retriever -->|"embeds chunks"| node_embeddings
node_retriever -->|"searches vectors"| node_vector_store
node_graph -->|"dispatches"| node_context_agent
node_graph -->|"dispatches"| node_architecture
node_graph -->|"dispatches"| node_cicd
node_graph -->|"dispatches"| node_security
node_graph -->|"dispatches"| node_testing
node_graph -->|"dispatches"| node_adr
node_graph -->|"threads state"| node_state
node_context_agent -->|"retrieves context"| node_retriever
node_context_agent -->|"provides context"| node_architecture
node_architecture -->|"feeds findings"| node_cicd
node_cicd -->|"feeds findings"| node_security
node_security -->|"feeds findings"| node_testing
node_testing -->|"feeds findings"| node_adr
node_context_agent -->|"completes prompts"| node_llm
node_architecture -->|"requests findings"| node_llm
node_cicd -->|"requests analysis"| node_llm
node_security -->|"requests analysis"| node_llm
node_testing -->|"requests analysis"| node_llm
node_adr -->|"requests synthesis"| node_llm
node_llm -.->|"calls provider"| node_provider
node_llm -->|"validates output"| node_guardrails
node_llm -->|"estimates usage"| node_token_estimator
node_graph -->|"records metrics"| node_metrics
node_context_agent -->|"renders report"| node_markdown
node_graph -->|"writes decision pack"| node_outputs
node_outputs -->|"requests approval"| node_human
node_cli -->|"runs eval"| node_eval
node_eval -->|"evaluates reviews"| node_graph
node_cli -->|"compares models"| node_benchmarks
node_benchmarks -->|"runs comparisons"| node_graph

click node_cli "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/main.py"
click node_diff "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/tools/diff_parser.py"
click node_loader "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/retrieval/file_loader.py"
click node_indexer "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/retrieval/indexer.py"
click node_retriever "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/retrieval/retriever.py"
click node_embeddings "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/retrieval/embeddings.py"
click node_vector_store "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/retrieval/vector_store.py"
click node_graph "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/graph.py"
click node_state "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/models.py"
click node_context_agent "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/agents/context_agent.py"
click node_architecture "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/agents/architecture_agent.py"
click node_cicd "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/agents/cicd_agent.py"
click node_security "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/agents/security_agent.py"
click node_testing "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/agents/testing_agent.py"
click node_adr "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/agents/adr_agent.py"
click node_llm "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/llm.py"
click node_guardrails "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/guardrails.py"
click node_metrics "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/observability/metrics.py"
click node_token_estimator "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/tools/token_estimator.py"
click node_markdown "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/tools/markdown.py"
click node_eval "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/evals/runner.py"
click node_benchmarks "https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/benchmarks.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_issue_pr,node_cli,node_diff,node_human toneBlue
class node_repo,node_loader,node_indexer,node_retriever,node_embeddings,node_vector_store toneAmber
class node_graph,node_context_agent,node_architecture,node_cicd,node_security,node_testing,node_adr toneMint
class node_state,node_llm,node_guardrails,node_metrics,node_token_estimator,node_markdown toneRose
class node_outputs,node_eval,node_benchmarks,node_user,node_github,node_provider toneIndigo
```

## Components

### Inputs and CLI

- **Issue or PR**
- [Review CLI](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/main.py): `src/ai_sdlc/main.py`
- [Diff Parser](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/tools/diff_parser.py): `src/ai_sdlc/tools/diff_parser.py`

### Repository Context

- **Review Repository**
- [File Loader](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/retrieval/file_loader.py): `src/ai_sdlc/retrieval/file_loader.py`
- [Chunk and Index](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/retrieval/indexer.py): `src/ai_sdlc/retrieval/indexer.py`
- [Context Retrieval](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/retrieval/retriever.py): `src/ai_sdlc/retrieval/retriever.py`
- [Embeddings](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/retrieval/embeddings.py): `src/ai_sdlc/retrieval/embeddings.py`
- [Vector Store](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/retrieval/vector_store.py): `src/ai_sdlc/retrieval/vector_store.py`

### Review Agents

- [Agent Graph](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/graph.py): `src/ai_sdlc/graph.py`
- [Context Agent](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/agents/context_agent.py): `src/ai_sdlc/agents/context_agent.py`
- [Architecture Impact](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/agents/architecture_agent.py): `src/ai_sdlc/agents/architecture_agent.py`
- [CI/CD Risk](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/agents/cicd_agent.py): `src/ai_sdlc/agents/cicd_agent.py`
- [Security Governance](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/agents/security_agent.py): `src/ai_sdlc/agents/security_agent.py`
- [Testing Strategy](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/agents/testing_agent.py): `src/ai_sdlc/agents/testing_agent.py`
- [ADR and PR Comment](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/agents/adr_agent.py): `src/ai_sdlc/agents/adr_agent.py`

### Runtime Services

- [Review State](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/models.py): `src/ai_sdlc/models.py`
- [LLM Client](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/llm.py): `src/ai_sdlc/llm.py`
- [Output Guardrails](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/guardrails.py): `src/ai_sdlc/guardrails.py`
- [Run Metrics](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/observability/metrics.py): `src/ai_sdlc/observability/metrics.py`
- [Token Estimator](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/tools/token_estimator.py): `src/ai_sdlc/tools/token_estimator.py`
- [Markdown Renderer](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/tools/markdown.py): `src/ai_sdlc/tools/markdown.py`

### Decision and Evaluation

- **Decision Pack**
- [Golden-case Eval](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/evals/runner.py): `src/ai_sdlc/evals/runner.py`
- [Model Comparison](https://github.com/ld-singh/ai-sdlc-architecture-review-agent/blob/main/src/ai_sdlc/benchmarks.py): `src/ai_sdlc/benchmarks.py`

### Other components

- **Engineer**
- **GitHub CLI**
- **LLM Provider**
- **Named Reviewer**

## Connections

- Engineer → Issue or PR: submits (evidence: `README.md`)
- Issue or PR → Review CLI: reviews (evidence: `README.md`)
- GitHub CLI → Review CLI: fetches read-only (evidence: `README.md`)
- Review CLI → Diff Parser: parses diff (evidence: `src/ai_sdlc/main.py`)
- Review CLI → Agent Graph: runs review (evidence: `src/ai_sdlc/main.py`)
- Review Repository → File Loader: loads files (evidence: `README.md`)
- File Loader → Chunk and Index: chunks files (evidence: `src/ai_sdlc/retrieval/indexer.py`)
- Context Retrieval → File Loader: loads files (evidence: `src/ai_sdlc/retrieval/retriever.py`)
- Context Retrieval → Chunk and Index: ranks chunks (evidence: `src/ai_sdlc/retrieval/retriever.py`)
- Context Retrieval → Embeddings: embeds chunks (evidence: `src/ai_sdlc/retrieval/retriever.py`)
- Context Retrieval → Vector Store: searches vectors (evidence: `src/ai_sdlc/retrieval/retriever.py`)
- Agent Graph → Context Agent: dispatches (evidence: `src/ai_sdlc/graph.py`)
- Agent Graph → Architecture Impact: dispatches (evidence: `src/ai_sdlc/graph.py`)
- Agent Graph → CI/CD Risk: dispatches (evidence: `src/ai_sdlc/graph.py`)
- Agent Graph → Security Governance: dispatches (evidence: `src/ai_sdlc/graph.py`)
- Agent Graph → Testing Strategy: dispatches (evidence: `src/ai_sdlc/graph.py`)
- Agent Graph → ADR and PR Comment: dispatches (evidence: `src/ai_sdlc/graph.py`)
- Agent Graph → Review State: threads state (evidence: `src/ai_sdlc/models.py`)
- Context Agent → Context Retrieval: retrieves context (evidence: `src/ai_sdlc/agents/context_agent.py`)
- Context Agent → Architecture Impact: provides context (evidence: `README.md`)
- Architecture Impact → CI/CD Risk: feeds findings (evidence: `README.md`)
- CI/CD Risk → Security Governance: feeds findings (evidence: `README.md`)
- Security Governance → Testing Strategy: feeds findings (evidence: `README.md`)
- Testing Strategy → ADR and PR Comment: feeds findings (evidence: `README.md`)
- Context Agent → LLM Client: completes prompts (evidence: `src/ai_sdlc/agents/context_agent.py`)
- Architecture Impact → LLM Client: requests findings (evidence: `src/ai_sdlc/agents/architecture_agent.py`)
- CI/CD Risk → LLM Client: requests analysis (evidence: `src/ai_sdlc/agents/cicd_agent.py`)
- Security Governance → LLM Client: requests analysis (evidence: `src/ai_sdlc/agents/security_agent.py`)
- Testing Strategy → LLM Client: requests analysis (evidence: `src/ai_sdlc/agents/testing_agent.py`)
- ADR and PR Comment → LLM Client: requests synthesis (evidence: `src/ai_sdlc/agents/adr_agent.py`)
- LLM Client → LLM Provider: calls provider (evidence: `src/ai_sdlc/llm.py`)
- LLM Client → Output Guardrails: validates output (evidence: `src/ai_sdlc/llm.py`)
- LLM Client → Token Estimator: estimates usage (evidence: `src/ai_sdlc/llm.py`)
- Agent Graph → Run Metrics: records metrics (evidence: `src/ai_sdlc/graph.py`)
- Context Agent → Markdown Renderer: renders report (evidence: `src/ai_sdlc/agents/context_agent.py`)
- Agent Graph → Decision Pack: writes decision pack (evidence: `README.md`)
- Decision Pack → Named Reviewer: requests approval (evidence: `README.md`)
- Review CLI → Golden-case Eval: runs eval (evidence: `src/ai_sdlc/main.py`)
- Golden-case Eval → Agent Graph: evaluates reviews (evidence: `src/ai_sdlc/evals/runner.py`)
- Review CLI → Model Comparison: compares models (evidence: `src/ai_sdlc/main.py`)
- Model Comparison → Agent Graph: runs comparisons (evidence: `src/ai_sdlc/benchmarks.py`)
