AI Tools
RAGIntermediate

LEANN

LEANN is an ultra-lightweight, on-device RAG (Retrieval-Augmented Generation) dedicated vector indexing technology developed by StarTrail-org, led by researchers from the Sky Computing Lab at UC Berkeley. To address the issue that conventional vector databases require more storage space than the original data by permanently storing high-dimensional dense vectors of numerous document chunks on disk, LEANN maintains only the graph structure and recomputes the embeddings in real-time only at the time of retrieval.

LEANN is an ultra-lightweight, on-device RAG (Retrieval-Augmented Generation) dedicated vector indexing technology developed by the StarTrail-org, led by researchers from the Sky Computing Lab at UC Berkeley. To address the issue of conventional vector databases requiring more storage space than the original data by permanently storing high-dimensional dense vectors of numerous document chunks on disk, LEANN adopts an architecture that maintains only the graph structure and performs 'selective recomputation' of the embeddings in real-time only when needed during retrieval.

The core operation is similar to a map app that, instead of storing 3D satellite images of every street in the world on disk, remembers only the framework (graph) of major road networks and renders only the necessary sections in real-time when a user explores a specific route. LEANN applies 'high-degree preserving pruning' to drastically reduce the edges of the graph itself by preserving the key nodes that serve as exploration hubs in the proximity graph, and then compresses and stores it in CSR (Compressed Sparse Row) format, reducing storage space by up to 97%.

This efficiency enables high-performance RAG to be executed on personal hardware, such as laptops in offline environments where privacy is paramount or network connectivity is limited, even with millions of documents. During graph traversal, only the necessary nodes are dynamically batched and recomputed for embeddings on hardware accelerators, allowing for 100% private semantic search without transmitting data to external servers, with minimal disk usage.

💻 System Requirements

🧠RAM

0 (CPU 단독으로 작동 가능하나, 임베딩 실시간 재연산 성능 향상을 위해 NVIDIA GPU 4GB+ 또는 Apple Silicon 통합 메모리 권장)

💾Storage

모델 및 데이터 용량에 따라 다르나, 인덱스 파일 크기는 기존 벡터 DB 대비 97% 감소(수백만 개 청크 기준 수십 MB~수백 MB 수준)

Installation

4-1. Quick Start

uv tool install leann-core --with leann

4-2. 상세 설치

GitHub 저장소 복제 및 이동

git clone https://github.com/StarTrail-org/LEANN.git cd LEANN

uv를 사용한 가상환경 생성 및 활성화

uv venv source .venv/bin/activate

leann 패키지 및 종속성 설치 (CPU 전용 환경은 leann[cpu] 권장)

uv pip install leann

FAQ

What is LEANN?

LEANN is an ultra-lightweight, on-device RAG (Retrieval-Augmented Generation) dedicated vector indexing technology developed by the StarTrail-org, led by researchers from the Sky Computing Lab at UC Berkeley. To address the issue of conventional vector databases requiring more storage space than the original data by permanently storing high-dimensional dense vectors of numerous document chunks on disk, LEANN adopts an architecture that maintains only the graph structure and performs 'selective recomputation' of the embeddings in real-time only when needed during retrieval. The core operation is similar to a map app that, instead of storing 3D satellite images of every street in the world on disk, remembers only the framework (graph) of major road networks and renders only the necessary sections in real-time when a user explores a specific route. LEANN applies 'high-degree preserving pruning' to drastically reduce the edges of the graph itself by preserving the key nodes that serve as exploration hubs in the proximity graph, and then compresses and stores it in CSR (Compressed Sparse Row) format, reducing storage space by up to 97%. This efficiency enables high-performance RAG to be executed on personal hardware, such as laptops in offline environments where privacy is paramount or network connectivity is limited, even with millions of documents. During graph traversal, only the necessary nodes are dynamically batched and recomputed for embeddings on hardware accelerators, allowing for 100% private semantic search without transmitting data to external servers, with minimal disk usage.

When should I use LEANN?

LEANN is an ultra-lightweight, on-device RAG (Retrieval-Augmented Generation) dedicated vector indexing technology developed by StarTrail-org, led by researchers from the Sky Computing Lab at UC Berkeley. To address the issue that conventional vector databases require more storage space than the original data by permanently storing high-dimensional dense vectors of numerous document chunks on disk, LEANN maintains only the graph structure and recomputes the embeddings in real-time only at the time of retrieval.

📄 Official Docs🐙 GitHub

📝 Update Notes

  1. vv0.3.77/19/2026

    LEANN v0.3.7 버전이 드디어 PyPI에 정식 출시되었습니다. 이제 pip 명령어를 통해 복잡한 설정 없이도 연구 환경에 아주 간편하게 설치할 수 있어요. 라이브러리 관리의 번거로움이 줄어든 만큼, 생명공학 데이터 분석 파이프라인을 더욱 빠르고 효율적으로 구축해 보세요.

🧪 Related Code of Life

No related Code of Life posts yet.