# obedientononline/chalksy architecture

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

- Interactive diagram: https://gitdiagram.com/obedientononline/chalksy
- Repository: https://github.com/obedientononline/chalksy

## Overview

Chalksy is an AI classroom-building application: teacher or Omi voice input enters the FastAPI gateway, is privacy-scrubbed, then feeds agent-driven teaching materials and classroom actions. The main loop uses vector memory to ground reasoning and write back student events; generated work can wait for teacher approval before export. The README also documents voice/language tools, grading, analytics, privacy controls, and additional classroom agents. Several of those capabilities are documented but their route-level implementation is not shown in the excerpts, so those links reflect README-described behavior rather than inspected call sites.

Main entry points: [`app/main.py`](https://github.com/obedientononline/chalksy/blob/main/app/main.py) (FastAPI gateway), [`app/agents/crew.py`](https://github.com/obedientononline/chalksy/blob/main/app/agents/crew.py) (Agent orchestrator), [`app/agents/engine.py`](https://github.com/obedientononline/chalksy/blob/main/app/agents/engine.py) (LLM provider engine), [`app/memory/qdrant_store.py`](https://github.com/obedientononline/chalksy/blob/main/app/memory/qdrant_store.py) (Memory operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_capture["Capture and privacy"]
  node_gateway["FastAPI gateway<br/>[main.py]"]
  node_sanitizer["PII sanitizer<br/>[anonymizer.py]"]
  node_privacy["Privacy controls<br/>[anonymizer.py]"]
end

subgraph group_reasoning["Agent workflow"]
  node_orchestrator["Agent orchestrator<br/>[crew.py]"]
  node_planner["Lesson planning<br/>[crew.py]"]
  node_worksheet["Worksheets and quizzes<br/>[crew.py]"]
  node_critic["Critic and guardrails<br/>[crew.py]"]
  node_grading["Grading and assessment<br/>[crew.py]"]
  node_classroom_agents["Classroom support agents<br/>[crew.py]"]
  node_parent_reports["Parent reports<br/>[crew.py]"]
  node_llm_engine["LLM provider engine<br/>[engine.py]"]
  node_settings["Runtime settings<br/>[config.py]"]
end

subgraph group_memory["Classroom memory"]
  node_memory_api["Memory operations<br/>[qdrant_store.py]"]
  node_vector_memory[("Qdrant collections<br/>[qdrant_store.py]")]
  node_consolidation["Memory consolidation<br/>[qdrant_store.py]"]
end

subgraph group_review["Review and delivery"]
  node_task_state[("Task and approval state<br/>[dag_state.py]")]
  node_exporter["Artifact exporter<br/>[exporter.py]"]
  node_dashboard["Teacher dashboard<br/>[dashboard.html]"]
end

subgraph group_insight["Insights and evaluation"]
  node_analytics["Teacher analytics<br/>[crew.py]"]
  node_evals["Evaluation harness<br/>[harness.py]"]
end

node_teacher(("Teacher / Omi"))
node_llm_providers["LLM providers"]

node_teacher -->|"submits voice"| node_gateway
node_gateway -->|"scrubs input"| node_sanitizer
node_gateway -->|"routes requests"| node_orchestrator
node_gateway -->|"searches memory"| node_memory_api
node_gateway -->|"reads approvals"| node_task_state
node_gateway -->|"routes privacy actions"| node_privacy
node_orchestrator -->|"generates plans"| node_planner
node_orchestrator -->|"generates materials"| node_worksheet
node_orchestrator -->|"checks outputs"| node_critic
node_orchestrator -->|"grades work"| node_grading
node_orchestrator -->|"runs support agents"| node_classroom_agents
node_orchestrator -->|"builds reports"| node_parent_reports
node_orchestrator -->|"requests reasoning"| node_llm_engine
node_llm_engine -->|"calls providers"| node_llm_providers
node_orchestrator -->|"retrieves and writes"| node_memory_api
node_orchestrator -->|"updates task status"| node_task_state
node_memory_api -->|"reads and writes"| node_vector_memory
node_consolidation -->|"writes insights"| node_vector_memory
node_gateway -->|"starts consolidation"| node_consolidation
node_gateway -->|"exports artifacts"| node_exporter
node_gateway -.->|"serves interface"| node_dashboard
node_gateway -->|"serves analytics"| node_analytics
node_gateway -->|"runs evaluations"| node_evals
node_llm_engine -->|"reads credentials"| node_settings
node_sanitizer -.->|"supports consent and audit"| node_privacy

click node_gateway "https://github.com/obedientononline/chalksy/blob/main/app/main.py"
click node_sanitizer "https://github.com/obedientononline/chalksy/blob/main/app/privacy/anonymizer.py"
click node_privacy "https://github.com/obedientononline/chalksy/blob/main/app/privacy/anonymizer.py"
click node_orchestrator "https://github.com/obedientononline/chalksy/blob/main/app/agents/crew.py"
click node_planner "https://github.com/obedientononline/chalksy/blob/main/app/agents/crew.py"
click node_worksheet "https://github.com/obedientononline/chalksy/blob/main/app/agents/crew.py"
click node_critic "https://github.com/obedientononline/chalksy/blob/main/app/agents/crew.py"
click node_grading "https://github.com/obedientononline/chalksy/blob/main/app/agents/crew.py"
click node_classroom_agents "https://github.com/obedientononline/chalksy/blob/main/app/agents/crew.py"
click node_parent_reports "https://github.com/obedientononline/chalksy/blob/main/app/agents/crew.py"
click node_llm_engine "https://github.com/obedientononline/chalksy/blob/main/app/agents/engine.py"
click node_memory_api "https://github.com/obedientononline/chalksy/blob/main/app/memory/qdrant_store.py"
click node_vector_memory "https://github.com/obedientononline/chalksy/blob/main/app/memory/qdrant_store.py"
click node_consolidation "https://github.com/obedientononline/chalksy/blob/main/app/memory/qdrant_store.py"
click node_task_state "https://github.com/obedientononline/chalksy/blob/main/app/core/dag_state.py"
click node_exporter "https://github.com/obedientononline/chalksy/blob/main/app/core/exporter.py"
click node_dashboard "https://github.com/obedientononline/chalksy/blob/main/app/templates/dashboard.html"
click node_analytics "https://github.com/obedientononline/chalksy/blob/main/app/agents/crew.py"
click node_evals "https://github.com/obedientononline/chalksy/blob/main/app/evals/harness.py"
click node_settings "https://github.com/obedientononline/chalksy/blob/main/app/core/config.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_gateway,node_sanitizer,node_privacy toneBlue
class node_orchestrator,node_planner,node_worksheet,node_critic,node_grading,node_classroom_agents,node_parent_reports,node_llm_engine,node_settings toneAmber
class node_memory_api,node_vector_memory,node_consolidation toneMint
class node_task_state,node_exporter,node_dashboard toneRose
class node_analytics,node_evals,node_teacher,node_llm_providers toneIndigo
```

## Components

### Capture and privacy

- [FastAPI gateway](https://github.com/obedientononline/chalksy/blob/main/app/main.py): `app/main.py`
- [PII sanitizer](https://github.com/obedientononline/chalksy/blob/main/app/privacy/anonymizer.py): `app/privacy/anonymizer.py`
- [Privacy controls](https://github.com/obedientononline/chalksy/blob/main/app/privacy/anonymizer.py): `app/privacy/anonymizer.py`

### Agent workflow

- [Agent orchestrator](https://github.com/obedientononline/chalksy/blob/main/app/agents/crew.py): `app/agents/crew.py`
- [Lesson planning](https://github.com/obedientononline/chalksy/blob/main/app/agents/crew.py): `app/agents/crew.py`
- [Worksheets and quizzes](https://github.com/obedientononline/chalksy/blob/main/app/agents/crew.py): `app/agents/crew.py`
- [Critic and guardrails](https://github.com/obedientononline/chalksy/blob/main/app/agents/crew.py): `app/agents/crew.py`
- [Grading and assessment](https://github.com/obedientononline/chalksy/blob/main/app/agents/crew.py): `app/agents/crew.py`
- [Classroom support agents](https://github.com/obedientononline/chalksy/blob/main/app/agents/crew.py): `app/agents/crew.py`
- [Parent reports](https://github.com/obedientononline/chalksy/blob/main/app/agents/crew.py): `app/agents/crew.py`
- [LLM provider engine](https://github.com/obedientononline/chalksy/blob/main/app/agents/engine.py): `app/agents/engine.py`
- [Runtime settings](https://github.com/obedientononline/chalksy/blob/main/app/core/config.py): `app/core/config.py`

### Classroom memory

- [Memory operations](https://github.com/obedientononline/chalksy/blob/main/app/memory/qdrant_store.py): `app/memory/qdrant_store.py`
- [Qdrant collections](https://github.com/obedientononline/chalksy/blob/main/app/memory/qdrant_store.py): `app/memory/qdrant_store.py`
- [Memory consolidation](https://github.com/obedientononline/chalksy/blob/main/app/memory/qdrant_store.py): `app/memory/qdrant_store.py`

### Review and delivery

- [Task and approval state](https://github.com/obedientononline/chalksy/blob/main/app/core/dag_state.py): `app/core/dag_state.py`
- [Artifact exporter](https://github.com/obedientononline/chalksy/blob/main/app/core/exporter.py): `app/core/exporter.py`
- [Teacher dashboard](https://github.com/obedientononline/chalksy/blob/main/app/templates/dashboard.html): `app/templates/dashboard.html`

### Insights and evaluation

- [Teacher analytics](https://github.com/obedientononline/chalksy/blob/main/app/agents/crew.py): `app/agents/crew.py`
- [Evaluation harness](https://github.com/obedientononline/chalksy/blob/main/app/evals/harness.py): `app/evals/harness.py`

### Other components

- **Teacher / Omi**
- **LLM providers**

## Connections

- Teacher / Omi → FastAPI gateway: submits voice (evidence: `README.md`)
- FastAPI gateway → PII sanitizer: scrubs input (evidence: `README.md`)
- FastAPI gateway → Agent orchestrator: routes requests (evidence: `app/main.py`)
- FastAPI gateway → Memory operations: searches memory (evidence: `app/main.py`)
- FastAPI gateway → Task and approval state: reads approvals (evidence: `app/main.py`)
- FastAPI gateway → Privacy controls: routes privacy actions (evidence: `README.md`)
- Agent orchestrator → Lesson planning: generates plans (evidence: `README.md`)
- Agent orchestrator → Worksheets and quizzes: generates materials (evidence: `README.md`)
- Agent orchestrator → Critic and guardrails: checks outputs (evidence: `app/agents/crew.py`)
- Agent orchestrator → Grading and assessment: grades work (evidence: `README.md`)
- Agent orchestrator → Classroom support agents: runs support agents (evidence: `README.md`)
- Agent orchestrator → Parent reports: builds reports (evidence: `README.md`)
- Agent orchestrator → LLM provider engine: requests reasoning (evidence: `app/agents/crew.py`)
- LLM provider engine → LLM providers: calls providers (evidence: `app/agents/engine.py`)
- Agent orchestrator → Memory operations: retrieves and writes (evidence: `app/agents/crew.py`)
- Agent orchestrator → Task and approval state: updates task status (evidence: `app/agents/crew.py`)
- Memory operations → Qdrant collections: reads and writes (evidence: `app/memory/qdrant_store.py`)
- Memory consolidation → Qdrant collections: writes insights (evidence: `app/memory/qdrant_store.py`)
- FastAPI gateway → Memory consolidation: starts consolidation (evidence: `app/main.py`)
- FastAPI gateway → Artifact exporter: exports artifacts (evidence: `README.md`)
- FastAPI gateway → Teacher dashboard: serves interface
- FastAPI gateway → Teacher analytics: serves analytics (evidence: `README.md`)
- FastAPI gateway → Evaluation harness: runs evaluations (evidence: `README.md`)
- LLM provider engine → Runtime settings: reads credentials (evidence: `app/agents/engine.py`)
- PII sanitizer → Privacy controls: supports consent and audit (evidence: `app/privacy/anonymizer.py`)
