How kakakaguya/calculus_ai_tutor works
This repository is a lightweight calculus Q&A tutor: the primary workflow is browser question → local web handler → Ollama answer (or demo fallback) → saved conversation history. It also includes a separate PDF-to-vector-store ingestion script and a standalone streaming model example. The README describes streaming, while the sampled web app uses a non-streaming Ollama request; the ingestion store is not connected to web answering in the inspected code.
Main entry points: web_app.py Question answering · ingest.py PDF extraction · calculus_tutor.db SQLite database · create_database.py Schema setup
Components 17
Web tutoring
- Browser interface
web_app.py - HTTP handler
web_app.py - Question answering
web_app.py - History context
web_app.py - Ollama request
web_app.py - Demo fallback
web_app.py
Knowledge ingestion
- Calculus PDF
- PDF extraction
ingest.py - Text chunks
ingest.py - Ollama embeddings
ingest.py - Chroma index
ingest.py
Models and storage
- QA records
web_app.py - SQLite database
calculus_tutor.db - Schema setup
create_database.py - Ollama Qwen3
- Streaming example
main_rag.py
Other components
- Learner
Connections 17
- Learner → Browser interface: asks
- Browser interface → HTTP handler: sends request
- HTTP handler → Question answering: dispatches
- HTTP handler → History context: loads history
- Question answering → History context: builds context
- Question answering → Ollama request: requests answer
- Ollama request → Ollama Qwen3: HTTP chat
- Question answering → Demo fallback: falls back
- Question answering → QA records: saves Q&A
- History context → QA records: reads history
- QA records → SQLite database: reads and writes
- Schema setup → SQLite database: creates tables
- Calculus PDF → PDF extraction: provides source
- PDF extraction → Text chunks: splits text
- Text chunks → Chroma index: adds documents
- Ollama embeddings → Chroma index: embeds documents
- Streaming example → Ollama Qwen3: streams prompt