lybrary

Local codebase memory · MCP server

Local codebase memory and code search for AI coding agents.

Lybrary indexes functions, classes, and files in each repository. Agents can query compact, line-numbered results, then inspect only the source they need.

Get startedView on PyPI

Any repository

Run lybrary start inside a folder. Its own index is created and kept fresh by a background watcher.

Your configuration

Change indexed languages, ignored paths, chunk sizes, model, device, and watcher debounce in .lybrary/config.toml.

Your machine

Source and index remain local. The stdio MCP server works with Codex, Claude Code, and other compatible clients.

Start in a repository

pip install lybrary
cd /path/to/your/repo
lybrary start
lybrary status

The daemon continues after the terminal closes. Use lybrary stop in that repository when you want to stop watching it.

Connect your agent

Register Lybrary once with your MCP client, then start the agent inside an indexed repository. Follow the setup guide for Codex or Claude Code.

If you ask an agent to set this up for you, share the agent setup guide. It links the official package and source, then shows how to verify the installation and active index.

MCP registration makes the tools available. A short instruction in AGENTS.md or CLAUDE.md helps the agent call memory_query before broad searches.

Where it can save context

A compact result points to a symbol, file, and relevant lines, so an agent may avoid opening several unrelated files. It still inspects current source before editing. Savings vary by task and agent behavior; measure complete runs to assess the effect in your repo.

Built for code

Tree-sitter identifies code boundaries in Python, JavaScript, TypeScript, TSX, Go, Rust, Java, C, and C++. Search starts with exact symbols and SQLite FTS5 text matches; local embeddings are a fallback when lexical evidence is weak. You can use the CLI directly or the MCP tools memory_query, memory_status, and memory_update.