Doc

An AI teaching assistant that plans its own courses

What it is

Doc started as a local tool for querying my own study material. It is now a teaching assistant: you describe what you want to learn, optionally with your own files and photos of notes, and it plans a course as a map of topics. Each topic gets a lesson, practice tasks, spaced-repetition reviews, and a chat that knows the lesson.

The retrieval layer from the first version is still there. It now feeds course planning, lessons and chats instead of a single chat window.

What runs today

Planning. A course map of up to three levels, grouped into modules for larger courses, built from the request, uploaded files and, when useful, the web. A stronger model plans the map; code checks its structure and a separate review model reads it before it is saved.

Lessons and tasks. Generated on the first visit, so only topics someone opens cost anything. Open answers are graded against hidden grading notes, and graded tasks come back on a 1, 3, 7, 14, 30 day ladder. Lessons and tasks adapt to results in the course, and “Practice this” writes a follow-up task aimed at what an answer missed.

Chats. A lesson chat and a course chat, both able to change the course: add subtopics and tasks, rename and move topics, or propose rebuilding content. Anything that removes or rebuilds content waits for a confirmation click.

Materials and context. PDFs, Office files, text and images (transcribed by a vision model) are indexed in PostgreSQL with pgvector. Older chat messages are summarized, search queries are rewritten from recent messages, and every prompt stays within a token budget.

The stack is FastAPI with SQLAlchemy and Alembic, a React 19 frontend, and Docker Compose, with all models served through OpenRouter. Users log in and bring their own API key. Tests fake every model call and block real requests.

What changed from the first version

The first version was retrieval: chunks from a ChromaDB store prepended to a chat message. The current one is mostly generation, and the work moved with it. Every generated map, lesson and task now passes code checks and a review model before anyone sees it, because a course built on one bad map is bad all the way down.

What I don’t know yet

The open question has moved too. It used to be whether retrieval was good enough; now it is whether the courses are. The review model catches problems it can see in a single lesson or map, but I have no evaluation set that measures a whole course, so right now the evidence is my own use.

Status
In progress
Topics
LLM applications, RAG, adaptive learning
Code