LEANN is a storage-efficient vector index for semantic search and retrieval-augmented generation on personal data. It recomputes embeddings on demand so indexes stay small on a laptop.
Overview
LEANN is a vector index aimed at embedding-based search and retrieval-augmented generation when storage is tight. It recomputes embeddings on the fly instead of storing them all, and compresses proximity graph index structure while keeping search accuracy comparable to conventional vector indices.
The project targets personal knowledge on a single machine: documents, email, browser history, chat logs, agent conversation exports, and live data pulled through MCP servers. Index sizes in the documentation are far smaller than storing full embedding tables for the same text volume, and processing is intended to stay on the device without sending data to cloud APIs by default.
A declarative configuration file drives indexing and question answering. The CLI and examples cover many data sources, and LEANN can act as a semantic search MCP service compatible with Claude Code. Text generation can use local engines such as Ollama or OpenAI-compatible HTTP APIs, with separate options for embedding providers.
Optional paths include multimodal PDF search with ColQwen or ColPali, OCR for scanned PDFs, and integrations with LangChain-style stacks. Compared with traditional vector databases that persist all embeddings, LEANN trades stored vectors for on-demand computation to cut disk use.
Key features
- On-demand embedding recomputation
- Compressed graph vector index
- Declarative RAG configuration API
- Many personal data source connectors
- MCP semantic search for coding agents
- OpenAI-compatible LLM and embedding backends
- Local Ollama inference support
- ColQwen multimodal PDF retrieval
Use cases
- Semantic search over local files
- Private RAG on email and chat history
- Coding agent codebase retrieval
- Indexing browser history for lookup
- Large personal corpora on one laptop