Experience · Data artifact
RAG Query API Schema
Data artifactExperienceExperience & Human Oversightarc:RAGQueryAPISchema
A typed request/response contract for a RAG service that bounds query length and retrieval parameters and structures answers with sources, timing breakdown, token usage and cache status.
Responsibility. Defines and validates the RAG service request/response contract.
Also known as: QueryRequest / QueryResponse models, API contract
Relationships
constrains control
Design guidance
- SHOULD reject malformed queries at the API boundary and return answers with citations and confidence or timing metadata.
Quantitative guidance
As stated by the sources; verify before use.
- Example bounds: query 3-500 characters, top_k 1-20, hybrid alpha 0-1 (Ch6.5).
Classification
- Patterns
- Schema-driven request validationSelf-documenting OpenAPI contract
- Technologies
- PydanticOpenAPI
- Risks mitigated
- Malformed or oversized queriesUnbounded prompt length from excessive top_k
Sources
- Ch6.5: T. Nguyen, "Production RAG Systems," in Mastering Agentic AI Systems: Guide for the NVIDIA NCP-AAI Exam, 1st ed. 2026, ch. 6.5. ISBN: 9798244538229.