Skip to content
drmSaloPublic

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

34 Commits

Folders and files

Repository files navigation

EduPilot

EduPilot is an open-source, local-first study companion. Add a PDF and use a model running in Ollama to create:

  • exam-focused summaries at three detail levels;
  • active-recall flashcards; and
  • multiple-choice practice quizzes with explanations.

There are no accounts, subscriptions, hosted databases, analytics, or cloud AI keys. The browser talks to a small local Django API, study data is stored in local SQLite, and AI requests go to the Ollama URL you configure.

How it works

Browser (React)  →  Local Django API  →  Ollama /api/chat
                           ↓
                    SQLite on disk

Uploaded PDFs are temporarily stored locally while a background job extracts their pages, then removed after successful extraction. Failed uploads remain available for retry and are removed when their study set is deleted. Extracted text and generated material are persisted in api/data/edupilot.sqlite3, which is ignored by Git. Pages that need OCR are read locally with Tesseract; existing text layers are reused. Install Tesseract and its language data for scanned PDFs. Set PDF_OCR_LANGUAGE for other languages (for example deu+eng) and TESSDATA_PREFIX if language data is not discovered automatically.

In Settings → Model memory budget, choose Low memory · 2K for constrained machines or use the default 4K. Options up to 16K are available. EduPilot also checks the selected model's reported context capacity and configured num_ctx, and uses the smaller limit. Models need at least a 2K context; parameter count alone does not determine their context capacity. See Ollama's context configuration and model metadata.

Every text-generation stage reserves space for instructions, structured output, and the answer. Oversized pages and legacy documents are split at Unicode-safe boundaries without dropping source text. Source batches become cached notes; those notes are split again into bounded summary requests. Theme parts are merged locally. Flashcards and quizzes process every summary topic in bounded requests, including later chapters, and duplicate questions are removed. Counts scale with the material instead of being fixed at 15 cards or 10 questions. Smaller budgets mean more requests and may take longer.

Malformed or truncated study answers are retried with smaller excerpts, with a fixed retry limit. Invalid quiz options and answers are rejected. A failed generation leaves the previous study material intact; extracted pages and completed source notes can be reused. Notes are cached by source, model, prompt version, and context budget.

Text-only models can study OCR text without image support. If diagrams or unclear scans could not be analyzed, the summary shows the affected pages so you can check the PDF. Upload the same PDF again with a vision model and at least a 4K budget to retry those visuals. Generation quality still depends on the model and source quality; compare important formulas and facts with your course material.

Requirements

  • Python 3.10+
  • Node.js 20+
  • Ollama with at least one local model

Run locally

Start Ollama and install a model (the model is your choice):

ollama serve
ollama pull gemma3:4b

Set up and run the backend:

cd api
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver

In another terminal, start the frontend:

cd edu-pilot
npm install
npm run dev

Open http://localhost:5173, select Settings, connect to http://localhost:11434, and choose one of the discovered models.

Learning Techniques

The Learning techniques tab in a study set's workspace hosts a growing library of study workflows, each with its own interaction model rather than a shared chat window. Implemented so far:

Technique AI required What makes it different
Active Recall Yes Questions stay hidden until attempted; grading is schema-validated, and a learner can override a questionable grade.
Feynman Technique Yes You write the explanation first; feedback (strengths/gaps/misconceptions) only comes after, followed by a revision round and a mastery check.
Practice Testing Yes MCQ/true-false are scored deterministically by the app; only open-ended answers go through AI grading.
Spaced Repetition Yes (optional) An SM-2-style scheduler (api/api/techniques/scheduler.py) computes due dates — never the model. AI-proposed cards require explicit approval before they enter the deck.
Pomodoro / Focus No Deadline-based timer that survives a backgrounded tab; works fully offline.

The remaining techniques from the product spec are listed in the catalog (GET /api/techniques/) as implemented: false so the discovery UI stays honest about what exists today.

Architecture (see api/api/techniques/):

  • registry.py — one TechniqueDefinition per technique; the single source of truth the catalog UI renders generically. Adding a technique means adding one entry here plus its own session module — never touching the picker or a central switch statement.
  • models.py — one session model per technique. Each keeps its own workflow state as real columns (status, timestamps) and its AI-generated content as a JSON array on that row (matching the existing Project.summary/cards/quiz convention), so generated content and its live attempt state can never drift apart.
  • ai_tasks.py — one schema-validated function per AI task (generate_recall_questions, evaluate_feynman_explanation, …), reusing projects.ai._chat/_generate_piece for the same low-temperature, bounded-retry, JSON-schema-constrained request path the rest of EduPilot already uses. Untrusted content (study material, learner answers) is always delimited and framed as content to analyze, never as instructions.
  • scheduler.py — pure, dependency-free spaced-repetition and Leitner-box math. No I/O, fully unit-tested without Ollama or a database.
  • views.py / urls.py — one Django view module per technique under /api/projects/:id/techniques/<slug>/…, following the existing function-based, manually-serialized style (no DRF serializers/viewsets elsewhere in the app, so none were introduced here).

Deterministic application logic (scoring, scheduling, workflow transitions, persistence) never depends on the model; the model only generates content and qualitative feedback, always through a JSON-schema-validated call with a bounded, split-on-failure retry.

API

All endpoints are deliberately anonymous because this application is designed to bind to localhost.

Method Endpoint Purpose
GET /api/health/ Backend health
GET, PUT /api/settings/ollama/ Read/update local Ollama settings
GET /api/ollama/models/ Discover installed Ollama models
GET, POST /api/projects/ List/create projects
GET, PATCH, DELETE /api/projects/:id/ Manage one project
GET, POST /api/projects/:id/process/ Upload/reuse a PDF, start summarizing, and read progress
POST /api/projects/:id/cards/ Generate flashcards
POST /api/projects/:id/quiz/ Generate a quiz
GET /api/techniques/ List the Learning Technique catalog
… /api/projects/:id/techniques/<slug>/… Per-technique session/deck endpoints — see api/api/techniques/urls.py

The Ollama client uses the native /api/tags, /api/show, and /api/chat endpoints, with streaming disabled and JSON schemas supplied for structured output.

Tests and checks

cd api && python manage.py test
cd edu-pilot && npm run lint && npm run build && npm run test

Security and network use

The default Django allowed hosts and Vite proxy are localhost-only. If you deliberately expose EduPilot on a network, add authentication and appropriate transport security first—the API contains personal study material and intentionally has no account system.

See SECURITY.md for reporting issues and required remediation if an old clone contains previously committed credentials.

Contributing

Contributions are welcome. Read CONTRIBUTING.md, keep new integrations local-first, and avoid introducing mandatory hosted services.

License

MIT — see LICENSE.

About

No description, website, or topics provided.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages