LogoAIAny
Icon for item

LEANN

LEANN is the world's smallest vector index, enabling RAG on everything from documents to chat histories with 97% storage savings, no accuracy loss, and 100% privacy on personal devices. It uses graph-based selective recomputation and high-degree preserving pruning for lightweight, scalable semantic search.

Introduction

LEANN: A Low-Storage Vector Index for Personal AI

LEANN is an innovative open-source vector database designed to democratize personal AI by transforming everyday laptops into powerful Retrieval-Augmented Generation (RAG) systems. It indexes and searches through millions of documents—spanning file systems, emails, browser histories, chat logs (WeChat, iMessage, ChatGPT, Claude), and even live data from platforms like Slack and Twitter—while using 97% less storage than traditional vector databases like FAISS, without sacrificing search accuracy.1613

Core Innovation

Traditional vector databases store full high-dimensional embeddings for every data chunk, leading to massive storage overhead (e.g., 201GB for 60M Wikipedia chunks). LEANN revolutionizes this with graph-based selective recomputation:

  • Stores a compact, pruned proximity graph instead of embeddings.
  • Recomputes embeddings on-demand only for nodes in the search path.
  • Uses high-degree preserving pruning to retain 'hub' nodes for accuracy.

Backends: HNSW (default, max savings) or DiskANN (superior speed-accuracy).0

Key Benefits
  • 🔒 Privacy-First: Zero telemetry, no cloud—your data stays local.
  • 🪶 Ultra-Lightweight: 60M chunks in 6GB vs. 201GB; emails (780K) in 79MB.
  • 📦 Portable: Transfer indexes across devices effortlessly.
  • 📈 Scalable: Handles messy personal data that crashes other DBs.
  • ✨ Accurate: Matches SOTA quality with dynamic batching and two-level search.
DatasetFAISSLEANNSavings
Wiki (60M)201GB6GB97%
RAG on Everything
  • Documents: PDF/TXT/MD with AST-aware code chunking (Python/Java/etc.).
  • Emails: Apple Mail (780K → 78MB).
  • Browser: Chrome history (38K → 6MB).
  • Chats: WeChat/iMessage/ChatGPT/Claude.
  • Live Data: MCP integration for Slack/Twitter bookmarks.
  • Codebases: Semantic search for Claude Code workflows.

CLI & API: Simple declarative setup; supports Ollama/OpenAI/HF LLMs.15

Installation & Usage
uv pip install leann
leann build my-docs --docs ./docs
leann ask my-docs "Summarize key techniques?"

Advanced: Metadata filtering, grep search, GPU-ready.16

Backed by Research

Implementation of arXiv:2506.08276 from Berkeley Sky Computing Lab. Benchmarks reproducible via uv run benchmarks/run_evaluation.py.13

With 4.9K+ stars, LEANN powers private, portable AI assistants today.

Information

  • Websitegithub.com
  • AuthorsYichuan Wang, Zhifei Li, Berkeley Sky Computing Lab
  • Published date2025/06/30