Description
Thedb command group provides database management and monitoring capabilities for local agent deployments. It includes tools for viewing invocation history, analyzing performance metrics, and maintaining database health.
Subcommands
| Command | Description |
|---|---|
status | Show database status and agent information |
invocations | List agent invocation history |
invocation | View detailed invocation information |
cleanup | Clean up old database records |
runagent db status
Shows comprehensive database status including agent capacity, invocation statistics, and recent activity.
Options
| Option | Description | Default |
|---|---|---|
--agent-id | Show details for specific agent | None |
--capacity | Show detailed capacity information | false |
--cleanup-days | Clean up records older than N days | None |
Examples
runagent db invocations
Lists agent invocation history with filtering and formatting options.
Options
| Option | Description | Default |
|---|---|---|
--agent-id | Filter by specific agent | None |
--status | Filter by status (pending/completed/failed) | None |
--limit | Maximum number of results | 20 |
--format | Output format (table/json) | table |
Examples
runagent db invocation
Displays detailed information about a specific invocation including input/output data, timing, and error details.
Arguments
| Argument | Description | Required |
|---|---|---|
invocation_id | Full or partial invocation ID | Yes |
Options
| Option | Description | Default |
|---|---|---|
--format | Output format (table/json) | table |
Examples
runagent db cleanup
Removes old database records to maintain performance and reduce storage usage.
Options
| Option | Description | Default |
|---|---|---|
--days | Remove records older than N days | 30 |
--agent-runs | Also clean old agent_runs table | false |
--yes | Skip confirmation prompt | false |
Examples
Common Use Cases
Monitor Agent Performance
Debug Failed Invocations
Analyze Agent Usage
Database Maintenance
Database Schema
The database tracks the following key information:- Agents: Deployed agent metadata and statistics
- Invocations: Detailed execution records with timing and I/O data
- Agent Runs: Legacy execution tracking (maintained for compatibility)
- Unique invocation ID
- Input/output data
- Execution timing
- Error details (if failed)
- SDK type and client information
Notes
- All timestamps are in ISO format
- JSON output can be piped to files for further analysis
- Cleanup operations are irreversible - use with caution
- Database is automatically created when first agent is deployed