Your personal knowledge map. Loci transforms any document into a visual, explorable knowledge space with automatic flashcard generation and spaced repetition for long-term retention.
Loci is a learning system that:
- Ingests anything: PDFs, markdown, text files, handwritten notes (photos), audio transcriptions, images
- Extracts knowledge: Automatically identifies concepts and their relationships
- Visualizes spatially: Displays your knowledge as an interactive honeycomb map where related concepts cluster together
- Strengthens memory: Generates flashcards and schedules reviews using spaced repetition (FSRS algorithm)
Navigate your knowledge like a map. Zoom from high-level categories down to individual concepts. Related ideas appear close together thanks to semantic clustering.
Drop in any file type:
- Documents (PDF, Markdown, TXT)
- Handwritten notes (photos processed via LLM vision)
- Images with text or diagrams
- Audio transcriptions
Each concept generates smart flashcards using two formats:
- Cloze deletions (easy/medium): Fill-in-the-blank with context cues
- Q&A (hard): Direct questions for deeper active recall
Reviews are scheduled at the optimal moment—just before you'd forget. The system tracks:
- Stability: How long until memory drops to 90%
- Difficulty: How hard the material is for you
- Retrievability: Current probability of recall
Find any concept instantly. Search queries match semantically, not just by keywords.
Files are parsed and split into meaningful chunks using LangChain text splitters. Images and handwritten notes are processed through LLM vision capabilities.
An LLM analyzes each chunk to extract:
- A clear title
- A concise summary
- The core content
Each concept is converted to a high-dimensional vector (embedding) that captures its semantic meaning. Similar concepts have similar embeddings.
Embeddings are projected from high-dimensional space to 2D coordinates using UMAP, preserving semantic relationships. This creates the spatial layout where similar concepts appear near each other.
Concepts are grouped into clusters using HDBSCAN, a density-based algorithm that finds natural groupings without requiring a predefined number of clusters.
The 2D coordinates are rendered as an interactive honeycomb grid. Each hexagon represents a concept. Opacity reflects learning progress—mastered concepts fade while due reviews stand out.
For each concept, the LLM generates flashcards:
- Cloze deletions provide context cues for easier learning
- Q&A format tests deeper recall for challenging material
The FSRS algorithm schedules reviews based on your performance:
- Again: Reset, review soon
- Hard: Small interval increase
- Good: Normal interval increase
- Easy: Large interval increase, decrease difficulty
- Python 3.11+
- Node.js 18+ with pnpm
- Either:
- OpenAI (recommended):
gpt-4.1-mini+text-embedding-3-small - Ollama (local):
ministral-3:8b+embeddinggemma
- OpenAI (recommended):
# Clone and enter the project
git clone <repo-url>
cd loci
# Run the start script
./start.shThe script will guide you through setup and start both servers.
cd backend
# Install dependencies with uv
uv sync
# Set your OpenAI API key
export OPENAI_API_KEY="sk-..."
# Or for local mode with Ollama:
# 1. Install Ollama: https://ollama.ai
# 2. Pull models: ollama pull ministral-3:8b && ollama pull embeddinggemma
# Start the server
uv run python main.pyBackend runs at http://localhost:4224
cd frontend
# Install dependencies
pnpm install
# Start dev server
pnpm devFrontend runs at http://localhost:3000
| Endpoint | Method | Description |
|---|---|---|
/upload |
POST | Upload and process a file |
/concepts |
GET | List all concepts |
/concepts/{id} |
GET | Get concept details |
/search |
GET | Semantic search |
| Endpoint | Method | Description |
|---|---|---|
/review/due |
GET | Get flashcards due for review |
/review/due/count |
GET | Count of due cards |
/review/submit |
POST | Submit review with rating (1-4) |
/review/grade |
POST | Grade answer using LLM |
/review/stats |
GET | Review statistics |
Backend: FastAPI, LangChain, SQLite + sqlite-vec, UMAP, HDBSCAN
Frontend: Nuxt 4, Vue 3, Honeycomb Grid, D3, Panzoom
AI Models:
- OpenAI:
gpt-4.1-mini(VLM) +text-embedding-3-small(embeddings) - Ollama:
ministral-3:8b(VLM) +embeddinggemma(embeddings)
Algorithm: FSRS (Free Spaced Repetition Scheduler)
MIT




