You're building a backend that takes free-form user queries, routes them through language models or rules-based decision logic, and returns structured outputs that downstream services can consume. The system needs to turn messy natural language into validated fields, while still handling cases where the answer should come from retrieved context instead of pure generation.
How would you design a backend to process user queries, interact with language models or decision engines, and return structured data?
Language-model orchestrationStructured extraction with schema validationPrompt design for JSON outputsRetrieval-grounded answering