LEANN Claims 97% On-Device Vector Storage Reduction via Graph-Based Selective Recomputation
StarTrail-org says its open-source vector database LEANN compresses 60 million text chunks from 201 GB to 6 GB without accuracy loss in its benchmarks, using gr
Open-source vector database LEANN, developed by StarTrail-org, uses graph-based selective recomputation and high-degree preserving pruning to compute embeddings on demand instead of storing them all.

Image source: https://github.com/StarTrail-org/LEANN
According to the development team's benchmarks, LEANN compresses an index of 60 million text chunks from 201 GB down to 6 GB—roughly 97% storage savings—without accuracy loss. The project is designed to run local RAG workloads on personal devices without cloud infrastructure.
Core Architecture: On-Demand Recomputation and Storage Compression
LEANN's developers say graph-based recomputation eliminates heavy embedding storage, while graph pruning and CSR format reduce graph storage overhead.
LEANN drastically reduces resource overhead through the following design principles:
- Selective Recomputation: Instead of storing every embedding, LEANN uses graph-based selective recomputation to compute embeddings on demand.
- High-Degree Preserving Pruning: LEANN combines graph pruning with Compressed Sparse Row (CSR) format to minimize graph storage overhead.
- Local Privacy: All data processing remains strictly local to the user's device, eliminating third-party cloud data exposure.
Claude Code Integration and MCP Support
LEANN provides out-of-the-box Model Context Protocol (MCP) native integration tailored for AI coding workflows.
The project says Claude Code supports basic grep-style keyword search and presents LEANN as a compatible drop-in semantic search MCP service. In the development team's comparison with BM25 across 30 SWE-Bench Pro tasks in ContextBench, agents using LEANN achieved 2.1× initial relevant-code recall (24.2% vs. 11.4%), 12.6 percentage points higher relevant-code coverage after exploration (38.4% vs. 25.8%), and used 8.4% fewer tokens (3.22M vs. 3.51M).
Installation and Quick Start
LEANN supports Python 3.10 through 3.14 and can be installed easily using the uv package manager:
git clone https://github.com/StarTrail-org/LEANN.git leann
cd leann
uv venv
source .venv/bin/activate
uv pip install leann
For source builds, the repository documents optional dependencies for DiskANN, enabled with uv sync --extra diskann; HNSW-only builds can omit the DiskANN extra. LEANN is released under the MIT License.
Caveats
- The 97% storage savings and accuracy figures are based on the authors' benchmarks; verifying recall and latency against your specific dataset and query workload is recommended before full migration.
- James Coyle wrote that index files load using pickle and warned users to open only indexes they built because an untrusted pickle file can execute code.
Sources
- GitHub Repository: StarTrail-org/LEANN
- X Post: 0xMarioNawfal (@RoundtableSpace)