0

LEANN

worthwhile

Novel graph-based recomputation for vector storage achieves 97% reduction vs. traditional DBs — unique for on-device RAG, but requires build-from-source.

Source ↗
LEANN iconLEANN README imageLEANN README imageLEANN README imageLEANN README imageLEANN social preview

What it is

A vector database that uses graph-based selective recomputation and high-degree pruning to store embeddings on-demand rather than persistently, achieving ~97% storage reduction for RAG workloads. Supports HNSW and DiskANN backends, MCP integration, and indexing of files, emails, chat logs, and live data sources.

How it differs from vanilla Claude

Vanilla Claude + a standard vector DB (FAISS, Chroma) stores all embeddings as dense vectors—fixed storage cost proportional to document count. LEANN recomputes embeddings from a pruned graph at query time, eliminating the need to store full vectors and drastically reducing local storage footprint. Claude unaided cannot do this; it relies on external DB.

Skill, plugin, or workflow shift?

Library with Python API and CLI, plus a separate MCP server package for integration with Claude Code and other MCP clients.

Devil's advocate — is this just complexity?

The core value prop—storage savings—is only impressive if you are indexing tens of millions of documents on a laptop. For typical personal use (tens of thousands of docs), a standard vector DB with 512-dim embeddings fits in <2GB, which is negligible on modern hardware. The setup is painful: building DiskANN from source on Linux/macOS requires multiple system libraries (Boost, Protobuf, MKL) and tweaks per distro. The latency of on-demand recomputation may be higher than direct vector search, especially on CPU. A vanilla agent using a cloud-hosted vector service (Pinecone, Supabase) or even a local Chroma instance with `all-MiniLM-L6-v2` will likely be faster to set up and run, albeit with more storage. The 'graph-based selective recomputation' is an academic novelty that solves a problem few actually have. For the majority, this is complexity for complexity's sake.

What would make it better

1) Pure pip install without requiring system compilers or uv—vendor prebuilt wheels. 2) Clearer documentation on when storage savings justify the complexity (e.g., a decision tree based on doc count and device storage). 3) GPU-accelerated recomputation to close the latency gap. 4) A one-command index builder that auto-detects data sources (like Obsidian plugin). 5) Benchmark comparisons against Chroma + sqlite-vss on an equal footing (same hardware, same embedding model) to prove the 97% claim in practice.

The honest case for it

If you have tens of millions of personal documents (email archive, browsing history, chat logs, notes) and want to run a fully private, on-device RAG system without sacrificing accuracy or paying for cloud vector DBs, LEANN's 97% storage reduction makes it feasible on a standard laptop—something traditional vector DBs cannot match. The MCP integration enables drop-in semantic search for Claude Code, upgrading its grep-only code search. For power users with large local knowledge bases, LEANN is a genuinely new capability.

Who it's for

Audience fit

Primarily forAI-first Engineer
AI-first Engineer80

Depth and leverage for a technical engineer who wants to understand it and level up their workflow — not just offload work.

Vibe Coder40

Value for someone who wants a more capable tool without the technical depth — accessible, does-it-for-you.

Deep technical value for engineers building custom local RAG pipelines; setup complexity and lack of turnkey GUI limit appeal for vibe coders.