Your team builds an internal agent that answers questions like "revenue by product category last quarter." It generates SQL against a Postgres database with 240 tables. The first version does the obvious thing: dump the entire schema into the system prompt. It mostly works, and it is quietly terrible — every single question pays the token cost of 240 table definitions, the agent confuses users.name with the actual column full_name because the real signal is buried in noise, and the schema snapshot in the prompt drifts out of date the moment someone runs a migration.

The fix is not a bigger context window. It is giving the agent the same thing a human analyst has: a way to look up the tables it needs, when it needs them.

This is a use case I did not originally design Infrawise for — it started as infrastructure context for AI coding assistants — but as of v0.15.0 it handles this pattern end to end, for SQL and NoSQL databases. (GitHub · npm)

The schema dump is the problem, not the model

When a query-writing agent gets the whole schema up front, three things go wrong: