# Building a RAG Pipeline for Semantic Code Search: A Developer Diary and Field Notes

DevFeed: [Building a RAG Pipeline for Semantic Code Search: A Developer Diary and Field Notes](<https://devfeed.tech/articles/building-a-rag-pipeline-for-semantic-code-search-a-developer-diary-and-field-notes-119339.md>)

Original publisher: [Read original article](<https://blog.jetbrains.com/ai/2026/11/building-a-rag-pipeline-for-semantic-code-search-a-developer-diary-and-field-notes-part-2/>)

Author: Eduard Gurskiy

Published: 2026-11-05T14:54:27Z

Content type: article

Language: en

Sources: [JetBrains](<https://devfeed.tech/sources/the-jetbrains-blog.md>)

Topics: [code search](<https://devfeed.tech/topics/code-search.md>), [Retrieval Augmented Generation (RAG)](<https://devfeed.tech/topics/retrieval-augmented-generation-rag.md>), [Embeddings](<https://devfeed.tech/topics/embeddings.md>), [search-engines](<https://devfeed.tech/topics/search-engines.md>)

Tags: [agent](<https://devfeed.tech/tags/agent.md>), [agentic](<https://devfeed.tech/tags/agentic.md>), [agentic-ai](<https://devfeed.tech/tags/agentic-ai.md>), [agents](<https://devfeed.tech/tags/agents.md>), [ai](<https://devfeed.tech/tags/ai.md>), [algorithm](<https://devfeed.tech/tags/algorithm.md>), [algorithms](<https://devfeed.tech/tags/algorithms.md>), [ann](<https://devfeed.tech/tags/ann.md>), [approximate-nearest-neighbor](<https://devfeed.tech/tags/approximate-nearest-neighbor.md>), [approximation](<https://devfeed.tech/tags/approximation.md>), [architecture](<https://devfeed.tech/tags/architecture.md>), [code](<https://devfeed.tech/tags/code.md>), [code-search](<https://devfeed.tech/tags/code-search.md>), [pipeline](<https://devfeed.tech/tags/pipeline.md>), [production](<https://devfeed.tech/tags/production.md>), [rag](<https://devfeed.tech/tags/rag.md>), [rag-pipeline](<https://devfeed.tech/tags/rag-pipeline.md>), [search](<https://devfeed.tech/tags/search.md>), [semantic](<https://devfeed.tech/tags/semantic.md>), [storage](<https://devfeed.tech/tags/storage.md>), [tooling](<https://devfeed.tech/tags/tooling.md>)

## AI overview

Air Context's code-search RAG pipeline combines approximate nearest-neighbor search with an exact comparison over a smaller candidate set, balancing scale and precision. For filtered search, pre-filtering gives full recall but can become costly on large subsets; metadata-aware indexes such as Qdrant and turbopuffer support filters within ANN, while post-filtering can return too few valid results. Incremental indexing reuses unchanged Merkle-tree subtrees and deduplicates chunks; HNSW builds run asynchronously with controlled concurrency, and the service scales across customer-pinned shards. Developers can also use a local USearch index, with results merged from local and remote search. After retrieval, the system removes duplicates, groups file fragments, and reranks candidates. A bounded retrieval agent can call search and read tools, while result detail varies with relevance to limit context. The excerpt says a follow-up will evaluate agent impact; its teaser reports up to 70% fewer turns, without describing the evaluation here.

## Source excerpt

Part 2: Storage, Search, and Agent Tooling In this blog series, we aim to share some of the lessons we learned over the past six months as we built and rolled out Air Context, a production-grade RAG system for code search. In the first post of the series, we covered chunking, parsing, and vectorization. Turning [...]