From 96f74973b1369004a27a22954c8c678b7cffe7c7 Mon Sep 17 00:00:00 2001 From: Andy Lee Date: Sat, 19 Jul 2025 20:42:52 -0700 Subject: [PATCH] docs: how it works earlier --- README.md | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index c88d10b..c82644d 100755 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ LEANN is a revolutionary vector database that makes personal AI accessible to ev 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 and dynamic batching, computing embeddings on-demand instead of storing them all. [Read more →](#️-architecture--how-it-works) ## Why LEANN? @@ -23,7 +24,7 @@ RAG your **[emails](#-search-your-entire-life)**, **[browser history](#-time-mac LEANN vs Traditional Vector DB Storage Comparison

-**The numbers speak for themselves:** Index 60 million Wikipedia articles in just 6GB instead of 201GB. Finally, your MacBook can handle enterprise-scale datasets. [See detailed benchmarks below ↓](#benchmarks) +**The numbers speak for themselves:** Index 60 million Wikipedia articles in just 6GB instead of 201GB. Finally, your MacBook can handle enterprise-scale datasets. [See detailed benchmarks below ↓](#storage-usage-comparison) ## Why This Matters @@ -217,17 +218,22 @@ This demo showcases how to build a RAG system for PDF/md documents using Leann. -## How It Works +## 🏗️ Architecture & How It Works -LEANN doesn't store embeddings. Instead, it builds a lightweight graph and computes embeddings on-demand during search. +

+ LEANN Architecture +

**The magic:** Most vector DBs store every single embedding (expensive). LEANN stores a pruned graph structure (cheap) and recomputes embeddings only when needed (fast). +**Core techniques:** +- **Graph-based selective recomputation:** Only compute embeddings for nodes in the search path +- **High-degree preserving pruning:** Keep important "hub" nodes while removing redundant connections +- **Dynamic batching:** Efficiently batch embedding computations for GPU utilization +- **Two-level search:** Smart graph traversal that prioritizes promising nodes + **Backends:** DiskANN or HNSW - pick what works for your data size. -**Performance:** Real-time search on millions of documents. - - ## Benchmarks Run the comparison yourself: @@ -278,13 +284,6 @@ The evaluation script downloads data automatically on first run. *Benchmarks run on Apple M3 Pro 36 GB* - -## 🏗️ Architecture - -

- LEANN Architecture -

- ## 🔬 Paper If you find Leann useful, please cite: