# sathvik2005/living-doc architecture

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

- Interactive diagram: https://gitdiagram.com/sathvik2005/living-doc
- Repository: https://github.com/sathvik2005/living-doc

## Overview

Living Docs is an AI engineering knowledge platform. Its central workflow is tenant-scoped API requests that trigger repository analysis or engineering questions, then assemble architecture or knowledge results from graph/vector stores and return them to the dashboard. The repository also includes ingestion, swarm coordination, readiness and audit capabilities, documentation generation, and developer tooling. Some of these are represented by directory-level nodes because their source was not excerpted; edges are limited to relationships shown in excerpts or explicitly documented in the README.

Main entry points: [`backend/app/presentation/api_v1/router.py`](https://github.com/sathvik2005/living-doc/blob/main/backend/app/presentation/api_v1/router.py) (API routes), [`backend/app/agents/librarian.py`](https://github.com/sathvik2005/living-doc/blob/main/backend/app/agents/librarian.py) (Librarian agent), [`backend/app/infrastructure/graph/neo4j_client.py`](https://github.com/sathvik2005/living-doc/blob/main/backend/app/infrastructure/graph/neo4j_client.py) (Knowledge graph), [`backend/app/presentation/api_v1/swarm.py`](https://github.com/sathvik2005/living-doc/blob/main/backend/app/presentation/api_v1/swarm.py) (Swarm API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and tenancy"]
  node_api_app["FastAPI app<br/>[main.py]"]
  node_tenant["Tenant context<br/>[tenant.py]"]
  node_api_router["API routes<br/>[router.py]"]
  node_swarm_api["Swarm API<br/>[swarm.py]"]
end

subgraph group_knowledge["Knowledge processing"]
  node_ingestion["Git ingestion<br/>[git_ingestion.py]"]
  node_architecture_agent["Architecture agent<br/>[architecture.py]"]
  node_librarian["Librarian agent<br/>[librarian.py]"]
  node_hybrid_search["Hybrid search<br/>[search_service.py]"]
  node_orchestrator["Workflow orchestration<br/>[orchestrator.py]"]
  node_swarm_registry["Agent registry<br/>[registry.py]"]
  node_meta_agents["Meta-agents<br/>[meta.py]"]
  node_readiness["Readiness evaluation"]
  node_doc_generation["Documentation generation<br/>[doc_generator.py]"]
  node_self_documentation["Self-documentation<br/>[self_doc.py]"]
end

subgraph group_storage["Knowledge stores"]
  node_neo4j[("Knowledge graph<br/>[neo4j_client.py]")]
  node_qdrant[("Vector index<br/>[qdrant_client.py]")]
  node_repository_store[("Repository records<br/>[schemas.py]")]
  node_audit["Audit records<br/>[audit_service.py]"]
end

subgraph group_product["Product experiences"]
  node_web_dashboard["Web dashboard<br/>[page.tsx]"]
  node_architecture_view["Architecture explorer<br/>[page.tsx]"]
  node_librarian_view["Librarian interface<br/>[page.tsx]"]
  node_actions_view["Action review<br/>[page.tsx]"]
  node_readiness_view["Readiness dashboard<br/>[page.tsx]"]
  node_swarm_view["Swarm console<br/>[page.tsx]"]
end

subgraph group_platform["Developer platform"]
  node_developer_view["Developer playground<br/>[page.tsx]"]
  node_plugin_framework["Plugin framework<br/>[framework.py]"]
  node_cli["Living Docs CLI<br/>[livingdocs.py]"]
  node_python_sdk["Python SDK<br/>[client.py]"]
  node_typescript_sdk["TypeScript SDK<br/>[client.ts]"]
end

node_engineer(("Engineer"))

node_engineer -->|"uses"| node_web_dashboard
node_api_app -->|"installs middleware"| node_tenant
node_api_app -->|"mounts routes"| node_api_router
node_api_router -->|"gets tenant"| node_tenant
node_api_router -->|"mounts routes"| node_swarm_api
node_api_router -->|"runs analysis"| node_architecture_agent
node_api_router -->|"runs query"| node_librarian
node_api_router -->|"fetches graph"| node_neo4j
node_swarm_api -->|"uses registry"| node_swarm_registry
node_swarm_api -->|"uses supervisors"| node_meta_agents
node_ingestion -->|"inserts repository"| node_repository_store
node_ingestion -->|"indexes entity"| node_neo4j
node_architecture_agent -->|"writes graph"| node_neo4j
node_librarian -->|"reads graph"| node_neo4j
node_librarian -->|"uses vector search"| node_qdrant
node_hybrid_search -->|"reads graph"| node_neo4j
node_hybrid_search -->|"searches vectors"| node_qdrant
node_orchestrator -->|"invokes"| node_architecture_agent
node_orchestrator -->|"invokes"| node_librarian
node_librarian -.->|"streams response"| node_librarian_view
node_web_dashboard -.->|"opens explorer"| node_architecture_view
node_web_dashboard -.->|"opens readiness"| node_readiness_view
node_developer_view -.->|"documents plugins"| node_plugin_framework

click node_api_app "https://github.com/sathvik2005/living-doc/blob/main/backend/app/main.py"
click node_tenant "https://github.com/sathvik2005/living-doc/blob/main/backend/app/core/tenant.py"
click node_api_router "https://github.com/sathvik2005/living-doc/blob/main/backend/app/presentation/api_v1/router.py"
click node_swarm_api "https://github.com/sathvik2005/living-doc/blob/main/backend/app/presentation/api_v1/swarm.py"
click node_ingestion "https://github.com/sathvik2005/living-doc/blob/main/backend/app/services/git_ingestion.py"
click node_architecture_agent "https://github.com/sathvik2005/living-doc/blob/main/backend/app/agents/architecture.py"
click node_librarian "https://github.com/sathvik2005/living-doc/blob/main/backend/app/agents/librarian.py"
click node_hybrid_search "https://github.com/sathvik2005/living-doc/blob/main/backend/app/services/search_service.py"
click node_orchestrator "https://github.com/sathvik2005/living-doc/blob/main/backend/app/workflows/orchestrator.py"
click node_swarm_registry "https://github.com/sathvik2005/living-doc/blob/main/backend/app/swarm/registry.py"
click node_meta_agents "https://github.com/sathvik2005/living-doc/blob/main/backend/app/swarm/meta.py"
click node_readiness "https://github.com/sathvik2005/living-doc/blob/main/backend/app/services/production_readiness.py"
click node_doc_generation "https://github.com/sathvik2005/living-doc/blob/main/backend/app/services/doc_generator.py"
click node_self_documentation "https://github.com/sathvik2005/living-doc/blob/main/backend/app/services/self_doc.py"
click node_neo4j "https://github.com/sathvik2005/living-doc/blob/main/backend/app/infrastructure/graph/neo4j_client.py"
click node_qdrant "https://github.com/sathvik2005/living-doc/blob/main/backend/app/infrastructure/vector/qdrant_client.py"
click node_repository_store "https://github.com/sathvik2005/living-doc/blob/main/backend/app/infrastructure/database/schemas.py"
click node_audit "https://github.com/sathvik2005/living-doc/blob/main/backend/app/services/audit_service.py"
click node_web_dashboard "https://github.com/sathvik2005/living-doc/blob/main/living-docs/app/(app)/dashboard/page.tsx"
click node_architecture_view "https://github.com/sathvik2005/living-doc/blob/main/living-docs/app/(app)/dashboard/architecture/page.tsx"
click node_librarian_view "https://github.com/sathvik2005/living-doc/blob/main/living-docs/app/(app)/librarian/page.tsx"
click node_actions_view "https://github.com/sathvik2005/living-doc/blob/main/living-docs/app/(app)/actions/page.tsx"
click node_readiness_view "https://github.com/sathvik2005/living-doc/blob/main/living-docs/app/(app)/dashboard/readiness/page.tsx"
click node_swarm_view "https://github.com/sathvik2005/living-doc/blob/main/living-docs/app/(app)/swarm/page.tsx"
click node_developer_view "https://github.com/sathvik2005/living-doc/blob/main/living-docs/app/(app)/developer/page.tsx"
click node_plugin_framework "https://github.com/sathvik2005/living-doc/blob/main/backend/app/plugins/framework.py"
click node_cli "https://github.com/sathvik2005/living-doc/blob/main/cli/livingdocs.py"
click node_python_sdk "https://github.com/sathvik2005/living-doc/blob/main/sdk/python/livingdocs/client.py"
click node_typescript_sdk "https://github.com/sathvik2005/living-doc/blob/main/sdk/typescript/src/client.ts"

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_api_app,node_tenant,node_api_router,node_swarm_api toneBlue
class node_ingestion,node_architecture_agent,node_librarian,node_hybrid_search,node_orchestrator,node_swarm_registry,node_meta_agents,node_readiness,node_doc_generation,node_self_documentation toneAmber
class node_neo4j,node_qdrant,node_repository_store,node_audit toneMint
class node_web_dashboard,node_architecture_view,node_librarian_view,node_actions_view,node_readiness_view,node_swarm_view toneRose
class node_developer_view,node_plugin_framework,node_cli,node_python_sdk,node_typescript_sdk,node_engineer toneIndigo
```

## Components

### API and tenancy

- [FastAPI app](https://github.com/sathvik2005/living-doc/blob/main/backend/app/main.py): `backend/app/main.py`
- [Tenant context](https://github.com/sathvik2005/living-doc/blob/main/backend/app/core/tenant.py): `backend/app/core/tenant.py`
- [API routes](https://github.com/sathvik2005/living-doc/blob/main/backend/app/presentation/api_v1/router.py): `backend/app/presentation/api_v1/router.py`
- [Swarm API](https://github.com/sathvik2005/living-doc/blob/main/backend/app/presentation/api_v1/swarm.py): `backend/app/presentation/api_v1/swarm.py`

### Knowledge processing

- [Git ingestion](https://github.com/sathvik2005/living-doc/blob/main/backend/app/services/git_ingestion.py): `backend/app/services/git_ingestion.py`
- [Architecture agent](https://github.com/sathvik2005/living-doc/blob/main/backend/app/agents/architecture.py): `backend/app/agents/architecture.py`
- [Librarian agent](https://github.com/sathvik2005/living-doc/blob/main/backend/app/agents/librarian.py): `backend/app/agents/librarian.py`
- [Hybrid search](https://github.com/sathvik2005/living-doc/blob/main/backend/app/services/search_service.py): `backend/app/services/search_service.py`
- [Workflow orchestration](https://github.com/sathvik2005/living-doc/blob/main/backend/app/workflows/orchestrator.py): `backend/app/workflows/orchestrator.py`
- [Agent registry](https://github.com/sathvik2005/living-doc/blob/main/backend/app/swarm/registry.py): `backend/app/swarm/registry.py`
- [Meta-agents](https://github.com/sathvik2005/living-doc/blob/main/backend/app/swarm/meta.py): `backend/app/swarm/meta.py`
- [Readiness evaluation](https://github.com/sathvik2005/living-doc/blob/main/backend/app/services/production_readiness.py): `backend/app/services/production_readiness.py`
- [Documentation generation](https://github.com/sathvik2005/living-doc/blob/main/backend/app/services/doc_generator.py): `backend/app/services/doc_generator.py`
- [Self-documentation](https://github.com/sathvik2005/living-doc/blob/main/backend/app/services/self_doc.py): `backend/app/services/self_doc.py`

### Knowledge stores

- [Knowledge graph](https://github.com/sathvik2005/living-doc/blob/main/backend/app/infrastructure/graph/neo4j_client.py): `backend/app/infrastructure/graph/neo4j_client.py`
- [Vector index](https://github.com/sathvik2005/living-doc/blob/main/backend/app/infrastructure/vector/qdrant_client.py): `backend/app/infrastructure/vector/qdrant_client.py`
- [Repository records](https://github.com/sathvik2005/living-doc/blob/main/backend/app/infrastructure/database/schemas.py): `backend/app/infrastructure/database/schemas.py`
- [Audit records](https://github.com/sathvik2005/living-doc/blob/main/backend/app/services/audit_service.py): `backend/app/services/audit_service.py`

### Product experiences

- [Web dashboard](https://github.com/sathvik2005/living-doc/blob/main/living-docs/app/(app)/dashboard/page.tsx): `living-docs/app/(app)/dashboard/page.tsx`
- [Architecture explorer](https://github.com/sathvik2005/living-doc/blob/main/living-docs/app/(app)/dashboard/architecture/page.tsx): `living-docs/app/(app)/dashboard/architecture/page.tsx`
- [Librarian interface](https://github.com/sathvik2005/living-doc/blob/main/living-docs/app/(app)/librarian/page.tsx): `living-docs/app/(app)/librarian/page.tsx`
- [Action review](https://github.com/sathvik2005/living-doc/blob/main/living-docs/app/(app)/actions/page.tsx): `living-docs/app/(app)/actions/page.tsx`
- [Readiness dashboard](https://github.com/sathvik2005/living-doc/blob/main/living-docs/app/(app)/dashboard/readiness/page.tsx): `living-docs/app/(app)/dashboard/readiness/page.tsx`
- [Swarm console](https://github.com/sathvik2005/living-doc/blob/main/living-docs/app/(app)/swarm/page.tsx): `living-docs/app/(app)/swarm/page.tsx`

### Developer platform

- [Developer playground](https://github.com/sathvik2005/living-doc/blob/main/living-docs/app/(app)/developer/page.tsx): `living-docs/app/(app)/developer/page.tsx`
- [Plugin framework](https://github.com/sathvik2005/living-doc/blob/main/backend/app/plugins/framework.py): `backend/app/plugins/framework.py`
- [Living Docs CLI](https://github.com/sathvik2005/living-doc/blob/main/cli/livingdocs.py): `cli/livingdocs.py`
- [Python SDK](https://github.com/sathvik2005/living-doc/blob/main/sdk/python/livingdocs/client.py): `sdk/python/livingdocs/client.py`
- [TypeScript SDK](https://github.com/sathvik2005/living-doc/blob/main/sdk/typescript/src/client.ts): `sdk/typescript/src/client.ts`

### Other components

- **Engineer**

## Connections

- Engineer → Web dashboard: uses (evidence: `README.md`)
- FastAPI app → Tenant context: installs middleware (evidence: `backend/app/main.py`)
- FastAPI app → API routes: mounts routes (evidence: `backend/app/main.py`)
- API routes → Tenant context: gets tenant (evidence: `backend/app/presentation/api_v1/router.py`)
- API routes → Swarm API: mounts routes (evidence: `backend/app/presentation/api_v1/router.py`)
- API routes → Architecture agent: runs analysis (evidence: `backend/app/presentation/api_v1/router.py`)
- API routes → Librarian agent: runs query (evidence: `backend/app/presentation/api_v1/router.py`)
- API routes → Knowledge graph: fetches graph (evidence: `backend/app/presentation/api_v1/router.py`)
- Swarm API → Agent registry: uses registry (evidence: `backend/app/presentation/api_v1/swarm.py`)
- Swarm API → Meta-agents: uses supervisors (evidence: `backend/app/presentation/api_v1/swarm.py`)
- Git ingestion → Repository records: inserts repository (evidence: `backend/app/services/git_ingestion.py`)
- Git ingestion → Knowledge graph: indexes entity (evidence: `backend/app/services/git_ingestion.py`)
- Architecture agent → Knowledge graph: writes graph (evidence: `backend/app/agents/architecture.py`)
- Librarian agent → Knowledge graph: reads graph (evidence: `backend/app/agents/librarian.py`)
- Librarian agent → Vector index: uses vector search (evidence: `backend/app/agents/librarian.py`)
- Hybrid search → Knowledge graph: reads graph (evidence: `backend/app/services/search_service.py`)
- Hybrid search → Vector index: searches vectors (evidence: `backend/app/services/search_service.py`)
- Workflow orchestration → Architecture agent: invokes (evidence: `backend/app/workflows/orchestrator.py`)
- Workflow orchestration → Librarian agent: invokes (evidence: `backend/app/workflows/orchestrator.py`)
- Librarian agent → Librarian interface: streams response (evidence: `README.md`)
- Web dashboard → Architecture explorer: opens explorer
- Web dashboard → Readiness dashboard: opens readiness
- Developer playground → Plugin framework: documents plugins (evidence: `README.md`)
