Gemma CogniVault
Overview
Gemma CogniVault is a 100% local, privacy-first AI study companion. Your documents stay on your hardware. Inference runs via Ollama on localhost. No telemetry, no embeddings sent to third parties, no exceptions. A live Privacy Vault Audit Panel confirms zero external connections at runtime.
It’s also genuinely capable — Gemma 4’s full surface (completion, vision, tools, reasoning) running on your laptop, wrapped in an app that turns your documents into quizzes, multi-lesson workshops, flashcard decks, and visual mindmaps, with a learning-progress dashboard and 25 achievement badges.
What’s inside
| Layer | Technology |
|---|---|
| LLM & Embeddings | Ollama · gemma4:e4b · embeddinggemma |
| Agent Framework | Strands Agents SDK |
| Backend | FastAPI · Python 3.10+ · Pydantic |
| Vector Search | FAISS IndexFlatIP + BM25Okapi · Reciprocal Rank Fusion |
| Document Parsing | pypdf · python-docx · python-pptx · openpyxl · trafilatura |
| OCR | pytesseract · pymupdf · Pillow |
| Audio | faster-whisper |
| Workflow Engine | DBOS + PostgreSQL |
| Frontend | React 19 · TypeScript · Vite · Tailwind v4 · Framer Motion · TanStack Query |
Four sections
| Section | What it’s for |
|---|---|
| 💬 Chat | Ask anything about your documents. Cited answers, scope filter, voice, attachments. |
| 📚 Knowledge Base | Upload, categorise, and manage your documents. SHA-256 change detection on re-upload. |
| 🎓 Study Hub | Four AI-powered study modes: Quiz · Workshop · Flashcards · Mindmaps. |
| 📊 Dashboard | Total study time, current streak, 25 achievement badges, 90-day activity heatmap. |
Highlights
- 🧠 Thinking Mode — collapsible reasoning panel streams Gemma 4’s chain of thought before the answer
- 🔍 Hybrid Retrieval — FAISS dense + BM25 keyword fused with Reciprocal Rank Fusion
- 🖼️ Multimodal — attach images, PDFs, and DOCX inline in chat
- 🛟 Durable workflows — DBOS-checkpointed ingestion; crash-safe and resumable
- 🏆 25 achievement badges — auto-tracked across chat, quizzes, workshops, flashcards, mindmaps
- 🔒 Vault Audit Panel — live “zero external connections” indicator
Writing about it
I’m publishing a series of posts unpacking the engineering decisions behind CogniVault — privacy framing, the retrieval stack, the agent loop, ingestion durability, getting JSON out of a local model, drawing mindmaps without a graph library, the gamification layer, and how the test suite avoids needing any infrastructure to run.
See the blog for the full series.
Try it
git clone https://github.com/ndimoforaretas/local-gemma-rag.git
cd local-gemma-rag
./scripts/setup.sh # one-time
./scripts/start.sh
Then open http://localhost:8000.
