Multi-Backend Retrieval-Augmented Generation · Built in Go

OmniRAG — a RAG engine that works on top of your existing data.

A RAG engine that shifts retrieval intelligence to the orchestration layer — no schema migrations, no intrusive re-indexing, and equal precision on short keyword lookups and abstract semantic queries.

4 vector-DB implementations Document-aware routing Conditional semantic fallback SSE streaming retrieval
Dharmendra Yadav
Sr. Lead Engineer / Engineering Manager · Agentic AI Architect · Team Leadership & Delivery · AI-Augmented Product Engineering
Go
Single-language stack
4
Vector store backends
13+
Vector DBs compared
3
Output formats · Prose · Table · JSON
Video overview

Watch the walkthrough

A short video overview of the ideas behind the project — how retrieval, grounding, and a swappable vector layer fit together.

Video overview — retrieval, grounding, and a swappable vector layer.
Live UI

OmniRAG in action

The Pinecone pipeline end-to-end: ingest a PDF over a live Server-Sent Events stream — secured to GridFS, layout-extracted, embedded, and upserted to the vector space — then ask questions and get grounded, cited answers via Top-3 semantic retrieval and a streamed LLM.

OmniRAG ingestion in progress — streaming embeddings into Pinecone
Ingestion · streaming — GridFS → extraction → embeddings, with live SSE progress
OmniRAG ingestion complete — 4,265 vectors indexed into Pinecone
Ingestion · complete — 4,265 vectors indexed into the Pinecone vector space
OmniRAG intelligent document search — semantic retrieval with a grounded, cited answer
Retrieval — Embed query → Query Pinecone → Generate answer, grounded with ranked source citations
The Problem & The Approach

Why most RAG setups fall apart on real data

Out-of-the-box RAG pipelines force schema migrations, intrusive backend re-indexing, and complex prompt engineering on end-users. OmniRAG isolates the database layer from the AI retrieval logic — treating your primary database (MongoDB) as the source of truth, while document-aware routing and conditional fallback inside the vector layer drive deterministic accuracy.

🧭

Document-aware routing

Short single-token queries trigger keyword-sensitive filtering (Chroma where_document, Qdrant payload text match); abstract queries route to dense semantic search.

🪂

Conditional fallback

Filtered searches that return zero documents transparently retry as pure semantic vector search — no dead-ends, no empty answers.

🔌

Pluggable generation

Routes generation to Anthropic Claude or local Ollama based on config, with a credit-balance guard for clean, automatic fallback.

🗄️

No data sprawl

Your transactional store stays the source of truth. The vector layer is an additive retrieval index, not a migration target.

⚡

Streaming retrieval

The Pinecone pipeline serves a Server-Sent Events (SSE) API, streaming both ingestion progress and generated answers live to the UI.

🧱

Decoupled microservices

Seed, ingest, and retrieve run as independent Go services — clean separation of storage, embedding, and orchestration concerns.

One pattern, four backends

Vector-store implementations

Each module proves the same orchestration pattern against a different class of vector store — from frictionless local prototyping to managed serverless and full PDF/book ingestion.

🟪 ChromaDB RAG v1.0 · current

The flagship implementation. Go orchestration over MongoDB source data with Ollama embeddings, serving a browser search UI. Applies keyword-sensitive where_document filtering for short queries and retries without filters when results come back empty.

GoChromaDBMongoDBOllamaHNSW · cosineWeb UI
Browse chromadb-rag →

🟥 Qdrant RAG microservices

A highly decoupled microservices pipeline separating primary content storage from specialized vector search. Applies payload text filtering against the content field, then falls back to semantic vector search — leaning on Qdrant's in-graph filtering for low p99 latency.

GoQdrant (Rust)MongoDBOllamaClaudegRPC-ready
Browse Qdrant-rag →

🟦 Pinecone RAG PDFs · books · SSE

Extends the pattern to full PDF/book content. Stores raw PDFs in MongoDB GridFS, extracts text page-by-page, chunks with LangChainGo, embeds concurrently via Ollama, and upserts to Pinecone — streaming live ingestion and answer generation over SSE with a credit-balance guard.

