RAG pipeline architecture diagram
Retrieval-augmented generation: ingestion on one path, question answering on the other.
About this template
Retrieval-augmented generation has two halves that run at different times. Ingestion happens offline: documents are split into chunks, embedded and written to a vector store. Answering happens per request: the question is embedded, similar chunks are retrieved, and the model answers with those chunks in its prompt.
Drawing both halves around the shared vector store makes the usual failure modes easy to point at: bad chunking, a mismatch between the two embedding steps, or a prompt that buries the retrieved context.
What is in the diagram
- Chunker
- Splits documents into passages. Chunk size and overlap decide what can be retrieved later.
- Embedding model
- Must be the same model for documents and for questions, otherwise similarity search is meaningless.
- Vector store
- Holds the embeddings and returns the top-k nearest chunks for a query.
- Prompt builder
- Combines the question, the retrieved chunks and your instructions into the final prompt.
More software architecture templates
Three-tier web app
Browser, load-balanced web servers, an application API, a cache and a replicated database.
Microservices
Clients, an API gateway, four services with their own data, and an event bus between them.
Event-driven architecture
Producers, a broker topic, independent consumers and a dead-letter queue.