app/storage/database.py:46–82
BM25 lexical hits and semantic hits fused by reciprocal-rank fusion.
rrf k=60 · rank 1 of 5Open source · Local-first · MCP-native
FireLens is the open-source local code search engine for AI coding agents — lexical, semantic, and graph retrieval fused with RRF, native MCP tools, and Mojo-accelerated hot paths. Your code never leaves your machine.
where are indexes persisted?↵app/storage/database.py:46–82
BM25 lexical hits and semantic hits fused by reciprocal-rank fusion.
rrf k=60 · rank 1 of 5FireLens turns a checked-out codebase into a local search engine your agent can query — lexical, fuzzy, semantic, hybrid, and graph — without moving source code through another service.
firelens.dbAtomic replacement · shared read locktop_k: 5snippet: 4,000 chars maxThese numbers show how much faster is the Mojo acceleration than Python for the same query, on the same machine. Timings measure complete calls, including Python-to-native buffer preparation.
Read the benchmark methodThe same fuzzy query drops from an 11.257 ms Python median to 2.788 ms with Mojo.
Python p95 11.388 ms · Mojo p95 2.850 ms · 30 iterationsRanking 50,000 vectors takes 6.490 ms with Mojo against 7.696 ms in Python and NumPy.
Python p95 8.039 ms · Mojo p95 7.456 ms · 30 iterationsAuto routes Mojo fuzzy at ≥4 candidates and semantic ranking at ≥30,000 rows.
Apple M4 Max · 16 logical CPUs · 30 measured iterationsSourcebot and Sourcegraph made code search a product you host and browse. FireLens gives your agents deeper retrieval, zero infrastructure, and code that never leaves the machine it lives on.
| Capability | FireLens | Sourcebot | Sourcegraph |
|---|---|---|---|
| Runs where your code lives | Local CLI and MCP — no server, no Docker | Self-hosted web server | Cloud or enterprise install |
| Lexical search | SQLite FTS5 · BM25 ranking | Regex and symbols | Regex and symbols |
| Semantic search | Local 768-d vector embeddings | — | — |
| Hybrid ranking | RRF fusion of lexical + semantic | — | — |
| Graph search | Dependency-graph traversal | — | — |
| Accelerated hot paths | Experimental Mojo · up to 4.04× | — | — |
| Built for coding agents | MCP-native from day one | Browser-first experience | Browser-first experience |
| Where your code lives | Never leaves your disk | Indexed on a server | Indexed on a server |
Based on publicly documented features. Sourcebot and Sourcegraph are trademarks of their respective owners.
Install FireLens, index a local repository, and ask for the code your agent needs next.
Read the docs# install
$ git clone https://github.com/aslanbayli/firelens.git
$ cd firelens && uv sync
# retrieve
$ uv run firelens index /path/to/repo
$ uv run firelens search /path/to/repo "where are indexes persisted?" --mode autoNo. FireLens indexes local repository paths and persists indexes in SQLite on your disk. Its retrieval surfaces are a local CLI, Streamlit, and STDIO MCP tools — there is no cloud component.
Lexical hits come from SQLite FTS5 with BM25 ranking; semantic hits come from local vector embeddings. Reciprocal-rank fusion (RRF) merges the two lists, so exact keywords and natural-language intent reinforce each other instead of competing.
FireLens represents your repository as a dependency graph of imports, symbols, and call relationships, then searches over it. That answers structural questions keyword search can't — like who calls a symbol or what a module depends on.
The current parser is Python-first. The architecture keeps the parser boundary explicit so additional languages can be added without changing retrieval contracts.
No. Python and NumPy provide the reference path. Mojo is optional and used only for fuzzy and semantic workloads where the benchmark supports it.
FireLens exposes local STDIO MCP tools for index status, indexing, and bounded code search.
Your context window is valuable.