# onkar4160/multi-agent-doc-ppt-chatbot architecture

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

- Interactive diagram: https://gitdiagram.com/onkar4160/multi-agent-doc-ppt-chatbot
- Repository: https://github.com/onkar4160/multi-agent-doc-ppt-chatbot

## Overview

This is a multi-agent document and presentation chatbot. Users upload templates and knowledge files, request research or generation in chat, then download, edit, convert, compare, or revert versioned DOCX/PPTX artifacts with citations. The graph highlights that workflow and the key supporting stages: template profiling, web/RAG evidence, structured models, rendering, and persistence. Edges are limited to README statements and the sampled source/index references; some internal routing and storage details were not inspected.

Main entry points: [`app/agents/graph.py`](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/agents/graph.py) (Supervisor graph), [`app/api/routes_artifacts.py`](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/api/routes_artifacts.py) (Artifact API), [`app/main.py`](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/main.py) (FastAPI app), [`app/services/ingestion.py`](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/services/ingestion.py) (Knowledge ingestion)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API and UI"]
  node_ui["Streamlit UI<br/>[streamlit_app.py]"]
  node_app["FastAPI app<br/>[main.py]"]
  node_files["File and template API<br/>[files.py]"]
  node_knowledge_api["Knowledge API<br/>[knowledge.py]"]
  node_chat_api["Chat and run API<br/>[chat.py]"]
  node_artifact_api["Artifact API"]
end

subgraph group_agents["Agent workflow"]
  node_supervisor["Supervisor graph<br/>[graph.py]"]
  node_doc_analyzer["DOCX analyzer<br/>[doc_analyzer.py]"]
  node_ppt_analyzer["PPTX analyzer<br/>[ppt_analyzer.py]"]
  node_web_research["Web research<br/>[web_research.py]"]
  node_rag["Knowledge retrieval<br/>[rag_agent.py]"]
  node_doc_generator["DOCX generator<br/>[doc_generator.py]"]
  node_ppt_generator["PPTX generator<br/>[ppt_generator.py]"]
  node_editor["Editor<br/>[editor.py]"]
  node_converter["Converter<br/>[converter.py]"]
  node_validator["Validator<br/>[validator.py]"]
end

subgraph group_content["Content services"]
  node_template_profile["Template profile"]
  node_parsers["File parsing and OCR<br/>[parsers.py]"]
  node_ingestion["Knowledge ingestion<br/>[ingestion.py]"]
  node_embeddings["Embedding service<br/>[embeddings.py]"]
  node_vector_store[("Vector store<br/>[vector_store.py]")]
  node_doc_renderer["DOCX renderer<br/>[docx_renderer.py]"]
  node_ppt_renderer["PPTX renderer<br/>[pptx_renderer.py]"]
  node_llm["Gemini client<br/>[client.py]"]
end

subgraph group_data["Persistence and models"]
  node_artifact_models[("Artifact versions<br/>[artifact.py]")]
  node_trace_models[("Agent traces<br/>[trace.py]")]
  node_database[("SQL database<br/>[database.py]")]
end

node_user(("User"))
node_web_service["Web search provider"]
node_pinecone[("Pinecone")]

node_user -->|"uses"| node_ui
node_ui -->|"calls HTTP"| node_app
node_app -->|"registers routes"| node_files
node_app -->|"registers routes"| node_knowledge_api
node_app -->|"registers routes"| node_chat_api
node_app -->|"registers routes"| node_artifact_api
node_files -->|"dispatches analysis"| node_doc_analyzer
node_files -->|"dispatches analysis"| node_ppt_analyzer
node_doc_analyzer -->|"produces profile"| node_template_profile
node_ppt_analyzer -->|"produces profile"| node_template_profile
node_chat_api -->|"starts run"| node_supervisor
node_supervisor -->|"routes requests"| node_doc_analyzer
node_supervisor -->|"routes requests"| node_ppt_analyzer
node_supervisor -->|"routes requests"| node_web_research
node_supervisor -->|"routes requests"| node_rag
node_supervisor -->|"routes requests"| node_doc_generator
node_supervisor -->|"routes requests"| node_ppt_generator
node_supervisor -->|"routes requests"| node_editor
node_supervisor -->|"routes requests"| node_converter
node_supervisor -->|"routes requests"| node_validator
node_web_research -->|"searches web"| node_web_service
node_rag -->|"embeds query"| node_embeddings
node_rag -->|"queries vectors"| node_vector_store
node_vector_store -->|"uses backend"| node_pinecone
node_knowledge_api -.->|"ingests files"| node_ingestion
node_ingestion -->|"parses files"| node_parsers
node_ingestion -->|"embeds chunks"| node_embeddings
node_ingestion -->|"upserts vectors"| node_vector_store
node_doc_generator -->|"renders model"| node_doc_renderer
node_ppt_generator -->|"renders model"| node_ppt_renderer
node_editor -->|"rerenders edits"| node_doc_renderer
node_supervisor -->|"uses model client"| node_llm
node_web_research -->|"uses model client"| node_llm
node_artifact_api -->|"stores versions"| node_artifact_models
node_artifact_api -->|"dispatches conversion"| node_converter
node_artifact_api -.->|"dispatches edits"| node_editor
node_artifact_api -->|"renders artifacts"| node_doc_renderer
node_artifact_api -->|"renders artifacts"| node_ppt_renderer
node_supervisor -->|"records agent trace"| node_trace_models
node_app -->|"initializes tables"| node_database
node_artifact_api -->|"reads and writes"| node_database

