Local-first semantic search & RAG for your codebase and docs.
Ask in natural language, get answers grounded in your own files β with exact path:line citations.
Runs fully offline with Ollama, or with OpenAI, Gemini and OpenRouter.
$ ailore ask "how does hybrid retrieval combine BM25 and vector search?"
Hybrid mode runs two rankings over the same chunks β cosine similarity for
meaning and BM25 for exact tokens β then fuses them with Reciprocal Rank
Fusion, so the order reflects what both methods agree on. [core/retriever.ts:30-57]
Sources:
core/retriever.ts:30-57
core/bm25.ts:88-117- π Hybrid search β semantic (vector) and lexical (BM25) ranking fused, so it nails both concepts and exact symbols.
- π¬ Grounded answers (RAG) β a synthesized answer that cites the exact source lines it used.
- π Local-first β with Ollama, nothing ever leaves your machine: no API key, no cost.
- π Provider-agnostic β swap between Ollama, OpenAI, Gemini and OpenRouter with a single flag.
- π§© MCP server β
ailore mcpexposes search/ask as tools to Cursor and any MCP-capable assistant. - β‘ Incremental indexing β only changed files are re-embedded; the index is a plain file, no database, no native modules.
No need to clone this repo β the npm install below is all you need to use ailore (the source here is just for reading or contributing).
# 1. Install (Ollama path = 100% local, no API key)
npm install -g ailore
ollama pull llama3.1 && ollama pull nomic-embed-text
# 2. Index a project
cd my-project && ailore index
# 3. Ask
ailore ask "where is the rate limiter implemented?"Tip
New here? The Getting started guide walks you through it step by step β from installing models to your first cited answer.
| Guide | What's inside |
|---|---|
| π Getting started | Install, models, first index, first answer β step by step. |
| β¨οΈ Commands | index, ask, search, init, mcp and their flags. |
| βοΈ Configuration | Config file, env vars, tuning generation & retrieval. |
| π― Retrieval modes | hybrid / vector / keyword and how RRF fusion works. |
| π Providers | Ollama, OpenAI, Gemini, OpenRouter β mix and match. |
| π§© Editor / MCP integration | Wire ailore into Claude, Cursor and other MCP clients. |
| π οΈ How it works | The scan β chunk β embed β retrieve β answer pipeline. |
| π Security | Data flow, secrets, untrusted config, reporting. |
| π¦ Use as a library | Embed the engine in your own tooling. |
| β FAQ | Languages, privacy, cost, troubleshooting. |
files βββΆ scan (respect .gitignore) βββΆ chunk (line-aligned) βββΆ embed βββΆ .ailore/index.json
β
query βββΆ ββ cosine (semantic) ββ β
ββ BM25 (lexical) βββββ€β RRF fuse (top-k) ββΆ grounded prompt ββΆ LLM ββββΆ answer + citations
βββββββββββββββββββββββ
Chunking is line-aligned, so every retrieved chunk carries an exact path:startLine-endLine range β that's what makes the citations precise and verifiable. Full details in How it works.
ailore = AI + lore. Lore is the accumulated, informal knowledge that gets buried in a codebase and usually lives only in the heads of the people who've been around longest. ailore reads your files and turns that hidden knowledge into answers you can ask for in plain language.
- Approximate nearest-neighbour index for very large repos
- Watch mode (
ailore index --watch) - PDF and notebook ingestion
- Re-ranking step before generation
Contributions are welcome β see CONTRIBUTING.md.