GoPineconeGridFSLangChainGoSSETailwind UI
Browse pinecone-rag →

🟩 MongoDB RAG foundations

The modular starting point — a clean ingest/retrieve microservices split using MongoDB itself as the knowledge store, with local Ollama embeddings, Claude/Ollama generation, and configurable Prose / Table / JSON output formatting.

GoMongoDBOllamaClaudeSearch UI
Browse mongo-rag-beginner →
How a query flows

The orchestration layer

Retrieval intelligence lives in Go, not in the database. A single endpoint handles embedding, adaptive filtering, fallback, context assembly, and grounded generation.

OmniRAG data-flow: MongoDB as source of truth feeds an ingest service that embeds content via Ollama nomic-embed-text and upserts vectors into a vector store (ChromaDB, Qdrant, or Pinecone). On the retrieval side, a search UI/JSON API hits the retrieve orchestrator on port 8080, which embeds the query, runs adaptive keyword filtering with semantic fallback against the vector store, assembles top-k context, and generates an answer via Claude or Ollama streamed back over SSE.
End-to-end data-flow — ① ingestion into the vector store, ② adaptive retrieval and grounded generation. The vector layer is swappable: ChromaDB, Qdrant, or Pinecone.

The query path in detail

// POST /api/query  →  retrieve/main.go
1. Parse request        { "query": "...", "format": "prose|table|json" }
2. Embed query          Ollama /api/embed · model: nomic-embed-text
3. Adaptive filter      short single-token  → keyword/where_document filter
                          abstract/semantic   → dense vector search
4. Fallback             filtered result empty → retry as pure semantic
5. Assemble context     merge top results into one grounded block
6. Generate             route → Claude  |  Ollama (Gemma)
                          credit-balance guard → clean fallback
7. Stream answer        Server-Sent Events → UI

Ingestion path

Seed services load policy/source content into MongoDB. Ingest services read it back, generate embeddings through Ollama, and upsert vectors + payloads into the chosen store with cosine-space HNSW indexes (or page-by-page PDF chunks for Pinecone).

Retrieval path

A Go HTTP server embeds the incoming query, runs adaptive filtered-or-semantic search, builds a grounded prompt in the requested output format, and routes generation to Claude or local Ollama — all behind a clean web UI and JSON API.

Per-implementation

Each backend's data-flow

The same orchestration pattern, realized against four different vector stores. Each diagram traces that backend's real pipeline — collections, filters, embeddings, and ports.

ChromaDB RAG data-flow diagram
ChromaDB — where_document keyword filter + semantic fallback
Qdrant RAG data-flow diagram
Qdrant — payload text filter + semantic fallback (points/search)
Pinecone RAG data-flow diagram
Pinecone — PDFs → GridFS → chunk/embed → upsert; retrieval streamed over SSE
MongoDB RAG data-flow diagram
MongoDB — the database itself as the vector + knowledge store
Engineering surface area

Technology stack

A deliberately Go-centric stack spanning transactional storage, four vector engines, local + hosted LLMs, and streaming delivery.

● Go ● MongoDB + GridFS ● ChromaDB ● Qdrant ● Pinecone ● Ollama · nomic-embed-text ● Ollama · Gemma / Llama 3 ● Anthropic Claude ● LangChainGo ● HNSW · cosine ● Server-Sent Events ● Vanilla JS + Tailwind UIs
Where it's going

Engineering roadmap

OmniRAG is evolving from a single-node retrieval pipeline into a distributed, multi-agent framework.

v1.0.0Shipped

Go + ChromaDB metadata optimization layer, fixing short-query vector bias.

v1.1.0In progress

Abstracted multi-vector-DB client interface supporting Qdrant and Milvus.

v1.2.0Planned

Horizontally scalable ingestion worker pools for heavy concurrent document parsing.

v2.0.0Planned

LangChain & LangGraph integration for autonomous, stateful multi-agent workflows and graph-based context retrieval.

Dig into the engineering

Full source, per-module READMEs, data-flow diagrams, and a vector-database decision matrix covering 13+ engines live in the repository.