Supports building RAG libraries directly from Git repositories, enabling AI to search and retrieve documentation from version-controlled sources.
Enables building searchable RAG libraries from GitHub repositories, allowing AI assistants to ground responses in repository documentation and code.
Mentioned as an example repository that can be built into a searchable RAG library for AI assistants to query React documentation.
Uses SQLite as the storage backend for portable RAG libraries, with embedded vectors, full-text search indexes, and metadata in single-file databases.
Mentioned as an example library that can be included in collections and used programmatically with TypeScript/JavaScript projects.
Create private, local RAG libraries that ground your AI in real documentationβnot 2-year-old training data. No cloud, no API keys, just single files you can share with your whole team.
What's RAG? Retrieval-Augmented Generation lets AI retrieve relevant context before responding, instead of relying solely on training data. libragen packages your docs into searchable libraries your AI can query.
π― Why libragen?
Ground AI in truth β Give your coding agents authoritative docs to cite, dramatically reducing hallucinations
Always current β Rebuild libraries when docs change; your AI gets the latest APIs, not stale training data
Private & local β Everything runs on your machine. No API keys, no cloud bills, no data leaving your network
Shareable β Single
.libragenfiles work anywhere. Share via git, S3, or install from curated collections
β¨ Features
οΏ½ Hybrid Search β Combines vector similarity with BM25 keyword matching
π Reranking β Optional cross-encoder reranking for improved relevance
π¦ Portable β Single-file SQLite databases with embedded vectors
π§ Smart Chunking β Language-aware splitting that respects code boundaries
π Multiple Sources β Build from local files or git repositories
π€ MCP Native β Works directly in Claude Desktop, VS Code, and any MCP client
π¦ Packages
Package | Description |
Core library for embedding, chunking, storage | |
Command-line interface for building and querying | |
Model Context Protocol server for AI assistants |
π Quick Start
Installation
Build a Library
Query a Library
Use with AI Assistants
Install the MCP server globally:
Add to your Claude Desktop config (on macOS:
~/Library/Application Support/Claude/claude_desktop_config.json):
Then install libraries to make them available:
οΏ½ CLI Commands
Command | Description |
| Build a library from files or git repo |
| Search a library for relevant content |
| Display library metadata |
| List installed libraries and collections |
| Install a library or collection |
| Remove an installed library or collection |
| Update installed libraries to newer versions |
| Create a collection file |
| Display configuration and paths |
| Manage shell completions (bash, zsh, fish) |
π Collections
Collections are JSON files that group libraries together for easy installation:
Create a collection:
Install a collection:
Collections support:
Nesting β Collections can include other collections
Deduplication β Libraries are only installed once
Optional items β Mark libraries as
"required": falseReference counting β Uninstalling removes only unreferenced libraries
βοΈ Configuration
Storage Location
By default, libragen stores libraries and configuration in a platform-specific directory:
Platform | Default Location |
macOS |
|
Windows |
|
Linux |
(defaults to
) |
Override this by setting the LIBRAGEN_HOME environment variable:
The directory structure is:
π Library Format
A .libragen file is a SQLite database containing:
Metadata β Library name, version, description, embedding model info
Chunks β Code/documentation segments with source file info
Embeddings β Vector representations using
Xenova/bge-small-en-v1.5(384 dims)FTS Index β Full-text search index for keyword matching
π Programmatic Usage
Use @libragen/core directly in your TypeScript/JavaScript projects:
π οΈ Development
ποΈ Architecture
π Acknowledgments
libragen uses the following open-source models:
BGE-small-en-v1.5 β Embedding model by BAAI (MIT License)
β Reranking model by Mixedbread (Apache-2.0)
If you use libragen in academic work, please cite the underlying models:
π License
MIT β see LICENSE for details.