schema
A schema is a pre-defined structural description: it specifies what fields a data item consists of, which are mandatory, and what type of value each can hold.
In plain terms
Think of an official form: there are separate fields for name, date of birth, and tax number, and you cannot write a poem in the date field. A schema is the same in the world of machines: the blank form of data that specifies where each item goes and in what format.
It is needed because programs cannot guess. If a system expects a number in the "amount" field but receives "about ten thousand", it freezes or calculates incorrectly. The schema is a shared agreement between sender and receiver, so two independent programs can understand each other.
With AI, this has become particularly important. A language model naturally writes free text, but with a schema, it can be constrained to answer in the requested structure. Schemas also describe which tools an agent can use and what data each tool must receive.
A schema describes the format and limits values at most to allowed ones. It states that the 'birth year' field requires a four-digit number, but not whether the entered year is true.
How it works
- Someone describes the structure: what fields exist, their names, what type of value can go into them (text, number, date, list), and which are mandatory.
- This description is recorded in a machine-readable format, such as a JSON Schema or as a database table definition.
- When data arrives or is created, a validation program compares it against the schema. This is called validation.
- If the data matches, the system lets it through. If not, it rejects it and typically indicates the reason in an error message, such as a missing required "email" field.
- With an AI model, the schema is submitted together with the request. The model adapts its response to it, and some services can technically produce only output that conforms to the schema.
An everyday example
When you type letters into the phone number field on an online store and the page highlights in red with 'invalid format', you are encountering the same principle on which a schema is built: the system measures the entered data against a pre-defined rule. The same happens in the background when an AI assistant searches for a flight ticket for you: the date, departure city, and arrival city must be passed in the exact structure specified by the booking system.
Who is affected
A common misconception
Limits and risks
- The schema does not filter out content errors: formally correct but false data passes the check just the same.
- An overly strict schema rejects exceptional but valid cases, such as unusual foreign address formats or phone numbers.
- If the schema changes so that previous data no longer matches it (for example, a new mandatory field is added), the systems built on it must also be updated, otherwise previously working connections will break.
- AI services do not support every element of schemas, and very complex, deeply nested schemas can degrade response quality.
Similar, but not the same
- data format (e.g., JSON) – Format is the grammar of the notation, while the schema describes what fields a given data point must contain in that language.
- sablon – A template is pre-written content with placeholders to fill, while a schema is a rule set against which data can be validated.
- API – The API is the interface for connecting programs, while the schema describes the structure of data passing through that interface.
Related concepts
adatmodell, metaadat
JSON schema, database schema, XML schema, asset definition
structured output, validation, JSON, API, tool calling, adatszerkezet
A brief history
The word originates from the Greek "schema" (shape, form). In computing, it spread with databases in the 1970s: the 1971 report by the CODASYL database working group already used it in this sense, and it became a fundamental concept in databases based on Edgar F. Codd's relational data model published in 1970. The W3C made the XML Schema standard an official recommendation in 2001. The first drafts of JSON Schema appeared around 2009 with the rise of the JSON format; while it never became an official standard, it is widely used in practice.
Where things stand
The schema has been a basic tool in software development for decades. By the end of 2026, it has become common in AI as well: major model providers support schema-bound, structured output, and agent tools are typically described using JSON schemas.
In the news
- Psychologist Bíró Bence Péter: AI does not replace human connectionOct 31, 2026 · Health
Also known as
schema · schema · data schema · data schema · JSON schema · JSON Schema · database schema · database schema
Sources
This entry was machine-edited and has undergone machine expert review; the “In the news” section updates automatically from Agent Age stories.