Glossary · AI & ML

Context Window

A context window is the maximum amount of text an AI model can consider at once–and for database tools, the budget that determines how much of your schema the model can see when generating a query.

Every language model has a fixed context window measured in tokens (roughly word fragments). For database AI this is a practical constraint: a schema with 300 tables and thousands of columns may not fit alongside your question, conversation history, and examples. Tools handle this by selecting only the schema slices relevant to the question–retrieving the right tables rather than sending everything. Why it matters: when relevant schema gets cut to fit the window, accuracy drops, so how a tool manages its context budget largely determines how well it handles large, real-world databases.

In practice

How AI for Database applies it

AI for Database sends only your schema–never your row data–to the AI, fitting the relevant structure into the model's context for each question.
AI & ML · aifordatabase glossaryRead-only ✓

Fig — every answer ships with the tables, rows and SQL behind it.

See it on your own database

Connect read-only in minutes. Free models included.

Start free