Sailbird
Engineering Lab
Engineering Lab11 min read

Production RAG Infrastructure: Ingestion to Gateway

A reference for production RAG infrastructure: document ingestion, embedding pipelines, vector stores, secure retrieval gateways, and observability without owning the application layer.

QdrantWeaviatepgvectorEmbedding pipelinesAPI gatewayGitOpsPrometheusOpenTelemetry
Service line: Enterprise RAG & Agentic AIPublished July 15, 2026

Architecture at a glance

Production RAG infrastructure from source documents to a secure retrieval gateway: ingestion, embeddings, vector storage, and operational controls.

Ingest

Document pipelines

  • Source connectors and change detection
  • Chunking and metadata enrichment
  • Retry, dead-letter, and idempotent jobs
Embed

Embedding jobs

  • Pinned embedding model versions
  • Batch and incremental re-index paths
  • CI-gated promotion of pipeline images
Store

Vector index

  • Qdrant, Weaviate, or pgvector
  • Collections per tenant or domain
  • Backup, restore, and capacity planning
Gateway

Retrieval API

  • Auth, rate limits, and tenancy
  • Query logging and evaluation hooks
  • Cost and latency guardrails
Application boundary

Product owns agents and UX

LangGraph, LlamaIndex, or custom agent logic stays with the application team. This lab covers the infrastructure they call: retrieval, indexes, and the gateway that keeps production safe.

Platform controls

Security and observability

Identity at the gateway, secrets out of notebooks, and metrics that show retrieval quality, pipeline lag, and spend — not just that the vector store process is up.

Vector store options

Choose by constraints

Qdrant

Dedicated vector DB with strong filtering and self-hosted control

Weaviate

Hybrid search and modular vector platform deployments

pgvector

Postgres-adjacent path when operational simplicity wins

The baseline does not force one product. It requires versioned indexes, backup policy, and a gateway that stays stable as the store underneath evolves.

Retrieval lifecycle

From raw documents to a secured retrieval gateway with quality, lag, and cost signals.

Ingest
Documents and sources
Embed
Pinned model versions
Index
Vector store collections
Retrieve
Query and filter
Gateway
Auth and rate limits
Observe
Quality, lag, and cost

Overview

This lab documents a production baseline for RAG infrastructure. The goal is not a demo notebook that embeds a folder of PDFs once. It is a platform pattern: repeatable ingestion, versioned embeddings, a durable vector store, and a gateway that applications can call safely.

Sailbird stays on the infrastructure side of the line. Prompting, agent graphs, and product UX belong to the application team. We build the layer underneath: pipelines, indexes, auth, rate limits, evaluation hooks, and cost control.

Problem this reference solves

Many RAG projects look healthy in a prototype and fail under operational load. Documents change, embedding models get upgraded, indexes drift, and every team scripts its own way into the vector store. When retrieval quality drops, nobody can tell whether the cause is stale data, a bad chunking change, or gateway overload.

This baseline focuses on the platform questions: how content enters the system, how embeddings are promoted, how indexes are operated, and how retrieval is exposed without becoming an unauthenticated free-for-all.

  • One-off ingestion scripts with no retry, lineage, or re-index path
  • Embedding model swaps that silently invalidate existing vectors
  • Direct application access to the vector store with shared credentials
  • No visibility into pipeline lag, retrieval latency, or per-tenant spend

Reference architecture

The design is a pipeline into a store behind a gateway. Source systems feed ingestion workers. Embedding jobs write to collections with explicit metadata. Applications never talk to the vector database with admin credentials; they call a retrieval gateway that enforces identity, quotas, and logging.

GitOps covers deployment of pipeline workers, store configuration, and gateway services. Index contents are data, not Git objects, but the jobs and policies that produce those indexes are versioned and reviewable.

Ingestion pipelines

Ingestion is where most RAG systems quietly fail. Sources move, formats vary, and partial failures leave indexes in an unknown state. A production pipeline treats documents as work items: detect change, chunk consistently, attach metadata, and write results idempotently.

Dead-letter queues and replay matter more than clever parsers. Operators need to reprocess a single source, a date range, or a failed batch without rebuilding the entire corpus by hand.

  • Connectors for files, wikis, tickets, or databases with change detection
  • Stable chunking and metadata contracts reviewed like any other interface
  • Retries with backoff and dead-letter handling for poison documents
  • Replay and selective re-index without full corpus rebuilds

Embedding and index promotion

Embedding models are not free configuration. Changing them without a migration plan breaks retrieval quality in ways that look like application bugs. The baseline pins embedding versions in pipeline images and treats upgrades as a promotion event.

New embedding versions get their own collection or alias strategy, evaluation against a held-out query set, and a cutover plan. CI builds the pipeline image; staging proves the re-index; production switches only after quality gates pass.

  • Pinned embedding model and tokenizer versions in the pipeline image
  • Separate collections or aliases for major embedding upgrades
  • Evaluation hooks before traffic cutover
  • Rollback path to the previous index alias when quality regresses

Vector store operations

Qdrant, Weaviate, and pgvector are all viable. The choice depends on filtering needs, operational familiarity, and how tightly you want vectors coupled to an existing Postgres estate. The baseline cares more about backup, capacity, and tenancy than about brand preference.

Collections should map to clear ownership boundaries: tenant, product domain, or security zone. Capacity planning includes disk growth, memory for indexes, and rebuild time after failure.

  • Qdrant when you want a dedicated vector database with strong filtering
  • Weaviate when hybrid search and modular deployment matter
  • pgvector when Postgres operations and simplicity outweigh specialization
  • Backups, restore drills, and growth limits treated as platform work

Retrieval gateway

A gateway is the production boundary. It authenticates callers, applies rate limits, enforces tenant filters, and emits the logs you need for later evaluation. Without it, every application becomes a privileged client of the store.

The gateway should stay thin: retrieval and related controls, not prompt orchestration. Agent frameworks call the gateway. That separation keeps infrastructure stable while product teams iterate on agent behavior.

  • Workload identity or token-based auth for every caller
  • Per-tenant or per-key rate limits and quota enforcement
  • Mandatory metadata filters so one tenant cannot search another corpus
  • Structured query logs with latency, result counts, and error classes

Observability and evaluation hooks

RAG platforms need more than process uptime. Operators need pipeline lag, embedding job failures, retrieval latency, empty-result rates, and cost per million tokens or vectors written.

Evaluation hooks let product and platform teams share a contract: sample queries, expected document IDs, and quality scores can run against staging indexes before cutover. The platform provides the plumbing; product owns the judgment of answer quality.

  • Ingestion lag and failure rates by source
  • Retrieval latency and empty-hit rates by collection
  • Gateway auth failures, throttles, and per-caller spend
  • Hooks for offline evaluation jobs against pinned query sets

Security and tenancy

Document corpora are often more sensitive than model weights. Access control belongs at the gateway and in collection metadata, not only in application code that might be bypassed.

Secrets for source systems and embedding providers stay in a proper secrets backend. Pipeline workers and gateway services use short-lived identity. Admin paths to the vector store are limited to platform operators.

  • No shared long-lived credentials in application configs
  • Tenant isolation enforced in query filters and collection layout
  • Network boundaries between ingestion, store, and gateway tiers
  • Auditability for who queried what collection and when

What this lab includes

This reference shows how Sailbird approaches RAG and agent infrastructure: production ingestion, durable indexes, and a gateway that applications can trust while product teams keep ownership of agents and UX.

  • Reference architecture from ingestion through retrieval gateway
  • Operational patterns for embeddings, index upgrades, and rollbacks
  • Vector store options framed by constraints, not hype
  • A checklist for production readiness before real user traffic

Need production RAG infrastructure?

We help teams stand up ingestion pipelines, vector stores, secure retrieval gateways, and the observability that keeps RAG systems reliable as data and traffic grow.

Start a conversation

Ready to take your AI workloads to production?

Let's talk about your platform: cloud, hybrid, or edge. Start with a short, no-pressure conversation.