Supported databases
- PostgreSQL
- MySQL
- MongoDB
- Redis
Setup
Configuring DB credentials following the steps below, allow you to securely store the credentials inDB_CONNECTION_URI environment variable and it is not directly exposed to the model context.
Option A (recommended): configure once per machine
Run the interactive DB configuration to save your connection URI and reuse it across sessions.- Ask you to pick a database type
- Prompt for a connection URI (input is hidden)
- Save it as
DB_CONNECTION_URIand apply it to the current session
Option B: Configure on request
If you miss to configure prior to the request, the model would automatically invoke the configuration screen during DB analysing requests.Step-by-step usage
Step 1: Start a session
Step 2: Configure your DB connection (optional, but recommended)
Step 3: Ask questions (read-only)
BLACKBOX CLI will connect (if needed), inspect schema, and translate your request into safe read-only queries.Step 4: Refine and iterate
You can keep asking follow-up questions without reconnecting.The connection stays active in the current session. Start a new session (or re-run
/db configure) if you need to switch databases.Examples by database
PostgreSQL
Configure once:MySQL
MongoDB
If your MongoDB URI includes a database name (path), it can connect directly:Redis
Best practices
- Be specific about the data you want and the time range
- Ask for a quick schema overview if you are unsure of table or field names
- Start broad, then narrow down with follow-up prompts
- Use a dedicated read-only database account for safety
Troubleshooting
- “DB_CONNECTION_URI is not configured”: run
/db configure, then retry your request - Connection errors: verify host, port, username, password, and database name
- Permission errors: confirm the account has read access to the tables/collections
- Unexpected results: ask to show the exact query that was run, then refine your request