click node_ui "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/ui/streamlit_app.py"
click node_app "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/main.py"
click node_files "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/api/files.py"
click node_knowledge_api "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/api/knowledge.py"
click node_chat_api "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/api/chat.py"
click node_artifact_api "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/api/routes_artifacts.py"
click node_supervisor "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/agents/graph.py"
click node_doc_analyzer "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/agents/doc_analyzer.py"
click node_ppt_analyzer "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/agents/ppt_analyzer.py"
click node_web_research "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/agents/web_research.py"
click node_rag "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/agents/rag_agent.py"
click node_doc_generator "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/agents/doc_generator.py"
click node_ppt_generator "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/agents/ppt_generator.py"
click node_editor "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/agents/editor.py"
click node_converter "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/agents/converter.py"
click node_validator "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/agents/validator.py"
click node_template_profile "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/models/template_profile.py"
click node_parsers "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/services/parsers.py"
click node_ingestion "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/services/ingestion.py"
click node_embeddings "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/services/embeddings.py"
click node_vector_store "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/services/vector_store.py"
click node_doc_renderer "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/services/docx_renderer.py"
click node_ppt_renderer "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/services/pptx_renderer.py"
click node_llm "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/llm/client.py"
click node_artifact_models "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/models/artifact.py"
click node_trace_models "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/models/trace.py"
click node_database "https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/core/database.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_ui,node_app,node_files,node_knowledge_api,node_chat_api,node_artifact_api,node_user toneBlue
class node_supervisor,node_doc_analyzer,node_ppt_analyzer,node_web_research,node_rag,node_doc_generator,node_ppt_generator,node_editor,node_converter,node_validator,node_pinecone toneAmber
class node_template_profile,node_parsers,node_ingestion,node_embeddings,node_vector_store,node_doc_renderer,node_ppt_renderer,node_llm toneMint
class node_artifact_models,node_trace_models,node_database toneRose
class node_web_service toneIndigo
```

## Components

### API and UI

- [Streamlit UI](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/ui/streamlit_app.py): `ui/streamlit_app.py`
- [FastAPI app](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/main.py): `app/main.py`
- [File and template API](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/api/files.py): `app/api/files.py`
- [Knowledge API](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/api/knowledge.py): `app/api/knowledge.py`
- [Chat and run API](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/api/chat.py): `app/api/chat.py`
- [Artifact API](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/api/routes_artifacts.py): `app/api/routes_artifacts.py`

### Agent workflow

- [Supervisor graph](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/agents/graph.py): `app/agents/graph.py`
- [DOCX analyzer](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/agents/doc_analyzer.py): `app/agents/doc_analyzer.py`
- [PPTX analyzer](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/agents/ppt_analyzer.py): `app/agents/ppt_analyzer.py`
- [Web research](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/agents/web_research.py): `app/agents/web_research.py`
- [Knowledge retrieval](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/agents/rag_agent.py): `app/agents/rag_agent.py`
- [DOCX generator](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/agents/doc_generator.py): `app/agents/doc_generator.py`
- [PPTX generator](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/agents/ppt_generator.py): `app/agents/ppt_generator.py`
- [Editor](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/agents/editor.py): `app/agents/editor.py`
- [Converter](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/agents/converter.py): `app/agents/converter.py`
- [Validator](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/agents/validator.py): `app/agents/validator.py`

### Content services

- [Template profile](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/models/template_profile.py): `app/models/template_profile.py`
- [File parsing and OCR](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/services/parsers.py): `app/services/parsers.py`
- [Knowledge ingestion](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/services/ingestion.py): `app/services/ingestion.py`
- [Embedding service](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/services/embeddings.py): `app/services/embeddings.py`
- [Vector store](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/services/vector_store.py): `app/services/vector_store.py`
- [DOCX renderer](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/services/docx_renderer.py): `app/services/docx_renderer.py`
- [PPTX renderer](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/services/pptx_renderer.py): `app/services/pptx_renderer.py`
- [Gemini client](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/llm/client.py): `app/llm/client.py`

### Persistence and models

- [Artifact versions](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/models/artifact.py): `app/models/artifact.py`
- [Agent traces](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/models/trace.py): `app/models/trace.py`
- [SQL database](https://github.com/onkar4160/multi-agent-doc-ppt-chatbot/blob/main/app/core/database.py): `app/core/database.py`

### Other components

- **User**
- **Web search provider**
- **Pinecone**

## Connections

- User → Streamlit UI: uses
- Streamlit UI → FastAPI app: calls HTTP
- FastAPI app → File and template API: registers routes (evidence: `app/main.py`)
- FastAPI app → Knowledge API: registers routes (evidence: `app/main.py`)
- FastAPI app → Chat and run API: registers routes (evidence: `app/main.py`)
- FastAPI app → Artifact API: registers routes (evidence: `app/main.py`)
- File and template API → DOCX analyzer: dispatches analysis (evidence: `app/api/files.py`)
- File and template API → PPTX analyzer: dispatches analysis (evidence: `app/api/files.py`)
- DOCX analyzer → Template profile: produces profile
- PPTX analyzer → Template profile: produces profile
- Chat and run API → Supervisor graph: starts run (evidence: `app/api/chat.py`)
- Supervisor graph → DOCX analyzer: routes requests (evidence: `app/agents/graph.py`)
- Supervisor graph → PPTX analyzer: routes requests (evidence: `app/agents/graph.py`)
- Supervisor graph → Web research: routes requests (evidence: `app/agents/graph.py`)
- Supervisor graph → Knowledge retrieval: routes requests (evidence: `app/agents/graph.py`)
- Supervisor graph → DOCX generator: routes requests (evidence: `app/agents/graph.py`)
- Supervisor graph → PPTX generator: routes requests (evidence: `app/agents/graph.py`)
- Supervisor graph → Editor: routes requests (evidence: `app/agents/graph.py`)
- Supervisor graph → Converter: routes requests (evidence: `app/agents/graph.py`)
- Supervisor graph → Validator: routes requests (evidence: `app/agents/graph.py`)
- Web research → Web search provider: searches web
- Knowledge retrieval → Embedding service: embeds query (evidence: `app/agents/rag_agent.py`)
- Knowledge retrieval → Vector store: queries vectors (evidence: `app/agents/rag_agent.py`)
- Vector store → Pinecone: uses backend
- Knowledge API → Knowledge ingestion: ingests files
- Knowledge ingestion → File parsing and OCR: parses files (evidence: `app/services/ingestion.py`)
- Knowledge ingestion → Embedding service: embeds chunks (evidence: `app/services/ingestion.py`)
- Knowledge ingestion → Vector store: upserts vectors (evidence: `app/services/ingestion.py`)
- DOCX generator → DOCX renderer: renders model
- PPTX generator → PPTX renderer: renders model
- Editor → DOCX renderer: rerenders edits (evidence: `app/agents/editor.py`)
- Supervisor graph → Gemini client: uses model client (evidence: `app/agents/graph.py`)
- Web research → Gemini client: uses model client (evidence: `app/agents/web_research.py`)
- Artifact API → Artifact versions: stores versions
- Artifact API → Converter: dispatches conversion (evidence: `app/api/routes_artifacts.py`)
- Artifact API → Editor: dispatches edits (evidence: `app/api/routes_artifacts.py`)
- Artifact API → DOCX renderer: renders artifacts (evidence: `app/api/routes_artifacts.py`)
- Artifact API → PPTX renderer: renders artifacts (evidence: `app/api/routes_artifacts.py`)
- Supervisor graph → Agent traces: records agent trace (evidence: `app/agents/graph.py`)
- FastAPI app → SQL database: initializes tables (evidence: `app/main.py`)
- Artifact API → SQL database: reads and writes (evidence: `app/api/routes_artifacts.py`)
