# xvadel/erudios architecture

> Architecture diagram of the GitHub repository xvadel/erudios, 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/xvadel/erudios
- Repository: https://github.com/xvadel/erudios

## Overview

Erudios is a personalized AI/ML learning platform. A learner explores a topic, follows its prerequisite graph into an ordered curriculum, discovers learning resources, studies generated module content, and receives guidance on what to learn next. The backend also supports accounts, progress and mastery analytics, recommendations, and a topic-aware AI tutor. Its internal layers separate REST routing, domain services, provider integrations, and persistence/cache. The README documents major capabilities; source excerpts verify selected service calls, while several feature routes and integrations are represented from documentation rather than inspected implementation.

Main entry points: [`backend/app/api/v1/router.py`](https://github.com/xvadel/erudios/blob/main/backend/app/api/v1/router.py) (REST API), [`frontend/src/app`](https://github.com/xvadel/erudios/tree/main/frontend/src/app) (Web application), [`backend/app/providers/llms/router.py`](https://github.com/xvadel/erudios/blob/main/backend/app/providers/llms/router.py) (LLM provider router), [`backend/app/modules/curriculum/service.py`](https://github.com/xvadel/erudios/blob/main/backend/app/modules/curriculum/service.py) (Curriculum builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Learner experience"]
  node_webapp["Web application"]
  node_explore["Topic exploration<br/>[ExplorePage.tsx]"]
  node_learning_ui["Learning module UI<br/>[ModuleContent.tsx]"]
  node_chat_ui["Tutor chat UI<br/>[ChatPanel.tsx]"]
end

subgraph group_api["API and identity"]
  node_api_router["REST API<br/>[router.py]"]
  node_auth_api["Authentication<br/>[auth.py]"]
end

subgraph group_learning["Learning domains"]
  node_topic_graph["Topic dependency graph<br/>[service.py]"]
  node_curriculum["Curriculum builder<br/>[service.py]"]
  node_artifacts["Generated module content<br/>[service.py]"]
  node_research["Resource discovery"]
  node_mastery["Mastery and progress"]
  node_recommendations["Next-step recommendations<br/>[service.py]"]
  node_intelligence["Learning analytics<br/>[service.py]"]
end

subgraph group_intelligence["AI and discovery"]
  node_rag["AI tutor service<br/>[service.py]"]
  node_llm_router["LLM provider router<br/>[router.py]"]
  node_budget["Provider budgets<br/>[budget.py]"]
end

subgraph group_platform["Data and providers"]
  node_database[("PostgreSQL<br/>[session.py]")]
  node_cache[("Redis cache<br/>[cache.py]")]
  node_content_cache["Shared content cache<br/>[content_cache.py]"]
  node_vector_store[("Qdrant vector store<br/>[qdrant_store.py]")]
end

node_learner(("Learner"))
node_external_llms{{"LLM providers"}}
node_external_sources{{"Search and research sources"}}

node_learner -->|"uses"| node_webapp
node_webapp -->|"explores"| node_explore
node_webapp -->|"studies"| node_learning_ui
node_webapp -->|"asks tutor"| node_chat_ui
node_webapp -->|"calls API"| node_api_router
node_api_router -->|"routes"| node_auth_api
node_api_router -->|"serves graph queries"| node_topic_graph
node_api_router -->|"serves resource discovery"| node_research
node_api_router -->|"serves curriculum"| node_curriculum
node_api_router -->|"serves content"| node_artifacts
node_api_router -->|"serves chat"| node_rag
node_api_router -->|"serves progress"| node_mastery
node_api_router -->|"serves recommendations"| node_recommendations
node_api_router -->|"serves analytics"| node_intelligence
node_topic_graph -->|"provides ordered topics"| node_curriculum
node_curriculum -->|"reads shared content"| node_content_cache
node_curriculum -->|"generates curriculum"| node_llm_router
node_artifacts -->|"generates stages"| node_llm_router
node_artifacts -->|"reads and writes"| node_cache
node_rag -->|"requests reasoning"| node_llm_router
node_rag -->|"retrieves context"| node_vector_store
node_llm_router -->|"checks usage"| node_budget
node_llm_router -->|"dispatches requests"| node_external_llms
node_budget -->|"tracks budget"| node_cache
node_content_cache -->|"uses hot cache"| node_cache
node_research -->|"discovers resources"| node_external_sources
node_mastery -.->|"stores progress"| node_database
node_recommendations -.->|"reads learning state"| node_database
node_intelligence -->|"uses recommendations"| node_recommendations
node_api_router -.->|"persists domain data"| node_database
node_auth_api -->|"reads user accounts"| node_database

click node_webapp "https://github.com/xvadel/erudios/tree/main/frontend/src/app"
click node_explore "https://github.com/xvadel/erudios/blob/main/frontend/src/app/explore/ExplorePage.tsx"
click node_learning_ui "https://github.com/xvadel/erudios/blob/main/frontend/src/app/learn/%5Bslug%5D/ModuleContent.tsx"
click node_chat_ui "https://github.com/xvadel/erudios/blob/main/frontend/src/components/chat/ChatPanel.tsx"
click node_api_router "https://github.com/xvadel/erudios/blob/main/backend/app/api/v1/router.py"
click node_auth_api "https://github.com/xvadel/erudios/blob/main/backend/app/api/v1/auth.py"
click node_topic_graph "https://github.com/xvadel/erudios/blob/main/backend/app/modules/topic_graph/service.py"
click node_curriculum "https://github.com/xvadel/erudios/blob/main/backend/app/modules/curriculum/service.py"
click node_artifacts "https://github.com/xvadel/erudios/blob/main/backend/app/modules/artifacts/service.py"
click node_research "https://github.com/xvadel/erudios/tree/main/backend/app/modules/research"
click node_mastery "https://github.com/xvadel/erudios/tree/main/backend/app/modules/mastery"
click node_recommendations "https://github.com/xvadel/erudios/blob/main/backend/app/modules/recommendation/service.py"
click node_intelligence "https://github.com/xvadel/erudios/blob/main/backend/app/modules/intelligence/service.py"
click node_rag "https://github.com/xvadel/erudios/blob/main/backend/app/modules/rag/service.py"
click node_llm_router "https://github.com/xvadel/erudios/blob/main/backend/app/providers/llms/router.py"
click node_budget "https://github.com/xvadel/erudios/blob/main/backend/app/providers/llms/budget.py"
click node_database "https://github.com/xvadel/erudios/blob/main/backend/app/db/session.py"
click node_cache "https://github.com/xvadel/erudios/blob/main/backend/app/services/cache.py"
click node_content_cache "https://github.com/xvadel/erudios/blob/main/backend/app/services/content_cache.py"
click node_vector_store "https://github.com/xvadel/erudios/blob/main/backend/app/providers/embeddings/qdrant_store.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_webapp,node_explore,node_learning_ui,node_chat_ui toneBlue
class node_api_router,node_auth_api toneAmber
class node_topic_graph,node_curriculum,node_artifacts,node_research,node_mastery,node_recommendations,node_intelligence toneMint
class node_rag,node_llm_router,node_budget toneRose
class node_database,node_cache,node_content_cache,node_vector_store,node_learner,node_external_llms,node_external_sources toneIndigo
```

## Components

### Learner experience

- [Web application](https://github.com/xvadel/erudios/tree/main/frontend/src/app): `frontend/src/app`
- [Topic exploration](https://github.com/xvadel/erudios/blob/main/frontend/src/app/explore/ExplorePage.tsx): `frontend/src/app/explore/ExplorePage.tsx`
- [Learning module UI](https://github.com/xvadel/erudios/blob/main/frontend/src/app/learn/%5Bslug%5D/ModuleContent.tsx): `frontend/src/app/learn/[slug]/ModuleContent.tsx`
- [Tutor chat UI](https://github.com/xvadel/erudios/blob/main/frontend/src/components/chat/ChatPanel.tsx): `frontend/src/components/chat/ChatPanel.tsx`

### API and identity

- [REST API](https://github.com/xvadel/erudios/blob/main/backend/app/api/v1/router.py): `backend/app/api/v1/router.py`
- [Authentication](https://github.com/xvadel/erudios/blob/main/backend/app/api/v1/auth.py): `backend/app/api/v1/auth.py`

### Learning domains

- [Topic dependency graph](https://github.com/xvadel/erudios/blob/main/backend/app/modules/topic_graph/service.py): `backend/app/modules/topic_graph/service.py`
- [Curriculum builder](https://github.com/xvadel/erudios/blob/main/backend/app/modules/curriculum/service.py): `backend/app/modules/curriculum/service.py`
- [Generated module content](https://github.com/xvadel/erudios/blob/main/backend/app/modules/artifacts/service.py): `backend/app/modules/artifacts/service.py`
- [Resource discovery](https://github.com/xvadel/erudios/tree/main/backend/app/modules/research): `backend/app/modules/research`
- [Mastery and progress](https://github.com/xvadel/erudios/tree/main/backend/app/modules/mastery): `backend/app/modules/mastery`
- [Next-step recommendations](https://github.com/xvadel/erudios/blob/main/backend/app/modules/recommendation/service.py): `backend/app/modules/recommendation/service.py`
- [Learning analytics](https://github.com/xvadel/erudios/blob/main/backend/app/modules/intelligence/service.py): `backend/app/modules/intelligence/service.py`

### AI and discovery

- [AI tutor service](https://github.com/xvadel/erudios/blob/main/backend/app/modules/rag/service.py): `backend/app/modules/rag/service.py`
- [LLM provider router](https://github.com/xvadel/erudios/blob/main/backend/app/providers/llms/router.py): `backend/app/providers/llms/router.py`
- [Provider budgets](https://github.com/xvadel/erudios/blob/main/backend/app/providers/llms/budget.py): `backend/app/providers/llms/budget.py`

### Data and providers

- [PostgreSQL](https://github.com/xvadel/erudios/blob/main/backend/app/db/session.py): `backend/app/db/session.py`
- [Redis cache](https://github.com/xvadel/erudios/blob/main/backend/app/services/cache.py): `backend/app/services/cache.py`
- [Shared content cache](https://github.com/xvadel/erudios/blob/main/backend/app/services/content_cache.py): `backend/app/services/content_cache.py`
- [Qdrant vector store](https://github.com/xvadel/erudios/blob/main/backend/app/providers/embeddings/qdrant_store.py): `backend/app/providers/embeddings/qdrant_store.py`

### Other components

- **Learner**
- **LLM providers**
- **Search and research sources**

## Connections

- Learner → Web application: uses
- Web application → Topic exploration: explores (evidence: `frontend/src/app/explore/page.tsx`)
- Web application → Learning module UI: studies (evidence: `frontend/src/app/learn/[slug]/page.tsx`)
- Web application → Tutor chat UI: asks tutor
- Web application → REST API: calls API
- REST API → Authentication: routes (evidence: `backend/app/api/v1/router.py`)
- REST API → Topic dependency graph: serves graph queries
- REST API → Resource discovery: serves resource discovery
- REST API → Curriculum builder: serves curriculum (evidence: `backend/app/api/v1/router.py`)
- REST API → Generated module content: serves content
- REST API → AI tutor service: serves chat
- REST API → Mastery and progress: serves progress (evidence: `backend/app/api/v1/router.py`)
- REST API → Next-step recommendations: serves recommendations (evidence: `backend/app/api/v1/router.py`)
- REST API → Learning analytics: serves analytics (evidence: `backend/app/api/v1/router.py`)
- Topic dependency graph → Curriculum builder: provides ordered topics (evidence: `backend/app/modules/curriculum/service.py`)
- Curriculum builder → Shared content cache: reads shared content (evidence: `backend/app/modules/curriculum/service.py`)
- Curriculum builder → LLM provider router: generates curriculum (evidence: `backend/app/modules/curriculum/service.py`)
- Generated module content → LLM provider router: generates stages (evidence: `backend/app/modules/artifacts/service.py`)
- Generated module content → Redis cache: reads and writes (evidence: `backend/app/modules/artifacts/service.py`)
- AI tutor service → LLM provider router: requests reasoning (evidence: `backend/app/modules/rag/service.py`)
- AI tutor service → Qdrant vector store: retrieves context (evidence: `backend/app/modules/rag/service.py`)
- LLM provider router → Provider budgets: checks usage (evidence: `backend/app/providers/llms/router.py`)
- LLM provider router → LLM providers: dispatches requests (evidence: `backend/app/providers/llms/router.py`)
- Provider budgets → Redis cache: tracks budget (evidence: `backend/app/providers/llms/budget.py`)
- Shared content cache → Redis cache: uses hot cache (evidence: `backend/app/services/content_cache.py`)
- Resource discovery → Search and research sources: discovers resources
- Mastery and progress → PostgreSQL: stores progress
- Next-step recommendations → PostgreSQL: reads learning state
- Learning analytics → Next-step recommendations: uses recommendations (evidence: `backend/app/modules/intelligence/service.py`)
- REST API → PostgreSQL: persists domain data
- Authentication → PostgreSQL: reads user accounts (evidence: `backend/app/api/v1/auth.py`)
