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.

Lybrary questions

What does Lybrary do?

Lybrary indexes functions, classes, and files in a repository. Coding agents can search that index through MCP and get relevant source locations with file paths and line numbers.

Does Lybrary send my source code to a server?

No. Lybrary runs locally, and the repository source and index stay on your machine.

Which coding agents work with Lybrary?

Lybrary works with MCP-compatible clients, including Codex and Claude Code.

How do I install and start Lybrary?

Install Lybrary with pip install lybrary, change to a repository, and run lybrary start. Register its MCP server with your coding agent to make the search tools available.