Files
LEANN/packages/leann
Andy Lee b3e9ee96fa fix: resolve all ruff linting errors and add lint CI check
- Fix ambiguous fullwidth characters (commas, parentheses) in strings and comments
- Replace Chinese comments with English equivalents
- Fix unused imports with proper noqa annotations for intentional imports
- Fix bare except clauses with specific exception types
- Fix redefined variables and undefined names
- Add ruff noqa annotations for generated protobuf files
- Add lint and format check to GitHub Actions CI pipeline
2025-07-26 22:38:13 -07:00
..
2025-07-27 01:08:17 +00:00
2025-07-24 00:47:46 -07:00

LEANN - The smallest vector index in the world

LEANN is a revolutionary vector database that democratizes personal AI. 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.

Installation

# Default installation (HNSW backend, recommended)
uv pip install leann

# With DiskANN backend (for large-scale deployments)
uv pip install leann[diskann]

Quick Start

from leann import LeannBuilder, LeannSearcher, LeannChat

# Build an index
builder = LeannBuilder(backend_name="hnsw")
builder.add_text("LEANN saves 97% storage compared to traditional vector databases.")
builder.build_index("my_index.leann")

# Search
searcher = LeannSearcher("my_index.leann")
results = searcher.search("storage savings", top_k=3)

# Chat with your data
chat = LeannChat("my_index.leann", llm_config={"type": "ollama", "model": "llama3.2:1b"})
response = chat.ask("How much storage does LEANN save?")

Documentation

For full documentation, visit https://leann.readthedocs.io

License

MIT License