Repolode
StarTrail-org

StarTrail-org/LEANN

A local vector index and RAG toolkit that cuts storage by about 97% by recomputing embeddings on demand, so you can search personal data on your laptop.

Stars
13,043
Forks
1,212
Open issues
37
Last commit
10 hours ago

What is it?

LEANN is a vector database for retrieval-augmented generation (RAG) that runs on a personal device. Instead of storing every embedding, it keeps a compact graph index and computes embeddings on demand during search, which the project says reduces storage by about 97% without loss of accuracy. The goal is to make it practical to index large personal collections, such as documents, email, browser history, and chat logs, locally.

The project provides a Python package installable from PyPI, with a declarative API for building an index, searching it, and chatting with an LLM over the results. It includes example apps for PDFs and text files, Apple Mail, Chrome history, WeChat, iMessage, and ChatGPT or Claude chat exports, plus an MCP server for connecting live sources such as Slack and Twitter bookmarks. It also works with Claude Code as a semantic search service.

For generation and embeddings, LEANN supports local engines such as Ollama, LM Studio, vLLM, and llama.cpp, as well as any OpenAI-compatible endpoint, including several cloud providers. Build and search run on Ubuntu, Arch, WSL, macOS, and Windows, with DiskANN and HNSW backends available.

Key features

  • 01Recomputes embeddings on demand, reducing index storage substantially.
  • 02Builds and searches indexes through a Python API and CLI.
  • 03Indexes PDFs, text, and Markdown files, plus Apple Mail, Chrome history, WeChat, and iMessage data.
  • 04Connects to live sources like Slack and Twitter bookmarks through MCP servers.
  • 05Works with local LLM engines such as Ollama and any OpenAI-compatible API.

Use cases

  • Searching years of personal documents, email, or chat history on a laptop without uploading data.
  • Adding semantic search over a codebase to Claude Code via MCP.
  • Building a private, portable knowledge base that can be moved between devices.
  • Running a local RAG chatbot over exported ChatGPT or Claude conversations.

Quick start

  1. 1

    Install uv (package manager) using the official install script from the README

  2. 2

    Create a virtual environment with uv

    uv venv
  3. 3

    Activate the virtual environment

    source .venv/bin/activate
  4. 4

    Install LEANN from PyPI

    uv pip install leann

Things to know

  • Building the optional DiskANN backend requires substantial system dependencies such as Boost, protobuf and MKL.
  • Cloud LLM and embedding providers require an API key, while fully local use depends on running your own inference engine.

Topics

FAQ

What is LEANN?
A local vector index and RAG toolkit that cuts storage by about 97% by recomputing embeddings on demand, so you can search personal data on your laptop. LEANN is a vector database for retrieval-augmented generation (RAG) that runs on a personal device. Instead of storing every embedding, it keeps a compact graph index and computes embeddings on demand during search, which the project says reduces storage by about 97% without loss of accuracy. The goal is to make it practical to index large personal collections, such as documents, email, browser history, and chat logs, locally.
Is LEANN free to use? What license does it have?
LEANN is open source under the MIT license. Check the license terms before using it in commercial products.
Is LEANN still maintained?
Actively maintained. The last commit to LEANN was on Oct 21, 2026.
What can I use LEANN for?
Searching years of personal documents, email, or chat history on a laptop without uploading data. Adding semantic search over a codebase to Claude Code via MCP. Building a private, portable knowledge base that can be moved between devices. Running a local RAG chatbot over exported ChatGPT or Claude conversations.
How do I install LEANN?
Install uv (package manager) using the official install script from the README Create a virtual environment with uv: uv venv Activate the virtual environment: source .venv/bin/activate Install LEANN from PyPI: uv pip install leann
Where can I get LEANN?
The source code and installation instructions are on GitHub: https://github.com/StarTrail-org/LEANN

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects