Meet LEANN: An Open-Source Vector Index that Shrinks a 60M-Chunk RAG Index from 201 GB to 6 GB

2026年10月27日 21:54
站內 AI 整理稿

UC Berkeley’s Sky Computing Lab built LEANN, an open-source vector index that stores almost no embeddings.The LEANN vector index recomputes embeddings at query time instead of saving them to disk.The repo benchmark shows a 60 million chunk Wikipedia index dropping from 201 GB to 6 GB.

The research paper won the Best Research Paper award at MLSys 2026.So, it brings semantic search and RAG over personal data, on a laptop.TL;DR Size: 6 GB for 60M chunks (repo); 4 GB in the paper’s 76 GB Wikipedia setup.Default embedder: Contriever (110M params).

It is an index, not an LLM, so no context length applies.Runs on: laptops and workstations.The paper tested an RTX 4090 box with 32 GB RAM and an M1 Ultra Mac.A CPU-only Linux install exists, with no published CPU latency.

Performance: matches HNSW downstream accuracy at 90% recall, using under 5% of raw-data storage.Best: 25.5% NQ accuracy, identical to HNSW, using 4 GB instead of 188 GB.Worst: HotpotQA retrieval takes 44.80 s on the Mac, 50.1% of total pipeline time.What is LEANN?

LEANN is a low-storage approximate nearest neighbor (ANN) index built on top of FAISS.It targets one problem: vector indexes are often bigger than the data they index.The research paper shows a 76 GB corpus needs 173 GB of embeddings plus a 15 GB HNSW graph.That more than doubles the raw data.

LEANN keeps a pruned graph, drops the full vectors, and rebuilds them on demand.The code is MIT licensed and installs with uv pip install leann.How does LEANN recompute embeddings without stalling search?Graph indexes like HNSW visit only a small set of nodes per query.LEANN exploits that.

It stores the graph plus a compact product quantization (PQ) table.At query time, it re-embeds only nodes on the search path.3 techniques keep this practical: Two-level search: cheap PQ distances rank neighbors first.Only top candidates get exact recomputation.

Dynamic batching: candidates from several hops are grouped, for example 64 at once, for GPU efficiency.High-degree preserving pruning: most nodes keep few edges, while the top 2% “hub” nodes keep more.In ablations, two-level search gives an average 1.4x speedup.Adding batching raises it to 1.8x.

Embedding recomputation still accounts for about 76% of query latency.(function(){var f=document.getElementById('mtp-leann-frame');window.addEventListener('message',function(e){if(e.source===f.contentWindow&&e.data&&e.data.mtpLeannH){f.style.height=e.data.

mtpLeannH+'px';}});})(); How does LEANN perform on benchmarks?The research team tested NQ, TriviaQA, GPQA and HotpotQA against a 60M-passage RPJ-Wiki datastore.Latency is measured at 90% [email protected] figures below are self-reported in the research paper.

On NQ, with Qwen3-4B on an RTX 4090, LEANN and HNSW both reach 25.5% downstream accuracy.LEANN uses 4 GB of storage.HNSW uses 188 GB.BM25 scores 18.3%, and PQ compression scores 17.9%.The cost is search time.LEANN retrieval takes 2.48 s on NQ, versus 0.05 s for HNSW.

Generation takes about 20 s, so end-to-end latency rises from 20.95 s to 23.34 s.Across datasets on the RTX 4090, LEANN retrieval ranges from 1.12 s (GPQA) to 7.12 s (HotpotQA).The IVF-based recomputation baseline, inspired by EdgeRAG, is up to 200x slower.LEANN improves exact match by up to 11.

8% over BM25.The GitHub repo reports similar savings on personal data.400K chat messages shrink from 1.8 GB to 64 MB.38K browser entries shrink from 130 MB to 6.4 MB.

LEANN vs other vector indexes FeatureLEANNHNSW (FAISS)DiskANNIVF-Recompute (EdgeRAG-style)PQ compressionApproachPruned graph, recompute on demandGraph plus all vectors in RAMGraph and vectors on SSD, PQ in RAMIVF clusters, recompute on demandCompressed vectors plus graphStorage, 76 GB corpus4 GB188 GB270 GBBelow 5% of raw data20 GBNQ retrieval at 90% recall (RTX 4090)2.

48 s0.05 s0.03 s307.61 sFails to reach 90%HotpotQA retrieval at 90% recall (RTX 4090)7.12 s0.05 s0.11 s429.46 sFails to reach 90%NQ downstream accuracy (Qwen3-4B)25.5%25.5%Not disclosedNot disclosed17.

9%Fits 32 GB RAM workstationYesNo (OOM)YesYesYesLicenseMITMITMITNot disclosedVaries by implementation Storage, latency and accuracy figures come from the LEANN paper v2, Tables 1 and 2 and Section 7.2 (self-reported).License and design rows link to each project’s own source.

