AIToday
Large Language ModelsAI Coding AssistantsOpen-Source AIHacker NewsPublished: Aug 8, 2026, 16:00 JST2 min read

Lybrary brings persistent code memory to AI agents via local MCP server

Lybrary brings persistent code memory to AI agents via local MCP server

Key takeaway

  • 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.

3 Key Points

  1. 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.

  2. 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.

  3. 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 →

Context & Analysis

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.

FAQ

How much does Lybrary cost and where do I get it?
Lybrary is open-source and free. Install it with `pip install lybrary` (requires Python 3.11–3.14, no PyTorch or compilation needed).
Which AI editors does Lybrary work with?
Lybrary works out of the box with Kiro, Cursor, Claude Desktop, and Windsurf via MCP server integration.
What languages does Lybrary support?
Lybrary supports Python, JavaScript, TypeScript, TSX, Go, Rust, Java, C, and C++.

Get the latest Large Language Models news every morning

For example, today's edition would include:

  • DataAgent launches with $10M to auto-fix Kubernetes faultsSiliconANGLE AI · 44m ago
  • SK Hynix custom HBM boosts inference up to 5.15xDIGITIMES Asia · 44m ago
  • Nvidia Earnings: Boring by Design, Avoiding a Consolidated WorldStratechery (Ben Thompson) · 44m ago

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

Ask AI anything about this article. Q&As are published on this page for other readers too.

Related Articles

Next articleAI models alter responses based on user identity, study finds