A multi-agent voice assistant that helps students learn Math, Physics, and English through natural conversation โ 100% local, privacy-first.
Features โข Demo โข Architecture โข Installation โข Performance
| Feature | Description |
|---|---|
| ๐ค Voice-First | Speak naturally, get audio responses in real-time |
| ๐ง Multi-Agent RAG | Specialized agents for Math, Physics, English with dedicated knowledge bases |
| ๐ Hybrid Search | Vector + BM25 retrieval achieving 80% hit rate |
| โก Streaming Response | Token-by-token text + progressive audio (TTFA ~3s) |
| ๐ 100% Local | All processing on your machine โ no cloud, no API keys |
| ๐ Source Citations | Every answer shows the document chunks it used |
๐ค "What is Ohm's Law?"
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ๐ข PHYSICS โข llama3.2:1b โ
โ โ
โ Ohm's Law states that the voltage U across a conductor โ
โ equals the product of current I and resistance R. โ
โ Formula: U = R ร I โ
โ โ
โ ๐ Sources: Livre troisiรจme 2017.pdf (chunks 42, 43, 45) โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
๐ Audio response plays automatically
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ TUTEUR IA v1.6.0 โ
โ Multi-Agent RAG + Voice โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โ
โ ๐ค INPUT PROCESSING OUTPUT ๐โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ Audio โโโถ [Whisper] โโโถ [Router] โโโถ [Agent] โโโถ [Piper] โโโถ Audioโ
โ (STT) (Classify) (RAG+LLM) (TTS) โ
โ โ โ
โ โโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโ โ
โ โผ โผ โผ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ
โ โ MATH โ โ PHYSICS โ โ ENGLISH โ โ
โ โ โ โ โ โ โ โ
โ โ ChromaDB โ โ ChromaDB โ โ ChromaDB โ โ
โ โ 994 docs โ โ1640 docs โ โ 6 docs โ โ
โ โ โ โ โ โ โ โ
โ โ + BM25 โ โ + BM25 โ โ + BM25 โ โ
โ โ โ โ โ โ โ โ
โ โ qwen2.5 โ โ llama3.2 โ โ gemma โ โ
โ โ :1.5b โ โ :1b โ โ :2b โ โ
โ โโโโโโโโโโโโ โโโโโโโโโโโโ โโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
| Component | Technology | Purpose |
|---|---|---|
| Backend | FastAPI + Uvicorn | WebSocket server, async streaming |
| STT | OpenAI Whisper (base) | Speech-to-text transcription |
| Embeddings | sentence-transformers | paraphrase-multilingual-MiniLM-L12-v2 |
| Vector DB | ChromaDB | Persistent vector storage |
| Keyword Search | rank-bm25 | BM25 for hybrid retrieval |
| LLM | Ollama | Local inference (Qwen, Llama, Gemma) |
| TTS | Piper | Neural text-to-speech (French) |
| Frontend | Vanilla HTML/CSS/JS | ChatGPT-style interface |
| Metric | Baseline | After Optimization | Improvement |
|---|---|---|---|
| Hit Rate | 46.7% | 80.0% | +71% ๐ |
| MRR | 0.413 | 0.717 | +74% ๐ |
| Latency | 25ms | 27ms | +2ms only |
Iteration 1: Baseline vector search โ 46.7%
Iteration 2: Multilingual embeddings โ 53.3%
Iteration 3: Cleaned corrupted PDFs โ 60.0%
Iteration 4: Hybrid Search (BM25 + Vector) โ 80.0% โ
- Python 3.10+
- Ollama installed
- ~8GB RAM recommended
git clone https://github.com/Romainmlt123/Piscine-Intelligence-Lab.git
cd Piscine-Intelligence-Lab
python -m venv venv
source venv/bin/activate
pip install -r requirements.txtollama pull qwen2.5:1.5b # Math agent
ollama pull llama3.2:1b # Physics agent
ollama pull gemma:2b # English agentmkdir -p models/piper
# Download from https://github.com/rhasspy/piper/releases
# Place fr_FR-upmc-medium.onnx in models/piper/./start.shOpen http://localhost:8001 and click the microphone! ๐ค
โโโ src/
โ โโโ main.py # FastAPI WebSocket server
โ โโโ config.py # Centralized configuration
โ โโโ agents/
โ โ โโโ orchestrator.py # Multi-agent routing
โ โ โโโ llm_module.py # Ollama wrapper
โ โโโ rag/
โ โ โโโ rag_module.py # Hybrid RAG (Vector + BM25)
โ โ โโโ rag_benchmark.py # Performance testing
โ โโโ speech/
โ โโโ stt_module.py # Whisper STT
โ โโโ tts_module.py # Piper TTS
โ โโโ vad_module.py # Voice Activity Detection
โโโ static/
โ โโโ index.html # ChatGPT-style frontend
โโโ knowledge_base/
โ โโโ math/ # 994 chunks (6รจme PDFs, Terminale)
โ โโโ physics/ # 1640 chunks (3รจme-Terminale books)
โ โโโ english/ # Grammar basics
โโโ docs/
โ โโโ RAG_EVALUATION.md # Benchmark methodology & results
โ โโโ PRESENTATION_IO.md # I/O architecture diagram
โ โโโ RAPPORT_RECHERCHE.md # Technical research report
โโโ models/
โโโ piper/ # TTS voice models
| Document | Description |
|---|---|
| RAG Evaluation | Benchmark methodology, 4 optimization iterations |
| I/O Presentation | System architecture with diagrams |
| Research Report | Technical deep-dive (French) |
| Model Choices | LLM selection rationale |
- Conversation Memory โ Multi-turn context retention
- Tool Calling โ Calculator for math computations
- Cross-encoder Reranking โ Further improve retrieval
- More Languages โ Spanish, German agents
Romain Mallet
MIT License โ feel free to use and modify!
โญ Star this repo if you find it useful!