Skip to main content

database

Connect to a database and run queries: connect opens a connection, query runs SQL (or the store's query language), disconnect closes it. Supports Postgres, MySQL, MongoDB and Redis.

Exact tools and parameters

catalog.describe_module database returns the real tools and every parameter, from the live registry - the authority for what actually runs.

Tools, at a glance: connect, query, disconnect.

Gotchas​

  • Configure named databases in the module config; raw dsn connect is gated by module policy (allow_raw_dsn and related settings).
  • Keep the agent read-only unless it truly needs to write - grant only connect
    • query for an analyst, and describe the schema in the prompt so it doesn't guess table names.

A working app​

Compiles as-is. The brain uses a Digitorn gateway model (the default - no API key of your own needed); see the note below to use your own key or a local model instead.

yaml
app:
app_id: db_analyst
name: Database Analyst
runtime:
entry_agent: main
agents:
- id: main
system_prompt: |
Answer questions about the database: connect, run read-only SQL to
explore, and summarise results. Disconnect when done.
brain:
provider: openai
backend: openai_compat
model: mimo-v2.5-free # a model the Digitorn gateway serves
config:
api_key: placeholder # ignored in gateway mode
tools:
modules:
database: {}
capabilities:
grant:
- module: database
tools: [connect, query, disconnect]