Cross-industry

Building a Production RAG Knowledge Base Over a Large Codebase

Built a production retrieval-augmented knowledge base over a large multi-repository engineering codebase and document corpus, with dual embeddings, header-aware chunking, and a medallion pipeline. Exact scale and architecture inside.

Built a production retrieval-augmented (RAG) knowledge base over a large, multi-repository engineering codebase and document corpus, so an LLM could answer grounded questions instead of hallucinating across a sprawling polyglot codebase.

Context and stakes

Engineering knowledge was scattered across a large multi-repository ecosystem, hundreds of pull requests, and a pile of design documents. To make any of it useful to an LLM, whether for search, grounding, or content generation, it had to be ingested, chunked, embedded, and retrievable with enough precision that the answers could be trusted.

Problem

Naive approaches break at this scale. Fixed-size chunking shreds code blocks and headers. A single embedding model forces one permanent compromise across cost, latency, and control. Without metadata you cannot scope retrieval to the right repository, content type, or domain. The corpus also kept growing, so ingestion had to be repeatable rather than a one-off script.