For the complete documentation index, see llms.txt. Markdown variants are available by appending .md to any URL or sending an Accept: text/markdown header. An agent skill is available at /.well-known/agent-skills/site-skill.md.
99
Sponsor

Chat with Database

Introspects a database schema, converts questions to SQL, and runs read-only queries.

Live preview

Eve

Output will stream here when you run the agent.

Summary

The Chat with Database Agent answers questions about your data in plain English. It introspects the schema, writes the SQL, runs it read-only, and explains the results. Reach for it to give non-SQL users a safe way to query a database, or to prototype analytics without hand-writing queries.

Install

$ pnpm dlx shadcn@latest add @agentcn/eve/text-to-sql

Composition

agent/
├── agent.ts                   # Agent definition (model + config)
├── instructions.md            # Introspect → SQL → execute instructions
├── lib/
│   └── db.ts                  # Database client (SQLite by default)
└── tools/
    ├── introspect_schema.ts   # Lists tables and columns
    └── run_query.ts           # Runs a read-only SELECT

Customization

  • Swap the database. Replace the client in lib/db.ts with Postgres or MySQL.
  • Allow writes (carefully). The run_query tool blocks non-SELECT SQL by default — relax that only behind explicit confirmation.
  • Add row limits. Cap result size in run_query to protect against huge scans.
  • Swap the model. Edit agent/agent.ts.