from agno.agent import Agent
from agno.db.postgres import PostgresDb
from agno.models.openai import OpenAIResponses
from agno.tools.sql import SQLTools
agent = Agent(
model=OpenAIResponses(id="gpt-5.5"),
db=PostgresDb(db_url="postgresql+psycopg://ai:ai@localhost:5532/ai"),
tools=[
SQLTools(db_url="postgresql+psycopg://readonly@warehouse/analytics")
],
instructions=(
"Introspect the schema before writing SQL. Answer with the numbers "
"and the exact query you ran. Never guess a column name."
),
)
agent.print_response("How many active subscriptions are on the Pro plan?")