Your AI database agent needs query routing before SQL
Dev.to AI
•
Generative AI
Not every database question should hit the same source. “What did revenue do last quarter?” can use a warehouse. “Is this customer currently blocked?” may need live operational data. “Export every user who churned” may need approval before it runs at all. AI database agents need query routing before SQL generation becomes execution. Routing is part of safety Production systems are not one database-shaped box. There are: primaries read replicas reporting warehouses materialized views caches audit tables third-party APIs They have different freshness, permissions, latency, and risk profiles.