# Design a RAG Ingestion Pipeline system design, running live

Source: https://systemdesignsim.com/blueprints/rag-ingestion-pipeline

AI apps · SDE-3 · Queue chunks before quota-limited embedding

The upload handler stores each parsed chunk in S3 and puts it on a queue, so uploads finish in about a tenth of a second however busy the model is. A second function reads the queue with its concurrency capped at 20: each call holds one for about a quarter of a second, so it embeds about 87 chunks a second, under the 100 a second the quota allows, and writes each vector to the index. During the upload the queue grows instead of the model throttling, then drains. The quota sets the pace: at 6,000 chunks a minute, every 360,000 chunks take an hour whatever you build. The queue makes that a wait instead of lost chunks.

An illustrative teaching design, not a verified diagram of any company's internal architecture. Traffic, capacity and cost are simulator estimates. [Model and assumptions](https://systemdesignsim.com/methodology).

* Traffic

  20 req/sSmall scale

* AWS bill

  $1,115/mo

* p99

  120 ms

* Components

  6

The challenge models 20 chunks a second normally and a temporary 500 chunks a second upload; 6,000 embedding requests per minute is the fixed quota assumption.

[Open it running](https://systemdesignsim.com/playground?blueprint=rag-ingestion-pipeline)[Or build it yourself first](https://systemdesignsim.com/challenges/rag-ingestion)

![Design a RAG Ingestion Pipeline architecture on AWS at 20 requests a second](https://systemdesignsim.com/blueprints/rag-ingestion-pipeline.svg)

Design a RAG Ingestion Pipeline architecture on AWS at 20 requests a second. Scroll the diagram to see every component. The small text under a box is its traffic, instance count or shard count.

## How it works

1. The upload handler stores parsed chunks and enqueues work without waiting for embeddings.
2. A concurrency-limited function reads the queue and calls the embedding model.
3. The worker writes completed vectors to the vector index while backlog drains after a burst.

## What each part does

* Uploaded chunks

  Chunk uploads arrive at 20 per second normally and 500 per second during the challenge burst.

* Upload handler

  Stores parsed chunks and enqueues embedding work.

* Parsed chunks

  Durable storage for parsed chunks.

* Chunks to embed

  Buffers work until embedding capacity is available.

* Embedder

  Concurrency-limited consumer calls the embedding model.

* Embeddings

  Titan Text Embeddings V2 with the stated 6,000 requests per minute quota.

* Vector index

  Stores vectors for retrieval.

## What breaks first

The embedder reaches the model quota as the input rate rises.

The model quota sets processing speed. The queue preserves work while it waits, but this blueprint does not simulate the challenge's 10,000-PDF burst or its completion goal.

The simulator checks this every build: it runs the design at 20 req/s, then ramps traffic to 10x (200 req/s) and records which part fails first. In the playground, press Break it to watch the same thing happen.

## Trade-offs

### What it gets right

* A queue absorbs uploads faster than the model quota allows.
* Separating upload and embedding work keeps upload latency independent of model throughput.

### What it costs you

* The backlog can take time to drain after a large upload.
* The static graph does not execute the staged upload or guarantee exactly-once processing.

## In the real world

* Document ingestion systems often separate upload, parsing, embedding, and indexing with durable queues.
* A queue changes when work is completed; it does not increase the embedding provider's quota.

## In the interview

* Calculate quota in requests per second and compare it with chunk arrival rate.
* State how retries, idempotency, poison messages, and backlog alerts protect the pipeline.

## Run it yourself

The playground opens this design with 20 requests a second already flowing. Press Break it, or change one part yourself, and watch which number goes first.

[Open it running](https://systemdesignsim.com/playground?blueprint=rag-ingestion-pipeline)[Take the challenge: Design a RAG Ingestion Pipeline](https://systemdesignsim.com/challenges/rag-ingestion)

## Questions people ask

### How does Design a RAG Ingestion Pipeline work at the system design level?

The upload handler stores parsed chunks and enqueues work without waiting for embeddings. A concurrency-limited function reads the queue and calls the embedding model. The worker writes completed vectors to the vector index while backlog drains after a burst.

### What breaks first in a Design a RAG Ingestion Pipeline design?

The embedder reaches the model quota as the input rate rises. The model quota sets processing speed. The queue preserves work while it waits, but this blueprint does not simulate the challenge's 10,000-PDF burst or its completion goal.

### What are the trade-offs of this Design a RAG Ingestion Pipeline architecture?

A queue absorbs uploads faster than the model quota allows. Separating upload and embedding work keeps upload latency independent of model throughput. The backlog can take time to drain after a large upload. The static graph does not execute the staged upload or guarantee exactly-once processing.

### What do interviewers look for in a Design a RAG Ingestion Pipeline system design answer?

Calculate quota in requests per second and compare it with chunk arrival rate. State how retries, idempotency, poison messages, and backlog alerts protect the pipeline.

## More in ai apps

* [AI answer engine](https://systemdesignsim.com/blueprints/ai-answer-engine)
* [AI coding agent platform](https://systemdesignsim.com/blueprints/ai-coding-agent)
* [AI support agent](https://systemdesignsim.com/blueprints/ai-agent)
* [ChatGPT-style chat app](https://systemdesignsim.com/blueprints/chatgpt)
* [Global AI assistant](https://systemdesignsim.com/blueprints/ai-assistant-global)
* [RAG assistant](https://systemdesignsim.com/blueprints/rag-pipeline)
* [All blueprints](https://systemdesignsim.com/blueprints)

## One system design problem a week

A real scenario, its constraints, and where the obvious design breaks.

## Now break one yourself.

The first challenge takes about two minutes. No signup.

[Design your first system](https://systemdesignsim.com/challenges/hello-load-balancer)
