ory/lumen

Save 30% token costs when using Claude Code, Codex, OpenCode for free - with open source, local semantic search. Works for small and large codebases and monorepos! Enterprise-ready and fully compliant via Ollama and SQLite-vec.

What it solves

AI coding agents often struggle with large codebases because they attempt to read entire files, which is slow and expensive. Lumen provides a local, semantic search engine that acts as a map for these agents, allowing them to retrieve only the specific functions, types, or modules relevant to a task.

How it works

Lumen functions as an MCP (Model Context Protocol) server that sits between your codebase and your AI agent (such as Claude Code, Cursor, or Codex). It uses a Merkle tree to detect file changes and only re-indexes what has been modified. It parses code into semantic chunks using native ASTs or tree-sitter, converts these into vector embeddings using local models (via Ollama or LM Studio), and stores them in a local SQLite database with sqlite-vec. When an agent needs information, it queries this index to find relevant code snippets instead of reading entire files.

Who it’s for

Developers who use AI coding agents and want to reduce API costs, improve response times, and maintain high-quality code generation without sending their codebase to the cloud.

Highlights

  • Zero-Cloud Privacy: All indexing and embedding happen locally on your machine.
  • Significant Efficiency Gains: Benchmarks show up to 39% cost reduction and 53% faster session completion across various programming languages.
  • Incremental Indexing: Uses Merkle tree diffing to ensure only changed files are re-processed, making updates nearly instantaneous for large projects.
  • Broad Language Support: Supports 12 language families, including Go, Python, TypeScript, Rust, and Java.
  • Git Worktree Aware: Automatically shares index data across Git worktrees to avoid redundant processing.

Related

  • Project
  • Project
  • Project
  • Project