Where can developers use LEANN?The repo ships ready apps for documents, Apple Mail, Chrome history, WeChat, iMessage, and ChatGPT or Claude exports.MCP readers pull live data from Slack and Twitter bookmarks.LEANN also runs as a semantic search MCP server for Claude Code.

On 30 SWE-Bench Pro tasks from ContextBench, the team reports 24.2% initial relevant-code recall versus 11.4% for BM25.The agent also used 8.4% fewer tokens.HNSW is the default backend, with DiskANN for faster search.

Generation works with Ollama, Hugging Face, Anthropic, or any OpenAI-compatible API.It supports Ubuntu, Arch, WSL, macOS and Windows.Some apps, like Apple Mail search, are macOS only.Key Takeaways LEANN stores a pruned graph and recomputes embeddings at query time.

60M chunks: 201 GB down to 6 GB in the repo benchmark.Matches HNSW accuracy (25.5% on NQ) at 90% recall.Search costs seconds: 2.48 s vs 0.05 s for HNSW on NQ.MIT licensed and an MLSys 2026 Best Research Paper.Check out the Paper, GitHub Repo and PyPI package.

Also, feel free to follow us on Twitter and don’t forget to join our 150k+ML SubReddit and Subscribe to our Newsletter.Wait!are you on telegram?now you can join us on telegram as well.Need to partner with us for promoting your GitHub Repo OR Hugging Face Page OR Product Release OR Webinar etc.?

Connect with us The post Meet LEANN: An Open-Source Vector Index that Shrinks a 60M-Chunk RAG Index from 201 GB to 6 GB appeared first on MarkTechPost.

Related

相關文章

智東西生成式AI

英特爾與騰訊發佈基於至強6+的雲實例,曬智能體AI基礎設施全家桶

作者 | ZeR0 編輯 | 漠影 11月3日報道,近日,在2026騰訊全球數字生態大會上,英特爾與騰訊雲發佈基於英特爾至強6+處理器的騰訊雲新一代雲實例,並全面展示英特爾的芯片產品與雲端實踐。 全新至強6+處理器擁有最高288顆能效核,單顆處理器最高可支持超過1000個智能體的穩定部署,這也為騰訊雲服務器提供更高併發、更低時延、更優能效的雲端算力服務。

1 小時前
雷峰網生成式AI

智元榮獲2026世界互聯網大會傑出貢獻獎

11月3日,2026年世界互聯網大會烏鎮峰會在浙江烏鎮隆重開幕,國務院總理李強出席開幕式並發表主旨演講。開幕式上,智元憑藉在具身智能領域的系統性技術突破與產業化實踐,獲頒世界互聯網大會傑出貢獻獎。智元合夥人、高級副總裁朱潔在領獎時表示:人工智能的終局,不在於屏幕與雲端,而紮根於工廠一線和尋常煙火。具身智能賽道的競爭,早已跳出單點技術的競速,轉向軟硬協同、工程化落地、產業組織與治理體系的綜合比拼。智元期待與各界同心同行,堅守務實,躬身落地。

1 小時前

電動車退燒、AI 儲能燒起來:LG 新能源把產能挪向數據中心

11 月 3 日,首席財務官李昌植在財報電話會上給出時間表:今年底軟包儲能系統(ESS)產能將超 50 吉瓦時,明年進一步拉到 70 GWh 以上。在他看來,電動車增速放緩之際,AI 數據中心的大規模新建為電池廠撕開了新口子——第三季度 ESS 在手訂單已達 160 GWh,公司正與電力企業、超大型數據中心運營商談新項目,今年 9 月還作為儲能供應商擠進了英偉達的 DSX Ready 計劃。

2 小時前4700
雷峰網生成式AI

最高288核的至強6+,為了Agent高密度部署還下了哪些「雲功夫」?

作者 | 陳悅琳編輯 | 包永剛 一個智能體能順利完成任務,不代表成百上千個智能體就能同時高效運行。 對於承載大量智能體任務的雲服務器而言,除了提升計算速度,如何在任務集中到來時迅速準備好執行環境、怎樣減少暫時閒置的任務對內存資源的佔用,也成為亟待解決的問題。 對此,在一年一度的騰訊全球數字生態大會上,英特爾與騰訊雲聯合發佈了基於至強6+處理器的新一代雲實例,圍繞任務啟動效率、內存資源利用率等關鍵因素進行優化後,其綜合性能較上一代提升30%以上。

2 小時前

聯合國副秘書長點贊!千問AI耳夾式耳機亮相烏鎮互聯網大會

他認為,產品非常實用,適合自己日常工作中需要使用多國語言進行交流的場景。面對面交流時,用戶可以通過耳機收聽譯文;會議中的討論內容,也能通過AI聽記整理為結構化紀要,方便會後回顧。連接千問App後,用戶還可通過語音交辦資料研究等任務、接收完成提醒,讓耳機成為日常辦公的隨身助手。

3 小時前