
Lybrary is an open-source Python tool that builds a persistent, searchable index of your codebase and exposes it to AI agents via an MCP server.
Instead of re-reading files on each session, agents can query the memory in a single step, cutting token usage by 80–90% on large codebases.
It runs entirely locally, auto-updates when files change, and works out of the box with major AI IDEs like Cursor and Claude Desktop.
What happened
Lybrary, an open-source tool now available via pip install, gives AI coding agents a persistent, searchable index of a codebase using AST-aware chunking and local embeddings. Agents query the memory instead of re-reading files each session, and the tool exposes itself as an MCP server compatible with Kiro, Cursor, Claude Desktop, and Windsurf.
Why it matters
On large codebases, AI agents waste tokens and context re-reading the same files repeatedly before writing code. Lybrary cuts that overhead by 80–90% on large codebases by replacing multi-file reads with a single semantic search query, freeing up token budget and context for actual development work.
What to watch
The tool runs fully local with no cloud dependency, requires only `pip install lybrary` (Python 3.11–3.14, no PyTorch or compilation), and automatically re-indexes only changed files via a background daemon. Supported languages include Python, JavaScript, TypeScript, Go, Rust, Java, C, and C++.
Ask the AI about this article →
AI coding agents face a persistent inefficiency: every time they start a session, they re-read the same files to understand the codebase structure, burning tokens and filling context before writing a single line. On large codebases, this pattern repeats dozens of times per session. Lybrary addresses this by building a persistent, queryable memory indexed along actual code boundaries—functions, classes, methods—rather than arbitrary line splits. The tool uses tree-sitter, an incremental parser, to respect AST structure when chunking, ensuring that a semantic unit like a function stays intact.
The architecture is deliberately local-first: embeddings run via ONNX Runtime using MiniLM-L6-v2, SQLite stores the chunks and vectors, and a background daemon watches for file changes and re-indexes only what changed. By reducing multi-file reads to a single semantic search query, agents cut token waste by 80–90% on large codebases. Integration as an MCP server means agents in Cursor, Claude Desktop, Windsurf, and Kiro can call `memory_query` natively before attempting file reads, treating the persistent memory as a first-class tool rather than an afterthought.
For example, today's edition would include:
AI-summarized, only the topics you pick — one digest a day via Email, Slack, or Discord.
Free · takes 30 seconds · unsubscribe anytimeWhat is AIToday? →
Ask AI anything about this article. Q&As are published on this page for other readers too.
Israeli startup DataAgent Ltd
SK Hynix presented a custom HBM concept at SEMICON Taiwan 2026, where compute functions are placed in the base…

Nvidia reported earnings that were both remarkable and boring, reflecting its focus on avoiding a consolidated…

Anthropic has agreed to a $35bn cloud-computing contract with Lambda, a Nvidia-backed cloud provider

The Supreme Court of Japan has included about ¥60 million in its fiscal 2027 budget request for AI-related exp…

The Consumer Affairs Agency said Tuesday it will use generative AI to analyze about 900,000 annual consultatio…
