Skip to content

gregdalzotto/ailore

Repository files navigation

ailore

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.


npm version npm downloads CI License: MIT Node

PortuguΓͺs πŸ‡§πŸ‡·


$ 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

What it does

  • πŸ” 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 mcp exposes 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.

Quick start

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.


Demo

ailore demo β€” index, search and ask with citations


πŸ“š Documentation

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.

How it works

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.


Why the name?

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.


Roadmap

  • Approximate nearest-neighbour index for very large repos
  • Watch mode (ailore index --watch)
  • PDF and notebook ingestion
  • Re-ranking step before generation

Contributing

Contributions are welcome β€” see CONTRIBUTING.md.

License

MIT Β© Gregori Dalzotto

About

Local-first semantic search & RAG for your codebase and docs. Ask questions, get answers grounded in your files with citations. Works offline with Ollama, or OpenAI, Gemini, OpenRouter.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors