# sahil555/multi_agent_ai_system architecture

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

- Interactive diagram: https://gitdiagram.com/sahil555/multi_agent_ai_system
- Repository: https://github.com/sahil555/multi_agent_ai_system

## Overview

This is a local multi-agent learning accelerator. A learner submits a study goal through the CLI or Streamlit interface; the LangGraph workflow plans a roadmap, pauses for approval, explains topics using study notes, quizzes the learner, and coaches progress so the roadmap can adapt and continue. Supporting branches provide MCP note and session-memory tools, optional A2A quiz and CrewAI study-buddy services, SQLite checkpointing, and Langfuse tracing. The workflow and Streamlit internals were not excerpted; their documented capabilities and indexed references support the high-level links shown.

Main entry points: [`src/graph/workflow.py`](https://github.com/sahil555/multi_agent_ai_system/blob/main/src/graph/workflow.py) (Study workflow), [`main.py`](https://github.com/sahil555/multi_agent_ai_system/blob/main/main.py) (CLI session), [`src/agents/explainer.py`](https://github.com/sahil555/multi_agent_ai_system/blob/main/src/agents/explainer.py) (Topic explainer), [`src/agents/progress_coach.py`](https://github.com/sahil555/multi_agent_ai_system/blob/main/src/agents/progress_coach.py) (Progress coach)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App and orchestration"]
  node_cli["CLI session<br/>[main.py]"]
  node_ui["Streamlit app<br/>[streamlit_app.py]"]
  node_workflow["Study workflow<br/>[workflow.py]"]
end

subgraph group_learning["Learning agents"]
  node_planner["Curriculum planner"]
  node_approval["Human approval<br/>[human_approval.py]"]
  node_explainer["Topic explainer<br/>[explainer.py]"]
  node_quiz["Quiz generator<br/>[quiz_generator.py]"]
  node_coach["Progress coach<br/>[progress_coach.py]"]
end

subgraph group_tools["MCP tools and data"]
  node_filesystem["Notes MCP server"]
  node_notes["Study materials"]
  node_memory[("Memory MCP server<br/>[memory_server.py]")]
end

subgraph group_interop["Agent interoperability"]
  node_quiz_service["Quiz A2A service<br/>[quiz_service.py]"]
  node_a2a_client["A2A client<br/>[a2a_client.py]"]
  node_buddy["CrewAI Study Buddy<br/>[study_buddy.py]"]
end

subgraph group_ops["State and observability"]
  node_state["Session state<br/>[state.py]"]
  node_checkpoint[("SQLite checkpoints<br/>[checkpoints.db]")]
  node_tracing["Langfuse setup<br/>[langfuse_setup.py]"]
end

node_learner(("Learner"))
node_ollama["Ollama inference"]

node_learner -->|"starts session"| node_cli
node_learner -->|"uses interface"| node_ui
node_cli -->|"invokes graph"| node_workflow
node_ui -->|"runs study flow"| node_workflow
node_workflow -->|"plans curriculum"| node_planner
node_workflow -->|"requests approval"| node_approval
node_workflow -->|"explains topic"| node_explainer
node_workflow -->|"runs quiz"| node_quiz
node_workflow -->|"adapts roadmap"| node_coach
node_workflow -->|"updates state"| node_state
node_explainer -->|"uses note tools"| node_filesystem
node_filesystem -->|"reads notes"| node_notes
node_explainer -->|"uses session memory"| node_memory
node_coach -->|"stores progress"| node_memory
node_coach -->|"delegates tasks"| node_a2a_client
node_a2a_client -->|"sends quiz task"| node_quiz_service
node_quiz_service -->|"generates and grades"| node_quiz
node_a2a_client -.->|"requests assistance"| node_buddy
node_workflow -->|"saves sessions"| node_checkpoint
node_cli -->|"configures tracing"| node_tracing
node_workflow -.->|"runs model calls"| node_ollama

click node_cli "https://github.com/sahil555/multi_agent_ai_system/blob/main/main.py"
click node_ui "https://github.com/sahil555/multi_agent_ai_system/blob/main/streamlit_app.py"
click node_workflow "https://github.com/sahil555/multi_agent_ai_system/blob/main/src/graph/workflow.py"
click node_state "https://github.com/sahil555/multi_agent_ai_system/blob/main/src/graph/state.py"
click node_planner "https://github.com/sahil555/multi_agent_ai_system/blob/main/src/agents/curriculum_planner.py"
click node_approval "https://github.com/sahil555/multi_agent_ai_system/blob/main/src/agents/human_approval.py"
click node_explainer "https://github.com/sahil555/multi_agent_ai_system/blob/main/src/agents/explainer.py"
click node_quiz "https://github.com/sahil555/multi_agent_ai_system/blob/main/src/agents/quiz_generator.py"
click node_coach "https://github.com/sahil555/multi_agent_ai_system/blob/main/src/agents/progress_coach.py"
click node_filesystem "https://github.com/sahil555/multi_agent_ai_system/blob/main/src/mcp_servers/filesystem_server.py"
click node_notes "https://github.com/sahil555/multi_agent_ai_system/tree/main/study_materials/sample_notes"
click node_memory "https://github.com/sahil555/multi_agent_ai_system/blob/main/src/mcp_servers/memory_server.py"
click node_quiz_service "https://github.com/sahil555/multi_agent_ai_system/blob/main/src/a2a_services/quiz_service.py"
click node_a2a_client "https://github.com/sahil555/multi_agent_ai_system/blob/main/src/a2a_services/a2a_client.py"
click node_buddy "https://github.com/sahil555/multi_agent_ai_system/blob/main/src/crewai_agent/study_buddy.py"
click node_checkpoint "https://github.com/sahil555/multi_agent_ai_system/blob/main/data/checkpoints.db"
click node_tracing "https://github.com/sahil555/multi_agent_ai_system/blob/main/src/observability/langfuse_setup.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_cli,node_ui,node_workflow toneBlue
class node_planner,node_approval,node_explainer,node_quiz,node_coach toneAmber
class node_filesystem,node_notes,node_memory toneMint
class node_quiz_service,node_a2a_client,node_buddy toneRose
class node_state,node_checkpoint,node_tracing,node_learner,node_ollama toneIndigo
```

## Components

### App and orchestration

- [CLI session](https://github.com/sahil555/multi_agent_ai_system/blob/main/main.py): `main.py`
- [Streamlit app](https://github.com/sahil555/multi_agent_ai_system/blob/main/streamlit_app.py): `streamlit_app.py`
- [Study workflow](https://github.com/sahil555/multi_agent_ai_system/blob/main/src/graph/workflow.py): `src/graph/workflow.py`

### Learning agents

- [Curriculum planner](https://github.com/sahil555/multi_agent_ai_system/blob/main/src/agents/curriculum_planner.py): `src/agents/curriculum_planner.py`
- [Human approval](https://github.com/sahil555/multi_agent_ai_system/blob/main/src/agents/human_approval.py): `src/agents/human_approval.py`
- [Topic explainer](https://github.com/sahil555/multi_agent_ai_system/blob/main/src/agents/explainer.py): `src/agents/explainer.py`
- [Quiz generator](https://github.com/sahil555/multi_agent_ai_system/blob/main/src/agents/quiz_generator.py): `src/agents/quiz_generator.py`
- [Progress coach](https://github.com/sahil555/multi_agent_ai_system/blob/main/src/agents/progress_coach.py): `src/agents/progress_coach.py`

### MCP tools and data

- [Notes MCP server](https://github.com/sahil555/multi_agent_ai_system/blob/main/src/mcp_servers/filesystem_server.py): `src/mcp_servers/filesystem_server.py`
- [Study materials](https://github.com/sahil555/multi_agent_ai_system/tree/main/study_materials/sample_notes): `study_materials/sample_notes`
- [Memory MCP server](https://github.com/sahil555/multi_agent_ai_system/blob/main/src/mcp_servers/memory_server.py): `src/mcp_servers/memory_server.py`

### Agent interoperability

- [Quiz A2A service](https://github.com/sahil555/multi_agent_ai_system/blob/main/src/a2a_services/quiz_service.py): `src/a2a_services/quiz_service.py`
- [A2A client](https://github.com/sahil555/multi_agent_ai_system/blob/main/src/a2a_services/a2a_client.py): `src/a2a_services/a2a_client.py`
- [CrewAI Study Buddy](https://github.com/sahil555/multi_agent_ai_system/blob/main/src/crewai_agent/study_buddy.py): `src/crewai_agent/study_buddy.py`

### State and observability

- [Session state](https://github.com/sahil555/multi_agent_ai_system/blob/main/src/graph/state.py): `src/graph/state.py`
- [SQLite checkpoints](https://github.com/sahil555/multi_agent_ai_system/blob/main/data/checkpoints.db): `data/checkpoints.db`
- [Langfuse setup](https://github.com/sahil555/multi_agent_ai_system/blob/main/src/observability/langfuse_setup.py): `src/observability/langfuse_setup.py`

### Other components

- **Learner**
- **Ollama inference**

## Connections

- Learner → CLI session: starts session (evidence: `README.md`)
- Learner → Streamlit app: uses interface (evidence: `README.md`)
- CLI session → Study workflow: invokes graph (evidence: `main.py`)
- Streamlit app → Study workflow: runs study flow (evidence: `streamlit_app.py`)
- Study workflow → Curriculum planner: plans curriculum (evidence: `README.md`)
- Study workflow → Human approval: requests approval (evidence: `README.md`)
- Study workflow → Topic explainer: explains topic (evidence: `README.md`)
- Study workflow → Quiz generator: runs quiz (evidence: `README.md`)
- Study workflow → Progress coach: adapts roadmap (evidence: `README.md`)
- Study workflow → Session state: updates state (evidence: `README.md`)
- Topic explainer → Notes MCP server: uses note tools (evidence: `src/agents/explainer.py`)
- Notes MCP server → Study materials: reads notes (evidence: `src/mcp_servers/filesystem_server.py`)
- Topic explainer → Memory MCP server: uses session memory (evidence: `src/agents/explainer.py`)
- Progress coach → Memory MCP server: stores progress (evidence: `src/agents/progress_coach.py`)
- Progress coach → A2A client: delegates tasks (evidence: `src/agents/progress_coach.py`)
- A2A client → Quiz A2A service: sends quiz task (evidence: `src/a2a_services/a2a_client.py`)
- Quiz A2A service → Quiz generator: generates and grades (evidence: `src/a2a_services/quiz_service.py`)
- A2A client → CrewAI Study Buddy: requests assistance
- Study workflow → SQLite checkpoints: saves sessions (evidence: `README.md`)
- CLI session → Langfuse setup: configures tracing (evidence: `main.py`)
- Study workflow → Ollama inference: runs model calls
