A schema is a contract for structured information: it specifies what entities or fields exist, how relationships are represented, and which outputs are acceptable. In language-model applications, schemas make generated data usable by downstream systems instead of leaving every response as free text. section 5.2.3 section 7.3.3
Choose the schema according to the product problem:
- Use a predefined data schema when an LM must return reliable fields for automation, validation, or model-training data. section 5.2.3
- Use a graph schema when connected entities matter more than isolated passages, such as companies, products, regulations, and market events. section 7.3.3
- Enforce the contract through function calling, constrained inference, provider structured-output features, or post-generation validation with Pydantic. section 5.2.3
A finance knowledge graph
A finance-focused GraphRAG system might define nodes for regulations, companies, and market events, then specify relationships such as a company being affected by a regulation. Retrieval can traverse those connections rather than returning unrelated text chunks. section 7.3.3
Figure 5.10 LMs can be used for offline processing, which allows running additional validation of their outputs.
Use the validation workflow to see how offline processing creates an opportunity to check generated outputs against a schema before deployment. section 5.2.3











































