[MLsys2026 Best Paper]: https://arxiv.org/abs/2506.08276. RAG on Everything with LEANN. Enjoy 97% storage savings while running a fast, accurate, and 100% private RAG application on your personal device.
Python aifaissgpt-osslangchainllama-indexllmlocalstorageoffline-firstollamaprivacypythonragretrieval-augmented-generationvector-databasevector-searchvectors
Merge branch 'main' of https://github.com/yichuan-w/LEANN
yichuan520030910320c0d040f9d4fc
diff --cc README.mdindex 47eb52b,4c138b1..ad12d6c--- a/README.md+++ b/README.md@@@ -8,62 -3,43 +3,43 @@@</p><p align="center">- <strong>💾 Extreme Storage Saving • 🔒 100% Private • 📚 RAG Everything • ⚡ Easy & Accurate</strong>- </p>-- <p align="center">- <a href="#-quick-start">Quick Start</a> •- <a href="#-features">Features</a> •- <a href="#-benchmarks">Benchmarks</a> •- <a href="https://arxiv.org/abs/2506.08276" target="_blank">Paper</a>+ <img src="https://img.shields.io/badge/Python-3.9%2B-blue.svg" alt="Python 3.9+">+ <img src="https://img.shields.io/badge/License-MIT-green.svg" alt="MIT License">+ <img src="https://img.shields.io/badge/Platform-Linux%20%7C%20macOS-lightgrey" alt="Platform"></p>- ----- ## 🌟 What is LEANN-RAG?+ <h2 align="center" tabindex="-1" class="heading-element" dir="auto">+ The smallest vector index in the world. RAG Everything with LEANN!+ </h2>- **LEANN-RAG** is a lightweight, locally deployable **Retrieval-Augmented Generation (RAG)** engine designed for personal devices. It combines **compact storage**, **clean usability**, and **privacy-by-design**, making it easy to build personalized retrieval systems over your own data — emails, notes, documents, chats, or anything else.+ LEANN is a revolutionary vector database that makes personal AI accessible to everyone. Transform your laptop into a powerful RAG system that can index and search through millions of documents while using **97% less storage** than traditional solutions **without accuracy loss**.- Unlike traditional vector databases that rely on massive embedding storage, LEANN reduces storage needs dramatically by using **graph-based recomputation** and **pruned HNSW search**, while maintaining responsive and reliable performance — all without sending any data to the cloud.+ RAG your **[emails](#-search-your-entire-life)**, **[browser history](#-time-machine-for-the-web)**, **[WeChat](#-wechat-detective)**, or 60M documents on your laptop, in nearly zero cost. No cloud, no API keys, completely private.- ---+ LEANN achieves this through *graph-based selective recomputation* with *high-degree preserving pruning*, computing embeddings on-demand instead of storing them all. [Read more →](#️-architecture--how-it-works) | [Paper →](https://arxiv.org/abs/2506.08276)- ## 🔥 Key Highlights+ ## Why LEANN?- ### 💾 1. Extreme Storage Efficiency- LEANN reduces storage usage by **up to 97%** compared to conventional vector DBs (e.g., FAISS), by storing only pruned graph structures and computing embeddings at query time.- > For example: 60M chunks can be indexed in just **6GB**, compared to **200GB+** with dense storage.-- ### 🔒 2. Fully Private, Cloud-Free- LEANN runs entirely locally. No cloud services, no API keys, and no risk of leaking sensitive data.- > Converse with your own files **without compromising privacy**.-- ### 🧠 3. RAG Everything- Build truly personalized assistants by querying over **your own** chat logs, email archives, browser history, or agent memory.- > LEANN makes it easy to integrate personal context into RAG workflows.+ <p align="center">+ <img src="assets/effects.png" alt="LEANN vs Traditional Vector DB Storage Comparison" width="70%">+ </p>- ### ⚡ 4. Easy, Accurate, and Fast- LEANN is designed to be **easy to install**, with a **clean API** and minimal setup. It runs efficiently on consumer hardware without sacrificing retrieval accuracy.- > One command to install, one click to run.+ **The numbers speak for themselves:** Index 60 million Wikipedia articles in just 6GB instead of 201GB. From emails to browser history, everything fits on your laptop. [See detailed benchmarks below ↓](#storage-usage-comparison)- ---+ ## Why This Matters- ## 🚀 Why Choose LEANN?+ 🔒 **Privacy:** Your data never leaves your laptop. No OpenAI, no cloud, no "terms of service".- Traditional RAG systems often require trade-offs between storage, privacy, and usability. **LEANN-RAG aims to simplify the stack** with a more practical design:+ 🪶 **Lightweight:** Smart graph pruning means less storage, less memory usage, better performance on your existing hardware.- - ✅ **No embedding storage** — compute on demand, save disk space- - ✅ **Low memory footprint** — lightweight and hardware-friendly- - ✅ **Privacy-first** — 100% local, no network dependency- - ✅ **Simple to use** — developer-friendly API and seamless setup+ 📈 **Scalability:** Organize our messy personal data that would crash traditional vector DBs, with performance that gets better as your data grows more personalized.- > 📄 For more details, see our [academic paper](https://arxiv.org/abs/2506.08276)- ## 🚀 Quick Start+ ✨ **No Accuracy Loss:** Maintain the same search quality as heavyweight solutions while using 97% less storage.- ### Installation+ ## Quick Start in 1 minute```bash-git clone [email protected]:yichuan520030910320/LEANN-RAG.git leann+git clone [email protected]:yichuan-w/LEANN.git leanncd leanngit submodule update --init --recursive```