Data sources
Retrieval
Orchestration
Interface
Documents
split into chunks
policy.pdf
faq.md
terms.md
1
2
Vector index
similarity search
0.91
policy.pdf §4
0.91
policy.pdf §4
0.86
faq.md #3
0.86
faq.md #3
0.42
terms.md §9
Orchestrator
retrieve, then prompt
LLM
writes the answer
question + chunks
draft answer
Chat UI
question in, answer out
What is the refund window?
Within 30 days of delivery.
1
2
request
response
A RAG app in four layers
A user asks a question
The question is embedded and searched
Nearest chunks point at their sources
The relevant chunks come back up
Top-k chunks reach the orchestrator
Question plus chunks go to the LLM
The LLM drafts a grounded answer
Answer with citations returns to the UI