# itsbk13/agentic-rag architecture

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

- Interactive diagram: https://gitdiagram.com/itsbk13/agentic-rag
- Repository: https://github.com/itsbk13/agentic-rag

## Overview

This is a DSA tutoring application that guides a learner from an explain-first question session through mistake diagnosis, memory updates, learner profiling, and review recommendations. The React interface calls a FastAPI backend, which exposes the tutoring workflow and profile/revision capabilities. The workflow coordinates six agents; SQLite holds users, attempts, and profiles, while Chroma supports knowledge and learning-memory retrieval. The README documents additional evaluation, notes, and sandbox capabilities; their runtime wiring is only partly visible in the sampled source, so those links are omitted or marked unverified.

Main entry points: [`graph/workflow.py`](https://github.com/itsbk13/agentic-rag/blob/master/graph/workflow.py) (Workflow orchestrator), [`frontend/src/App.jsx`](https://github.com/itsbk13/agentic-rag/blob/master/frontend/src/App.jsx) (React app), [`backend/main.py`](https://github.com/itsbk13/agentic-rag/blob/master/backend/main.py) (FastAPI service), [`core/memory_store.py`](https://github.com/itsbk13/agentic-rag/blob/master/core/memory_store.py) (Memory indexing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Learner interface"]
  node_app["React app<br/>[App.jsx]"]
  node_chat["Tutoring chat<br/>[ChatArea.jsx]"]
  node_api["API client<br/>[api.js]"]
  node_sandbox["Code sandbox UI<br/>[CodeSandbox.jsx]"]
  node_notes["Notes upload UI<br/>[NotesDropzone.jsx]"]
  node_profiles["Profile dashboard"]
end

subgraph group_workflow["Tutoring workflow"]
  node_backend["FastAPI service<br/>[main.py]"]
  node_pipeline["Workflow orchestrator<br/>[workflow.py]"]
end

subgraph group_learning["Learning services"]
  node_knowledge["Knowledge retrieval<br/>[knowledge_agent.py]"]
  node_tutor["Explain-first tutor<br/>[tutor_agent.py]"]
  node_diagnosis["Mistake diagnosis<br/>[diagnosis_agent.py]"]
  node_evaluator["Tutor evaluator<br/>[evaluator_agent.py]"]
  node_memory_agent["Episodic memory<br/>[memory_agent.py]"]
  node_learner_model["Learner profiling"]
  node_revision["Revision planning<br/>[revision_agent.py]"]
  node_evaluation["Memory comparison"]
end

subgraph group_storage["Persistence and retrieval"]
  node_memory_service["Relational service<br/>[memory_service.py]"]
  node_sqlite[("SQLite database<br/>[models.py]")]
  node_memory_store["Memory indexing<br/>[memory_store.py]"]
  node_vectors[("Chroma collection<br/>[vector_store.py]")]
  node_embeddings["Embedding service<br/>[embeddings.py]"]
  node_llm["LLM service<br/>[llm.py]"]
end

node_learner(("Learner"))

node_learner -->|"uses"| node_app
node_app -->|"renders"| node_chat
node_app -->|"renders"| node_sandbox
node_app -->|"renders"| node_notes
node_app -->|"renders"| node_profiles
node_chat -->|"requests"| node_api
node_api -->|"HTTP requests"| node_backend
node_backend -->|"invokes workflow"| node_pipeline
node_pipeline -->|"retrieves concepts"| node_knowledge
node_pipeline -->|"generates tutoring"| node_tutor
node_pipeline -->|"diagnoses attempt"| node_diagnosis
node_pipeline -->|"updates memory"| node_memory_agent
node_pipeline -->|"updates profile"| node_learner_model
node_pipeline -->|"plans review"| node_revision
node_pipeline -->|"evaluates answer"| node_evaluator
node_knowledge -->|"searches knowledge"| node_memory_store
node_memory_agent -->|"retrieves episodic"| node_memory_store
node_memory_agent -->|"records attempts"| node_memory_service
node_learner_model -->|"updates profile"| node_memory_service
node_revision -->|"reads profiles"| node_memory_service
node_memory_service -->|"reads and writes"| node_sqlite
node_memory_store -->|"embeds text"| node_embeddings
node_memory_store -->|"indexes and searches"| node_vectors
node_diagnosis -->|"classifies with"| node_llm
node_tutor -->|"generates with"| node_llm
node_revision -->|"explains priorities"| node_llm
node_backend -->|"exposes comparison"| node_evaluation
node_backend -.->|"supports notes ingestion"| node_memory_store
node_api -.->|"submits sandbox code"| node_backend

click node_app "https://github.com/itsbk13/agentic-rag/blob/master/frontend/src/App.jsx"
click node_chat "https://github.com/itsbk13/agentic-rag/blob/master/frontend/src/components/ChatArea.jsx"
click node_api "https://github.com/itsbk13/agentic-rag/blob/master/frontend/src/api.js"
click node_sandbox "https://github.com/itsbk13/agentic-rag/blob/master/frontend/src/components/CodeSandbox.jsx"
click node_notes "https://github.com/itsbk13/agentic-rag/blob/master/frontend/src/components/NotesDropzone.jsx"
click node_profiles "https://github.com/itsbk13/agentic-rag/blob/master/frontend/src/components/ProfileDashboard.jsx"
click node_backend "https://github.com/itsbk13/agentic-rag/blob/master/backend/main.py"
click node_pipeline "https://github.com/itsbk13/agentic-rag/blob/master/graph/workflow.py"
click node_knowledge "https://github.com/itsbk13/agentic-rag/blob/master/agents/knowledge_agent.py"
click node_tutor "https://github.com/itsbk13/agentic-rag/blob/master/agents/tutor_agent.py"
click node_diagnosis "https://github.com/itsbk13/agentic-rag/blob/master/agents/diagnosis_agent.py"
click node_evaluator "https://github.com/itsbk13/agentic-rag/blob/master/agents/evaluator_agent.py"
click node_memory_agent "https://github.com/itsbk13/agentic-rag/blob/master/agents/memory_agent.py"
click node_learner_model "https://github.com/itsbk13/agentic-rag/blob/master/agents/learner_model_agent.py"
click node_revision "https://github.com/itsbk13/agentic-rag/blob/master/agents/revision_agent.py"
click node_memory_service "https://github.com/itsbk13/agentic-rag/blob/master/core/memory_service.py"
click node_sqlite "https://github.com/itsbk13/agentic-rag/blob/master/core/models.py"
click node_memory_store "https://github.com/itsbk13/agentic-rag/blob/master/core/memory_store.py"
click node_vectors "https://github.com/itsbk13/agentic-rag/blob/master/core/vector_store.py"
click node_embeddings "https://github.com/itsbk13/agentic-rag/blob/master/core/embeddings.py"
click node_llm "https://github.com/itsbk13/agentic-rag/blob/master/core/llm.py"
click node_evaluation "https://github.com/itsbk13/agentic-rag/blob/master/evaluate/compare_memory_vs_no_memory.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_app,node_chat,node_api,node_sandbox,node_notes,node_profiles toneBlue
class node_backend,node_pipeline toneAmber
class node_knowledge,node_tutor,node_diagnosis,node_evaluator,node_memory_agent,node_learner_model,node_revision,node_evaluation toneMint
class node_memory_service,node_sqlite,node_memory_store,node_vectors,node_embeddings,node_llm toneRose
class node_learner toneIndigo
```

## Components

### Learner interface

- [React app](https://github.com/itsbk13/agentic-rag/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Tutoring chat](https://github.com/itsbk13/agentic-rag/blob/master/frontend/src/components/ChatArea.jsx): `frontend/src/components/ChatArea.jsx`
- [API client](https://github.com/itsbk13/agentic-rag/blob/master/frontend/src/api.js): `frontend/src/api.js`
- [Code sandbox UI](https://github.com/itsbk13/agentic-rag/blob/master/frontend/src/components/CodeSandbox.jsx): `frontend/src/components/CodeSandbox.jsx`
- [Notes upload UI](https://github.com/itsbk13/agentic-rag/blob/master/frontend/src/components/NotesDropzone.jsx): `frontend/src/components/NotesDropzone.jsx`
- [Profile dashboard](https://github.com/itsbk13/agentic-rag/blob/master/frontend/src/components/ProfileDashboard.jsx): `frontend/src/components/ProfileDashboard.jsx`

### Tutoring workflow

- [FastAPI service](https://github.com/itsbk13/agentic-rag/blob/master/backend/main.py): `backend/main.py`
- [Workflow orchestrator](https://github.com/itsbk13/agentic-rag/blob/master/graph/workflow.py): `graph/workflow.py`

### Learning services

- [Knowledge retrieval](https://github.com/itsbk13/agentic-rag/blob/master/agents/knowledge_agent.py): `agents/knowledge_agent.py`
- [Explain-first tutor](https://github.com/itsbk13/agentic-rag/blob/master/agents/tutor_agent.py): `agents/tutor_agent.py`
- [Mistake diagnosis](https://github.com/itsbk13/agentic-rag/blob/master/agents/diagnosis_agent.py): `agents/diagnosis_agent.py`
- [Tutor evaluator](https://github.com/itsbk13/agentic-rag/blob/master/agents/evaluator_agent.py): `agents/evaluator_agent.py`
- [Episodic memory](https://github.com/itsbk13/agentic-rag/blob/master/agents/memory_agent.py): `agents/memory_agent.py`
- [Learner profiling](https://github.com/itsbk13/agentic-rag/blob/master/agents/learner_model_agent.py): `agents/learner_model_agent.py`
- [Revision planning](https://github.com/itsbk13/agentic-rag/blob/master/agents/revision_agent.py): `agents/revision_agent.py`
- [Memory comparison](https://github.com/itsbk13/agentic-rag/blob/master/evaluate/compare_memory_vs_no_memory.py): `evaluate/compare_memory_vs_no_memory.py`

### Persistence and retrieval

- [Relational service](https://github.com/itsbk13/agentic-rag/blob/master/core/memory_service.py): `core/memory_service.py`
- [SQLite database](https://github.com/itsbk13/agentic-rag/blob/master/core/models.py): `core/models.py`
- [Memory indexing](https://github.com/itsbk13/agentic-rag/blob/master/core/memory_store.py): `core/memory_store.py`
- [Chroma collection](https://github.com/itsbk13/agentic-rag/blob/master/core/vector_store.py): `core/vector_store.py`
- [Embedding service](https://github.com/itsbk13/agentic-rag/blob/master/core/embeddings.py): `core/embeddings.py`
- [LLM service](https://github.com/itsbk13/agentic-rag/blob/master/core/llm.py): `core/llm.py`

### Other components

- **Learner**

## Connections

- Learner → React app: uses
- React app → Tutoring chat: renders (evidence: `frontend/src/App.jsx`)
- React app → Code sandbox UI: renders (evidence: `frontend/src/App.jsx`)
- React app → Notes upload UI: renders (evidence: `frontend/src/App.jsx`)
- React app → Profile dashboard: renders (evidence: `frontend/src/App.jsx`)
- Tutoring chat → API client: requests (evidence: `frontend/src/components/ChatArea.jsx`)
- API client → FastAPI service: HTTP requests (evidence: `frontend/src/api.js`)
- FastAPI service → Workflow orchestrator: invokes workflow (evidence: `backend/main.py`)
- Workflow orchestrator → Knowledge retrieval: retrieves concepts (evidence: `graph/workflow.py`)
- Workflow orchestrator → Explain-first tutor: generates tutoring (evidence: `graph/workflow.py`)
- Workflow orchestrator → Mistake diagnosis: diagnoses attempt (evidence: `graph/workflow.py`)
- Workflow orchestrator → Episodic memory: updates memory (evidence: `graph/workflow.py`)
- Workflow orchestrator → Learner profiling: updates profile (evidence: `graph/workflow.py`)
- Workflow orchestrator → Revision planning: plans review (evidence: `graph/workflow.py`)
- Workflow orchestrator → Tutor evaluator: evaluates answer (evidence: `graph/workflow.py`)
- Knowledge retrieval → Memory indexing: searches knowledge (evidence: `agents/knowledge_agent.py`)
- Episodic memory → Memory indexing: retrieves episodic (evidence: `agents/memory_agent.py`)
- Episodic memory → Relational service: records attempts (evidence: `agents/memory_agent.py`)
- Learner profiling → Relational service: updates profile (evidence: `agents/learner_model_agent.py`)
- Revision planning → Relational service: reads profiles (evidence: `agents/revision_agent.py`)
- Relational service → SQLite database: reads and writes (evidence: `core/memory_service.py`)
- Memory indexing → Embedding service: embeds text (evidence: `core/memory_store.py`)
- Memory indexing → Chroma collection: indexes and searches (evidence: `core/memory_store.py`)
- Mistake diagnosis → LLM service: classifies with (evidence: `agents/diagnosis_agent.py`)
- Explain-first tutor → LLM service: generates with (evidence: `agents/tutor_agent.py`)
- Revision planning → LLM service: explains priorities (evidence: `agents/revision_agent.py`)
- FastAPI service → Memory comparison: exposes comparison (evidence: `backend/main.py`)
- FastAPI service → Memory indexing: supports notes ingestion (evidence: `backend/main.py`)
- API client → FastAPI service: submits sandbox code (evidence: `frontend/src/api.js`)
