# Hybrid semantic + keyword code search in Atlas (2026)

> Atlas searches code with hybrid semantic and keyword retrieval fused by reciprocal rank fusion.

Hybrid semantic + keyword code search in Atlas, also known as Axis, combines the precision of keyword matching with the conceptual understanding of semantic search to find relevant code. This capability works by indexing code using AST declarations and local Ollama embeddings, then fusing both retrieval methods through reciprocal rank fusion to deliver a single, highly relevant result set to the developer.

## Key takeaways

- Atlas combines semantic and keyword search for comprehensive code discovery.
- Reciprocal rank fusion intelligently merges search results.
- Code is indexed by AST declarations using tree-sitter.
- Local Ollama embeddings keep your code private and off third-party servers.
- Atlas provides a single, unified ranking for search queries.

## What is hybrid code search in Atlas?

Atlas, the terminal-native AI coding agent, provides Axis, the hybrid semantic and keyword code search, to help developers locate relevant code by both meaning and exact text. This powerful capability, available in 2026, fuses results into one unified ranking, ensuring comprehensive and precise code discovery within your codebase.

Axis, the hybrid semantic and keyword code search, is a core retrieval capability within Atlas. It is designed to overcome the limitations of traditional keyword-only search, which can miss conceptually related code, and pure semantic search, which might overlook exact string matches. Atlas achieves this by performing both types of retrieval and then intelligently combining their outputs. This ensures that whether a developer is looking for a specific function name or a piece of code that performs a particular task, Atlas can surface the most relevant results.

## How does Atlas perform hybrid code search?

Atlas performs hybrid code search by first indexing your codebase using AST declarations via tree-sitter, not arbitrary line windows. This foundational step, critical in 2026, allows Atlas to build a structured understanding of your code, which is then augmented with local Ollama embeddings for semantic context, ensuring privacy and precision.

The mechanism behind Atlas's hybrid code search involves several distinct steps. First, Atlas indexes your code by parsing Abstract Syntax Tree (AST) declarations using tree-sitter. This provides a structural understanding of the code, identifying functions, classes, and variables. Concurrently, Atlas generates semantic embeddings for this indexed code using local Ollama embeddings. This process keeps your proprietary code off third-party servers, maintaining data privacy. When a search query is issued, Atlas performs both a keyword search against the indexed text and a semantic search against the embeddings. The results from these two distinct retrieval methods are then combined and re-ranked using reciprocal rank fusion to produce a single, optimized list of code snippets.

## What is reciprocal rank fusion in Atlas?

Reciprocal rank fusion is the critical algorithm Atlas uses to combine the results from its semantic and keyword code searches into a single, coherent ranking. This fusion process ensures that highly ranked items from either search method receive appropriate weight, providing a robust and comprehensive result set for developers in 2026.

Reciprocal rank fusion is the specific technique Atlas employs to merge the independent rankings generated by its semantic and keyword search components. When a developer initiates a search, Atlas first executes a semantic search, which identifies code based on its conceptual meaning, and a keyword search, which finds exact text matches. Each search produces a ranked list of results. Reciprocal rank fusion then takes these two lists and assigns a score to each unique item based on its rank in both lists. Items that appear high in both rankings receive a significantly boosted score, while items that appear high in only one still contribute meaningfully to the final combined ranking. This method is implemented in Atlas-Backend/atlas/src/codebase-index/domain/vector-math.ts and Atlas-Backend/atlas/src/codebase-index/application/search-engine.ts, specifically within the `reciprocalRankFusion` and `SearchEngine.search` symbols.

## How does Atlas ensure code privacy during search?

Atlas ensures code privacy during its hybrid semantic and keyword code search by building its code index with local Ollama embeddings. This critical design choice, implemented in 2026, means that your proprietary code never leaves your local environment for embedding generation, keeping sensitive information off third-party servers.

A key aspect of Atlas's design for code search is its commitment to privacy. When Atlas builds its code index for semantic retrieval, it utilizes local Ollama embeddings. This means that the process of converting your code into vector representations, which are essential for semantic search, occurs entirely on your local machine. No code snippets or their derived embeddings are transmitted to external, third-party servers for processing. This architecture ensures that your intellectual property remains within your control, addressing a significant concern for developers evaluating AI coding agents.

## FAQ

### What is Axis, the hybrid semantic and keyword code search?

Axis is Atlas's capability that finds code by both its meaning (semantic search) and exact text (keyword search), fusing these results into one comprehensive ranking using reciprocal rank fusion.

### How does Atlas ensure my code is private during search?

Atlas ensures code privacy by building its code index with local Ollama embeddings. This means all semantic processing of your code happens on your machine, preventing your code from being sent to third-party servers.

### What is reciprocal rank fusion and why does Atlas use it?

Reciprocal rank fusion is an algorithm Atlas uses to combine the ranked lists from its semantic and keyword searches. It ensures that highly relevant results from either method contribute significantly to the final unified ranking, providing a more robust and complete search outcome.

### Does Atlas search all file types with its hybrid method?

Atlas indexes code by AST declarations using tree-sitter. While it excels at code files, its semantic search is optimized for structured code elements rather than arbitrary text files or comments not tied to declarations.

### Where can I find the implementation details for Atlas's search?

The implementation for Atlas's hybrid search, including reciprocal rank fusion and the search engine, is located in the Atlas-Backend, specifically within the `atlas/src/codebase-index/domain/vector-math.ts` and `atlas/src/codebase-index/application/search-engine.ts` files.

### Can I use different embedding models with Atlas's search?

Atlas builds its code index with local Ollama embeddings, allowing you to leverage local models. Atlas also lets you switch the active model and provider on the fly with favorites and recents, which applies to its agent interactions and potentially its embedding generation, depending on configuration.

---

Canonical HTML: https://seashell.sh/resources/features/hybrid-code-search
Source of truth: aeo_pages row `/resources/features/hybrid-code-search` (segment: Platform) (this file is generated from it, never hand-edited).
Licence: SeaShell is proprietary with a free core. It is not open source and there is no public source repository.
