LEANN logo

LEANN

StarTrail-org/LEANN

RAG on Everything with LEANN

GraphCanon updated 3d · GitHub synced 3d · 25 views this month

13k stars1.1k forksLast push 2w Python MIT

Decision brief

LEANN is a retrieval-augmented generation (RAG) application that provides substantial storage savings and ensures privacy. It supports various models such as ColQwen2 and ColPali, making it easy to integrate into Python,

Good fit when

  • When you need significant storage savings, LEANN offers up to 97% reduction compared to other solutions.
  • If privacy is a top concern, use LEANN for fully private RAG applications directly on your device without relying on cloud services.

Avoid when

  • Avoid using LEANN if you have strict hardware limitations since it requires the installation of both Python and C++ dependencies.
  • LEANN may not be suitable for users who prefer tools that do not demand manual setup of vector databases or models like Ollama and ColQwen2.

Observed Jul 11, 2026 · Source: enrich:decision_facts

Verify the decision

Maintenance and security

Full trust report
Maintenance
Active (17d since push)
As of 3d
Provenance
Not a fork · Organization account
As of 3d
Security (OSV)
No lockfile
As of 1mo

Public GitHub metadata and optional OSV scans. Signals, not a guarantee. Trust methodology.

Install

pip install LEANN
PyPI

How it fits your stack(15)

Typed graph edges - alternatives, integrations, successors, and dependencies. Ranked by relationship type, not raw GitHub stars.

Alternative

Integrates

Relationship graph

Optional deeper exploration of typed edges and category neighbours.

Similar tools

Same-category neighbours not already linked as typed edges.

Evidence and technical details

Sourced facts, taxonomy, compatibility claims, README excerpt, and machine-readable endpoints.

Overview

LEANN offers retrieval-augmented generation (RAG) applications with significant storage savings and privacy.

Capability facts

CLI
CLI entrypoint

Source: pyproject.toml:[project.scripts] · Aug 18, 2026

Languages
python

Source: github.language+pyproject.toml · Aug 18, 2026

Categories

Graph entities

Compatibility

Sourced claims from the README excerpt - not unsourced marketing copy.

Python runtimePython

Source: README excerpt (regex_v1, Aug 18, 2026)

```python from leann import LeannBuilder, LeannSearcher, LeannChat
Source link

Tags

README

📦 Prerequisites: Install uv

Install uv first if you don't have it. Typically, you can install it with:

curl -LsSf https://astral.sh/uv/install.sh | sh

🚀 Quick Install

Clone the repository to access all examples and try amazing applications,

git clone https://github.com/yichuan-w/LEANN.git leann
cd leann

and install LEANN from PyPI to run them immediately:

uv venv
source .venv/bin/activate
uv pip install leann

---

# Install toolchain (if not already present)
choco install cmake swig pkgconfiglite nuget.commandline -y

---

# Install C++ dependencies via vcpkg
vcpkg install zeromq:x64-windows openblas:x64-windows lapack:x64-windows `
  boost-program-options:x64-windows protobuf:x64-windows

---

## Quick Start

Our declarative API makes RAG as easy as writing a config file.

Check out [demo.ipynb](demo.ipynb) or 

```python
from leann import LeannBuilder, LeannSearcher, LeannChat
from pathlib import Path
INDEX_PATH = str(Path("./").resolve() / "demo.leann")

---

# Pull a lightweight model (recommended for consumer hardware)
ollama pull llama3.2:1b

Linux:


---

# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh

---

# Pull a lightweight model (recommended for consumer hardware)
ollama pull llama3.2:1b

Install dependencies

uv pip install colpali_engine pdf2image pillow matplotlib qwen_vl_utils einops seaborn brew install poppler # macOS only, for PDF processing


#### Build Index
```bash
python -m apps.colqwen_rag build \
  --pdfs ./pdf_directory/ \
  --index my_index \
  --model colqwen2  # or colpali

Search

python -m apps.colqwen_rag search my_index "your question here" --top-k 5

Models

  • ColQwen2 (colqwen2): Latest vision-language model with improved performance
  • ColPali (colpali): Proven multimodal retriever

For detailed usage, see the ColQwen Guide.


Search for travel plans discussed in group chats

python -m apps.wechat_rag --query "travel plans" --max-items 10000


Install LEANN globally for MCP integration

uv tool install leann-core --with leann claude mcp add --scope user leann-server -- leann_mcp


Installation

If you followed the Quick Start, leann is already installed in your virtual environment:

source .venv/bin/activate
leann --help

To make it globally available:


---

# Install the LEANN CLI globally using uv tool
uv tool install leann-core --with leann

---

## 📄 License

MIT License - see [LICENSE](LICENSE) for details.

For agents

This page has a .md twin and JSON over the API.

Was this helpful?

Anonymous feedback helps us improve pages and translations.