AI Agent Database Workbench — Query Your Agent Data with SQL (2026)
Every session, board issue, note, schedule, and CRM contact amux manages lives in a local SQLite database. The Database tab puts a full SQL workbench on top of it — schema browser, query editor, results table. Updated July 2026.
~/.amux/amux.db. The Database tab in the amux dashboard gives you a full SQL workbench to query it directly: find stuck tasks, count sessions by provider, or pull a weekly activity report. No external tool required.
What Data amux Stores
Every action amux takes — starting a session, creating a board issue, saving a note, sending an email — writes to ~/.amux/amux.db. The database is the single source of truth for your entire AI engineering operation. Key tables:
| Table | What it stores | Key columns |
|---|---|---|
sessions |
All agent sessions ever started | name, status, description, project, provider, created_at |
board_issues |
Kanban board items (todo/doing/done) | title, status, session, desc, tags, created, updated |
notes |
Notes and documents (plain text or HTML) | slug, title, content, created_at, updated_at, trashed |
crm_contacts |
CRM contacts — people and companies | name, company, email, role, phone, notes |
crm_interactions |
CRM interaction log (calls, emails, meetings) | contact_id, type, notes, date |
schedules |
Recurring scheduled tasks | title, session, command, schedule_expr, last_run, next_run, enabled |
cal_events |
Calendar events (exported to iCal) | title, start, end, all_day, description |
How to Use the Database Tab
- Open the amux dashboard at
https://localhost:8822(or the iOS app). - Click the Database tab in the top tab bar. You will see a schema browser panel on the left showing all tables and their columns.
- Browse the schema by clicking any table name — the editor pre-fills a
SELECT * FROM <table> LIMIT 50and runs it immediately. - Write your SQL in the query editor. Click Run or press Ctrl+Enter (Cmd+Enter on macOS). Results appear in the table below with column headers, row count, and execution time.
- Export results by selecting and copying rows from the result table, or use the sqlite3 CLI for bulk CSV export.
10 Power Queries for Your AI Engineering Team
Copy these directly into the Database tab query editor:
1. Which agents ran the most sessions this week?
SELECT session, COUNT(*) AS runs
FROM sessions
WHERE created_at > datetime('now', '-7 days')
GROUP BY session
ORDER BY runs DESC;
2. What tasks have been stuck in "doing" for more than 24 hours?
SELECT title, session, created
FROM board_issues
WHERE status = 'doing'
AND created < datetime('now', '-1 day')
ORDER BY created ASC;
3. How many sessions per AI provider?
SELECT provider, COUNT(*) AS total
FROM sessions
GROUP BY provider
ORDER BY total DESC;
4. Board items completed per session this month
SELECT session, COUNT(*) AS completed
FROM board_issues
WHERE status = 'done'
AND updated > datetime('now', 'start of month')
GROUP BY session
ORDER BY completed DESC;
5. All sessions with an error or failed status
SELECT name, status, description, created_at
FROM sessions
WHERE status IN ('error', 'failed', 'crashed')
ORDER BY created_at DESC
LIMIT 20;
6. CRM contacts added this month
SELECT name, company, email, created_at
FROM crm_contacts
WHERE created_at > datetime('now', 'start of month')
ORDER BY created_at DESC;
7. Schedule run frequency — how often does each schedule fire?
SELECT title, schedule_expr, last_run, next_run, enabled
FROM schedules
ORDER BY next_run ASC;
8. Notes created recently
SELECT slug, title, created_at, updated_at
FROM notes
WHERE trashed = 0
ORDER BY updated_at DESC
LIMIT 20;
9. Active sessions right now
SELECT name, status, description, project, provider
FROM sessions
WHERE status = 'active'
ORDER BY created_at DESC;
10. Sessions grouped by project
SELECT project, COUNT(*) AS session_count,
SUM(CASE WHEN status='active' THEN 1 ELSE 0 END) AS active_now
FROM sessions
WHERE project IS NOT NULL
GROUP BY project
ORDER BY session_count DESC;
Database Workbench vs Alternatives
| Method | Setup | Live agent data | Built-in dashboard | Mobile access |
|---|---|---|---|---|
| amux Database tab | Zero — built-in | Yes | Yes — same window as sessions | Yes — iOS app + PWA |
| sqlite3 CLI | Built into macOS/Linux | Yes | No — terminal only | No |
| Datasette | pip install + run separate server | Yes (read-only by default) | Yes — separate web UI | Via browser |
| TablePlus / DB Browser | Download + install GUI app | Yes (refresh manually) | Separate app window | No |
| No visibility | None | No | No | No |
Backup Your Agent Database
amux.db uses SQLite WAL mode for durability, but a nightly backup is good practice — especially if you are storing CRM relationships, research notes, and board history built up over months. Use the sqlite3 CLI backup command:
# One-time backup
sqlite3 ~/.amux/amux.db ".backup ~/.amux/amux-backup-$(date +%Y%m%d).db"
# Schedule via amux (runs nightly at 2am on any registered session)
curl -sk -X POST https://localhost:8822/api/schedules \
-H 'Content-Type: application/json' \
-d '{
"title": "Nightly amux.db backup",
"session": "your-session",
"command": "sqlite3 ~/.amux/amux.db \".backup ~/.amux/amux-backup-$(date +%Y%m%d).db\"",
"schedule_expr": "daily at 2am"
}'
Frequently Asked Questions
Where is amux.db located?
amux.db lives at ~/.amux/amux.db on your machine. It is a standard SQLite 3 database. You can open it with any SQLite client (sqlite3 CLI, DB Browser for SQLite, TablePlus) in addition to the built-in Database tab in the amux dashboard.
Can I modify data via the Database tab?
The Database tab supports any SQL statement — SELECT, INSERT, UPDATE, DELETE, and DDL. For read-only analysis, stick to SELECT queries. Modifying data directly bypasses amux's API layer and may break application invariants (for example, session status fields that trigger the self-healing watchdog). Use the amux REST API or board UI for writes where possible; use the Database tab for ad-hoc queries and reporting.
Is the Database tab read-only?
No — you can run any SQL statement. The tab does not enforce read-only mode. Treat it like a direct sqlite3 connection: powerful for queries and reporting, but use with care for writes that could affect running sessions.
What happens if amux.db gets corrupted?
amux.db uses SQLite WAL (write-ahead log) mode for durability. In practice, corruption is rare and occurs only on abrupt power loss during a write. To protect data: run sqlite3 ~/.amux/amux.db '.backup ~/.amux/amux-backup.db' periodically, or pipe the backup command into the amux scheduler to run nightly automatically.
Can I export query results from the Database tab?
Yes. The results table in the Database tab supports copying selected rows. For bulk export, use the sqlite3 CLI: sqlite3 ~/.amux/amux.db -csv 'SELECT * FROM board_issues WHERE status="done"' > done-issues.csv — or use the amux board REST API which returns JSON directly.
Beyond the Database — What the API Gives You
The amux REST API exposes all the same data with richer filtering, pagination, and write support. For quick ad-hoc exploration, the Database tab is fastest. For building integrations (n8n workflows, scripts, dashboards), the API is the right layer:
# Board issues — filtered, paginated, JSON
curl -sk https://localhost:8822/api/board?status=done&since=2026-07-01
# Sessions list
curl -sk https://localhost:8822/api/sessions
# CRM contacts
curl -sk https://localhost:8822/api/crm/contacts
# Schedules
curl -sk https://localhost:8822/api/schedules
Full visibility into your AI engineering team
amux is an open-source control plane for AI agent teams. Every session, task, note, and contact in one SQLite database — with a built-in SQL workbench, kanban board, and phone dashboard. Self-healing, single Python file, zero external dependencies.
git clone https://github.com/mixpeek/amux && cd amux && ./install.sh
amux register myproject --dir ~/Dev/myproject --yolo
amux start myproject
# Open https://localhost:8822 → Database tab
View on GitHub
Getting started →
Related: Agent coordination · Agent fleet operations · Scheduling AI agents · All guides →