What is LEANN?
LEANN is an open-source vector database for semantic search and retrieval-augmented generation on personal devices. LEANN helps developers build applications that retrieve information from documents, conversations, and code, while also supporting personal knowledge collections. The repository describes a laptop-based approach that reduces the storage normally needed for vector indexes.
LEANN uses graph-based selective recomputation with high-degree preserving pruning, computing embeddings on demand instead of storing them all. The repository reports indexing 60 million text chunks in 6GB rather than 201GB and claims 97% storage savings without accuracy loss. These figures describe the project's reported results, rather than a guarantee for every dataset.
What LEANN can do
LEANN combines vector indexing, semantic retrieval, and chat over indexed content. LEANN supports personal files and communication histories as well as coding-agent retrieval and live information accessed through MCP servers. The documented Python interface separates index construction, searching, and chat into dedicated components, allowing those capabilities to be used within an application.
- LEANN indexes PDF, text, and Markdown documents.
- LEANN searches Apple Mail and Google Search History.
- LEANN supports WeChat, iMessage, ChatGPT, and Claude conversations.
- LEANN provides semantic code retrieval for Claude Code through MCP.
- LEANN accesses live sources such as Slack and Twitter through MCP servers.
- LEANN supports chat over an index with a configured generation model.
How LEANN works
LEANN can be installed from PyPI using uv, with repository cloning recommended to access the examples. The quick-start workflow creates a LeannBuilder, adds text, builds an index, and queries that index through LeannSearcher. LeannChat then uses an LLM configuration to answer questions over indexed content. The repository also provides a demonstration notebook and source-build instructions.
LEANN supports HuggingFace, Ollama, Anthropic, and OpenAI-compatible generation services. OpenAI-compatible LLM and embedding endpoints are configured through environment variables and command-line flags. Listed local inference options include Ollama, LM Studio, vLLM, llama.cpp, SGLang, and LiteLLM. LEANN recommends local inference for full privacy and separately documents optional cloud-provider connections.
Who LEANN is for
LEANN is suited to developers implementing RAG applications and people maintaining searchable personal knowledge collections. LEANN's documented sources cover files, email, conversations, browsing history, and agent memory. Coding-agent users can also connect semantic retrieval to Claude Code without replacing their existing workflow, while developers can use the Python interface for application-specific indexing and retrieval.
- LEANN helps personal-data users search documents and communication histories.
- LEANN helps application developers build indexed search and chat workflows.
- LEANN helps Claude Code users retrieve relevant repository context.
- LEANN supports retrieving agent memory from ChatGPT and Claude conversations.
LEANN pricing and access
LEANN is distributed as an open-source project under the MIT license, with source code on GitHub and a package on PyPI. LEANN documents local operation with zero cloud costs, alongside optional external model providers. The repository provides installation paths for running examples and building from source, rather than a hosted subscription-plan comparison.
LEANN strengths and limitations
LEANN's documented strengths include compact vector indexes, portable knowledge bases, local inference options, and zero telemetry. LEANN also provides multiple data-source examples and model-backend choices. Practical constraints include technical installation requirements and additional dependencies for source builds. Privacy depends on configuration: the repository warns that cloud providers may retain or use submitted data under their own policies.
- LEANN source builds require operating-system-specific libraries and toolchains.
- LEANN's DiskANN backend requires macOS 13.3 or later on macOS.
- LEANN's cloud connections require checking provider privacy and retention policies.
- LEANN's coding-agent benchmark does not establish guaranteed issue resolution.
LEANN FAQ
What is LEANN?
LEANN is an open-source vector database for semantic search and retrieval-augmented generation on personal devices. LEANN uses graph-based selective recomputation and pruning to reduce embedding storage, and supports indexing documents, conversations, browsing history, and code.
Is LEANN free?
LEANN is available as an open-source project under the MIT license through GitHub and PyPI. LEANN documents local operation with zero cloud costs and also supports optional external generation and embedding providers.
Does LEANN keep data private?
LEANN supports local processing and reports zero telemetry, with local inference recommended for full privacy. LEANN also supports cloud providers, so privacy depends on the selected configuration; the repository advises reviewing each cloud provider's privacy and data-retention policies.
Does LEANN work with Claude Code?
LEANN provides a semantic search MCP service compatible with Claude Code. LEANN retrieves code by meaning rather than relying only on basic grep-style keyword search, and the repository reports coding-agent retrieval benchmarks while noting that better context access does not guarantee issue resolution.
How do you install and use LEANN?
LEANN can be installed from PyPI using uv, and the repository includes examples and source-build instructions. LEANN's Python quick start uses LeannBuilder to create an index, LeannSearcher to retrieve matching content, and LeannChat to ask questions with a configured language model.
Which models and providers does LEANN support?
LEANN supports HuggingFace, Ollama, Anthropic, and OpenAI-compatible APIs for generation, plus OpenAI-compatible embedding endpoints. LEANN lists local inference options including LM Studio, vLLM, llama.cpp, SGLang, and LiteLLM, alongside optional cloud providers.
From the community
No reviews yet
Be the first to review this tool. What you write helps the next person choose.




