# LEANN review

> LEANN is a Python vector database and RAG library that recomputes embeddings on demand to keep indexes small on personal devices.

Devtoolwatch Board, the week of Oct 25–31, 2026. Canonical page: https://index.devtoolwatch.com/tools/startrail-org-leann/

## TL;DR

LEANN is an open-source vector index and RAG toolkit for running private semantic search on a laptop. It is for developers who want local retrieval over documents, chat histories, or codebases. Instead of storing all embeddings, LEANN recomputes them on demand with graph-based selective recomputation and pruning, which keeps index storage low.

## LEANN at a glance

- **Category:** [RAG, data and memory](https://index.devtoolwatch.com/categories/rag-data-and-memory/)
- **Maintained by:** StarTrail (organization, [@StarTrail-org](https://github.com/StarTrail-org) on GitHub)
- **License:** MIT
- **Language:** Python, Shell, CMake
- **Repository:** [github.com/StarTrail-org/LEANN](https://github.com/StarTrail-org/LEANN)
- **Website:** [arxiv.org/abs/2506.08276](https://arxiv.org/abs/2506.08276)
- **Latest release:** [v0.3.8](https://github.com/StarTrail-org/LEANN/releases/tag/v0.3.8) on GitHub, Sep 28, 2026
- **First published:** Jun 9, 2025

## What LEANN does

- LEANN builds a vector index and recomputes embeddings on the fly instead of storing them, which reduces index storage.
- LEANN indexes documents in .pdf, .txt and .md formats, plus Apple Mail, Google Search History, WeChat, iMessage, ChatGPT and Claude conversations.
- LEANN pulls live data from platforms such as Slack and Twitter through MCP (Model Context Protocol) servers.
- LEANN runs as a semantic search MCP service for Claude Code, adding semantic retrieval beyond grep-style keyword search.
- LEANN offers a Python API with LeannBuilder, LeannSearcher and LeannChat to build indexes, search them and chat with your data.
- LEANN connects to HuggingFace, Ollama, Anthropic and any OpenAI-compatible API for generation and embeddings.
- LEANN supports HNSW and DiskANN backends for the index.

### How it works

LEANN installs as a Python package and runs on your own machine. You build an index from your data with the Python API or the leann CLI, then search it or chat with it. Embeddings are computed on demand from a pruned proximity graph. Generation and embedding models come from local engines such as Ollama, LM Studio or vLLM, or from OpenAI-compatible cloud APIs.

## How to install LEANN

**Install uv (prerequisite)**

```
curl -LsSf https://astral.sh/uv/install.sh | sh
```

**With uv from PyPI**

```
uv pip install leann
```

**Clone the repository**

```
git clone https://github.com/StarTrail-org/LEANN.git leann
```

### Requirements

- Python with the uv package manager installed.
- An OpenAI API key in OPENAI_API_KEY when using the default OpenAI LLM. Local engines such as Ollama avoid this.
- DiskANN builds on macOS require macOS 13.3 or later.
- Windows source builds require Visual Studio 2022 Build Tools with the C++ desktop development workload, plus vcpkg.

### First steps

1. Create and activate a virtual environment with uv venv and source .venv/bin/activate, then install leann.
2. Build an index in Python with LeannBuilder(backend_name="hnsw"), add text, and call build_index with an index path.
3. Search the index with LeannSearcher and its search method, passing a query and top_k.
4. Chat with your data using LeannChat with an llm_config, such as a HuggingFace model, then call ask.

## Who LEANN is for

- Developers who want private, local RAG over personal data such as files, email and chat histories.
- Claude Code users who want semantic code search through an MCP service.
- Projects that need vector search on devices with limited storage.

### Limitations

- LEANN recomputes embeddings at query time instead of storing them, trading compute for storage.
- Building LEANN from source requires many system libraries, and Ubuntu 20.04 may need a newer Abseil and a pinned Protobuf.
- On Linux, uv's default hardlink installs can make leann build fail. Reinstalling with UV_LINK_MODE=copy fixes this.
- LEANN's data stays private only with local models. Cloud LLM or embedding providers receive your data under their own terms.

## Usage data (the week of Oct 25–31, 2026)

- Board rank: #30 overall, #3 in RAG, data and memory, momentum score 84
- New GitHub stars per week (last 12 weeks): Aug 9: 10; Aug 16: 45; Aug 23: 22; Aug 30: 53; Sep 6: 49; Sep 13: 13; Sep 20: 30; Sep 27: 50; Oct 4: 16; Oct 11: 20; Oct 18: 78; Oct 25: 644

## LEANN alternatives

| Rank | Tool | Stars | Downloads/wk |
|---|---|---|---|
| #1 | [XERJ](https://index.devtoolwatch.com/tools/xerj-org-xerj/) | 17.9k | – |
| #2 | [Memvid](https://index.devtoolwatch.com/tools/memvid-memvid/) | 17.3k | – |
| #4 | [Graphify](https://index.devtoolwatch.com/tools/graphify-labs-graphify/) | 140k | 480.7k |
| #5 | [MarkItDown](https://index.devtoolwatch.com/tools/markitdown/) | 193.2k | 4.7M |
| #6 | [Firecrawl](https://index.devtoolwatch.com/tools/firecrawl/) | 197.4k | 2.9M |
| #7 | [Mem0](https://index.devtoolwatch.com/tools/mem0/) | 68.2k | 884.1k |

## LEANN FAQ

### Is LEANN free and open source?

Yes. LEANN's source code is on GitHub (StarTrail-org/LEANN) under the MIT license, so you can use it for free.

### How do I install LEANN?

Run `curl -LsSf https://astral.sh/uv/install.sh | sh`. The install section above has the other options from the project's README.

### Is LEANN still maintained?

Yes. The StarTrail-org/LEANN repository was last updated on Oct 30, 2026, and the latest release, v0.3.8 on GitHub, came out on Sep 28, 2026.

### How popular is LEANN?

LEANN has 13.7k GitHub stars as of Nov 1, 2026. It gained 644 new stars in the week of Oct 25–31, 2026, against a 12-week average of 86 a week. That made it #3 among RAG, data and memory tools on the Devtoolwatch Board.

### What are the best alternatives to LEANN?

Other RAG, data and memory tools on the Devtoolwatch Board in the week of Oct 25–31, 2026, by momentum: XERJ (#1), Memvid (#2), Graphify (#4), MarkItDown (#5), Firecrawl (#6). The alternatives table above has their numbers.

### How does LEANN reduce storage?

LEANN uses graph-based selective recomputation with high-degree preserving pruning. LEANN computes embeddings on demand instead of storing them all, and it compresses proximity graph indices using CSR format.

### Can LEANN run fully offline and private?

Yes, if you pair LEANN with a local inference engine. The README recommends Ollama or other local engines such as LM Studio, vLLM or llama.cpp for full privacy. The project also states it tracks zero telemetry.

### Does LEANN work with Claude Code?

Yes. LEANN provides a semantic search MCP service that works with Claude Code. It adds semantic retrieval on top of Claude Code's grep-style keyword search, without changing your workflow.

### Can I use a different provider for embeddings than for the LLM?

Yes. With the leann build command, set --embedding-mode openai and pass --embedding-api-base and --embedding-api-key to use a separate embedding provider, such as Jina AI.

### Is there a research paper behind LEANN?

Yes. The paper is "LEANN: A Low-Storage Vector Index" on arXiv (2506.08276). The repository describes it as an MLsys2026 Best Paper.

## Sources

1. [StarTrail-org/LEANN on GitHub](https://github.com/StarTrail-org/LEANN)
2. [LEANN README](https://github.com/StarTrail-org/LEANN/blob/main/README.md)
3. [LEANN website](https://arxiv.org/abs/2506.08276)
4. [Release v0.3.8 (Sep 28, 2026)](https://github.com/StarTrail-org/LEANN/releases/tag/v0.3.8)
5. [Release v0.3.7 (Mar 8, 2026)](https://github.com/StarTrail-org/LEANN/releases/tag/v0.3.7)
6. [Release v0.3.6 (Jan 11, 2026)](https://github.com/StarTrail-org/LEANN/releases/tag/v0.3.6)
7. [Hacker News: Successful room temperature ambient-pressure magnetic levitation of LK-99](https://news.ycombinator.com/item?id=36994214)
8. [Hacker News: The first room-temperature ambient-pressure superconductor?](https://news.ycombinator.com/item?id=36864624)
9. [Hacker News: DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via RL](https://news.ycombinator.com/item?id=42823568)
10. [Devtoolwatch Board, the week of Oct 25–31, 2026](https://index.devtoolwatch.com/)
