Platform

AI codebase search: finding code by meaning

Updated 2 min read

Atlas finds code by meaning, not just text. Its codebase index runs hybrid semantic and keyword retrieval and fuses the two ranked lists with reciprocal rank fusion, returning the exact file and line spans that answer a query. It chunks code by AST declarations with tree-sitter and can embed locally with Ollama in 2026.

Semantic plus keyword, fused

Keyword search finds exact text; semantic search finds meaning. Atlas runs both and fuses the ranked lists with reciprocal rank fusion, so a query like where do we validate auth tokens lands on the right code even without a literal match.

This hybrid approach avoids the failure modes of either method alone. Pure keyword search misses paraphrases; pure semantic search can drift. Fusing them gives results that are both precise and meaning-aware, which is what a coding agent needs to gather context before it edits.

AST-aware chunking

Atlas indexes code by AST declarations using tree-sitter, emitting one chunk per function, class, or method rather than blind line windows. Results point at named symbols with exact line ranges.

Declaration-level chunks mean retrieval returns coherent units of code, not arbitrary slices. Gaps between declarations are line-windowed so nothing is lost, and unsupported languages fall back gracefully. The index is incremental and hash-keyed, so re-indexing only touches what changed.

Local-first and private

Atlas can build its code index with local Ollama embeddings, keeping your code off third-party servers. The index is stored outside the repository and keyed per project.

For teams with privacy requirements, local embeddings mean semantic search never sends source to an external service. The same hybrid search powers the agent's context gathering, so better retrieval directly improves the quality of the changes Atlas proposes.

Frequently asked questions

How does Atlas search code?
Atlas uses hybrid semantic and keyword retrieval fused by reciprocal rank fusion, returning ranked file and line spans that answer a query.
What is reciprocal rank fusion?
It is a method that blends multiple ranked result lists into one, letting Atlas combine semantic and keyword matches into a single ranking.
Does Atlas understand code structure?
Yes. Atlas chunks code by AST declarations with tree-sitter, so results point at functions, classes, and methods rather than arbitrary line ranges.
Can code search run locally?
Yes. Atlas can build its index with local Ollama embeddings, keeping code off third-party servers.

Try Atlas in your terminal

The terminal-native AI coding agent. Open source, single binary.

Install Atlas

Related guides

Browse all guides