# hindavishewale/api_documentation_agent architecture

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

- Interactive diagram: https://gitdiagram.com/hindavishewale/api_documentation_agent
- Repository: https://github.com/hindavishewale/api_documentation_agent

## Overview

API Documentation Agent turns API source and existing documentation into normalized contracts, then generates documentation and analyzes drift, version changes, quality, and impact. The main user path is the Streamlit dashboard into the agent workflow, followed by parsing, analysis, self-healing validation, and downloadable artifacts. SQLite knowledge memory, optional Gemini reasoning, and optional RAG are distinct capabilities. Some dashboard wiring and advertised capabilities are supported by the README or source index rather than complete excerpts; uncertain runtime links are omitted.

Main entry points: [`agent/graph.py`](https://github.com/hindavishewale/api_documentation_agent/blob/main/agent/graph.py) (Agent execution), [`models/domain.py`](https://github.com/hindavishewale/api_documentation_agent/blob/main/models/domain.py) (Domain contracts), [`tools/toolkit.py`](https://github.com/hindavishewale/api_documentation_agent/blob/main/tools/toolkit.py) (Validation and repair), [`app.py`](https://github.com/hindavishewale/api_documentation_agent/blob/main/app.py) (Streamlit dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Dashboard"]
  node_dashboard["Streamlit dashboard<br/>[app.py]"]
end

subgraph group_workflow["Agent Workflow"]
  node_workflow["Agent execution<br/>[graph.py]"]
  node_planner["Intent planner<br/>[planner.py]"]
  node_state["Analysis state<br/>[state.py]"]
end

subgraph group_analysis["Contract Analysis"]
  node_parser["Static API parser<br/>[openapi_parser.py]"]
  node_contracts["Domain contracts<br/>[domain.py]"]
  node_comparison["Version comparison<br/>[analysis.py]"]
  node_drift["Drift detection<br/>[analysis.py]"]
  node_impact["Impact analysis<br/>[analysis.py]"]
  node_quality["Health scoring<br/>[analysis.py]"]
end

subgraph group_outputs["Documentation Outputs"]
  node_toolkit["Validation and repair<br/>[toolkit.py]"]
  node_artifacts["Artifact generation<br/>[artifacts.py]"]
end

subgraph group_integrations["Memory &amp; Integrations"]
  node_memory[("SQLite knowledge store<br/>[storage.py]")]
  node_rag["Standards retrieval<br/>[retriever.py]"]
  node_gemini["Gemini reasoning"]
end

node_user(("API author"))

node_user -->|"submits API inputs"| node_dashboard
node_dashboard -->|"starts analysis"| node_workflow
node_dashboard -->|"uses knowledge store"| node_memory
node_workflow -->|"plans tools"| node_planner
node_workflow -->|"processes state"| node_state
node_workflow -->|"parses inputs"| node_parser
node_workflow -->|"compares versions"| node_comparison
node_workflow -->|"detects drift"| node_drift
node_workflow -->|"builds impact graph"| node_impact
node_workflow -->|"scores documentation"| node_quality
node_workflow -->|"validates and repairs"| node_toolkit
node_workflow -->|"renders artifacts"| node_artifacts
node_parser -->|"creates models"| node_contracts
node_comparison -->|"compares models"| node_contracts
node_drift -->|"checks contracts"| node_contracts
node_impact -->|"analyzes relationships"| node_contracts
node_quality -->|"scores contracts"| node_contracts
node_toolkit -->|"delegates analysis"| node_comparison
node_toolkit -->|"validates drift"| node_drift
node_toolkit -->|"calculates score"| node_quality
node_toolkit -->|"generates docs"| node_artifacts
node_artifacts -->|"renders models"| node_contracts
node_workflow -.->|"requests explanations"| node_gemini
node_planner -.->|"plans retrieval"| node_rag

click node_dashboard "https://github.com/hindavishewale/api_documentation_agent/blob/main/app.py"
click node_workflow "https://github.com/hindavishewale/api_documentation_agent/blob/main/agent/graph.py"
click node_planner "https://github.com/hindavishewale/api_documentation_agent/blob/main/agent/planner.py"
click node_state "https://github.com/hindavishewale/api_documentation_agent/blob/main/agent/state.py"
click node_parser "https://github.com/hindavishewale/api_documentation_agent/blob/main/parsers/openapi_parser.py"
click node_contracts "https://github.com/hindavishewale/api_documentation_agent/blob/main/models/domain.py"
click node_comparison "https://github.com/hindavishewale/api_documentation_agent/blob/main/tools/analysis.py"
click node_drift "https://github.com/hindavishewale/api_documentation_agent/blob/main/tools/analysis.py"
click node_impact "https://github.com/hindavishewale/api_documentation_agent/blob/main/tools/analysis.py"
click node_quality "https://github.com/hindavishewale/api_documentation_agent/blob/main/tools/analysis.py"
click node_toolkit "https://github.com/hindavishewale/api_documentation_agent/blob/main/tools/toolkit.py"
click node_artifacts "https://github.com/hindavishewale/api_documentation_agent/blob/main/generators/artifacts.py"
click node_memory "https://github.com/hindavishewale/api_documentation_agent/blob/main/storage.py"
click node_rag "https://github.com/hindavishewale/api_documentation_agent/blob/main/rag/retriever.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_dashboard toneBlue
class node_workflow,node_planner,node_state toneAmber
class node_parser,node_contracts,node_comparison,node_drift,node_impact,node_quality,node_user toneMint
class node_toolkit,node_artifacts toneRose
class node_memory,node_rag,node_gemini toneIndigo
```

## Components

### Dashboard

- [Streamlit dashboard](https://github.com/hindavishewale/api_documentation_agent/blob/main/app.py): `app.py`

### Agent Workflow

- [Agent execution](https://github.com/hindavishewale/api_documentation_agent/blob/main/agent/graph.py): `agent/graph.py`
- [Intent planner](https://github.com/hindavishewale/api_documentation_agent/blob/main/agent/planner.py): `agent/planner.py`
- [Analysis state](https://github.com/hindavishewale/api_documentation_agent/blob/main/agent/state.py): `agent/state.py`

### Contract Analysis

- [Static API parser](https://github.com/hindavishewale/api_documentation_agent/blob/main/parsers/openapi_parser.py): `parsers/openapi_parser.py`
- [Domain contracts](https://github.com/hindavishewale/api_documentation_agent/blob/main/models/domain.py): `models/domain.py`
- [Version comparison](https://github.com/hindavishewale/api_documentation_agent/blob/main/tools/analysis.py): `tools/analysis.py`
- [Drift detection](https://github.com/hindavishewale/api_documentation_agent/blob/main/tools/analysis.py): `tools/analysis.py`
- [Impact analysis](https://github.com/hindavishewale/api_documentation_agent/blob/main/tools/analysis.py): `tools/analysis.py`
- [Health scoring](https://github.com/hindavishewale/api_documentation_agent/blob/main/tools/analysis.py): `tools/analysis.py`

### Documentation Outputs

- [Validation and repair](https://github.com/hindavishewale/api_documentation_agent/blob/main/tools/toolkit.py): `tools/toolkit.py`
- [Artifact generation](https://github.com/hindavishewale/api_documentation_agent/blob/main/generators/artifacts.py): `generators/artifacts.py`

### Memory & Integrations

- [SQLite knowledge store](https://github.com/hindavishewale/api_documentation_agent/blob/main/storage.py): `storage.py`
- [Standards retrieval](https://github.com/hindavishewale/api_documentation_agent/blob/main/rag/retriever.py): `rag/retriever.py`
- **Gemini reasoning**

### Other components

- **API author**

## Connections

- API author → Streamlit dashboard: submits API inputs (evidence: `README.md`)
- Streamlit dashboard → Agent execution: starts analysis (evidence: `app.py`)
- Streamlit dashboard → SQLite knowledge store: uses knowledge store (evidence: `app.py`)
- Agent execution → Intent planner: plans tools (evidence: `agent/graph.py`)
- Agent execution → Analysis state: processes state (evidence: `agent/graph.py`)
- Agent execution → Static API parser: parses inputs (evidence: `agent/graph.py`)
- Agent execution → Version comparison: compares versions (evidence: `agent/graph.py`)
- Agent execution → Drift detection: detects drift (evidence: `agent/graph.py`)
- Agent execution → Impact analysis: builds impact graph (evidence: `agent/graph.py`)
- Agent execution → Health scoring: scores documentation (evidence: `agent/graph.py`)
- Agent execution → Validation and repair: validates and repairs (evidence: `agent/graph.py`)
- Agent execution → Artifact generation: renders artifacts (evidence: `agent/graph.py`)
- Static API parser → Domain contracts: creates models (evidence: `parsers/openapi_parser.py`)
- Version comparison → Domain contracts: compares models (evidence: `tools/analysis.py`)
- Drift detection → Domain contracts: checks contracts (evidence: `tools/analysis.py`)
- Impact analysis → Domain contracts: analyzes relationships (evidence: `tools/analysis.py`)
- Health scoring → Domain contracts: scores contracts (evidence: `tools/analysis.py`)
- Validation and repair → Version comparison: delegates analysis (evidence: `tools/toolkit.py`)
- Validation and repair → Drift detection: validates drift (evidence: `tools/toolkit.py`)
- Validation and repair → Health scoring: calculates score (evidence: `tools/toolkit.py`)
- Validation and repair → Artifact generation: generates docs (evidence: `tools/toolkit.py`)
- Artifact generation → Domain contracts: renders models (evidence: `generators/artifacts.py`)
- Agent execution → Gemini reasoning: requests explanations (evidence: `agent/graph.py`)
- Intent planner → Standards retrieval: plans retrieval (evidence: `agent/planner.py`)
