Minimum Flow
rag-flow.txt
1. Collect documents
2. Split documents into chunks
3. Convert chunks into embeddings
4. Store them in a vector store
5. Retrieve chunks similar to the question
6. Send the question plus evidence to the LLM
7. Return the answer with citationsAPI Shape Example
api-contract.txt
POST /ai/ask
{
"question": "What is the refund policy?",
"filters": { "product": "starter" }
}
200 OK
{
"answer": "Refunds are available within 7 days of payment.",
"sources": [
{ "title": "refund-policy.md", "chunkId": "refund-003" }
]
}Tuning Keywords
chunk size
Small chunks lose context. Large chunks make retrieval less precise.
metadata filter
Limit search by product, permission, date, or document type.
hybrid search
Combine keyword search and vector search.
reranking
Reorder first-pass results to improve evidence quality.