| Requirement | Default approach | Verification |
|---|---|---|
| Answers grounded in internal documents | RAG: retrieve documents and provide evidence | Retrieved-document relevance and citation accuracy |
| Current order or deployment status | Tool calls with authorization checks | Actual tool results and lookup time |
| Classification or extraction consumed by an application | Schema-based structured output | Schema and business-rule validation |
| Several fixed processing stages | Explicit workflow | Inputs and outputs at each stage |
Document collection → permission and version metadata → chunking and indexing → retrieval → optional reranking → generation with evidence → citation verification.
Apply user access scope before retrieval. Document deletions and permission changes must also propagate to the index.
Function arguments generated by the model are proposals. The server must revalidate their format, permissions, and business conditions before execution, then return the result to the model. Design execution policies and idempotency separately for external transmission, payments, and deployments.
Compare keyword, vector, and hybrid retrieval using the same question set. Choose based on measured accuracy, latency, and operating cost instead of introducing long context or a vector database first.