Databases
Snippbot uses SQLite for all persistence. No external database server is required. This page covers file locations, backup, and maintenance. For schema details, see Database Architecture.
Database files
Section titled “Database files”All databases live under the data directory (~/.snippbot/ by default):
| File | Contents |
|---|---|
main.db | Agents, projects, tasks, chat sessions |
scheduler.db | Scheduled jobs, runs, chains, activity patterns |
workflows.db | Workflow definitions, runs, templates, schedules |
hooks.db | Event hooks, deliveries, webhook endpoints |
channels.db | Platform credentials (encrypted), bindings, access rules |
skills.db | Tool registry, MCP server configurations |
devices.db | Device registrations, pairing codes, execution history |
| profile_settings.db | User profile (name, avatar, timezone) |
| agents/{id}/memory.db | Per-agent episodic memory and knowledge graph |
Changing the data directory
Section titled “Changing the data directory”# Via environment variableexport SNIPPBOT_DATA_DIR=/data/snippbotsnippbot start
# Via config filesnippbot config set data_dir /data/snippbotAll database files move with the data directory. You’ll need to copy existing data manually if migrating.
Backup
Section titled “Backup”Automatic backups
Section titled “Automatic backups”Snippbot creates automatic backups before running database migrations:
~/.snippbot/backups/├── pre-upgrade-2026-03-01T10-00-00/│ ├── main.db│ ├── scheduler.db│ └── ...└── pre-upgrade-2026-02-15T08-30-00/ └── ...Manual backup
Section titled “Manual backup”# List existing backupssnippbot reset --list-backups
# Or copy the directory directlycp -r ~/.snippbot ~/.snippbot.bakRestore from backup
Section titled “Restore from backup”# List available backupssnippbot reset --list-backups
# Restore a backupsnippbot stopsnippbot reset --restore pre-upgrade-2026-03-01T10-00-00snippbot startAutomated backup schedule
Section titled “Automated backup schedule”Use a system cron job to back up regularly:
# Backup daily at 2am0 2 * * * cp -r ~/.snippbot ~/.snippbot.backup.$(date +%Y%m%d) 2>/dev/null
# Keep only last 7 backups0 3 * * * ls -dt ~/.snippbot.backup.* | tail -n +8 | xargs rm -rf 2>/dev/nullMaintenance
Section titled “Maintenance”Vacuuming databases
Section titled “Vacuuming databases”SQLite databases can grow with deleted rows. Vacuum them periodically:
sqlite3 ~/.snippbot/snippbot.db "VACUUM;"sqlite3 ~/.snippbot/scheduler.db "VACUUM;"This compacts the files and reclaims disk space. Database maintenance such as pruning old data is handled automatically by Snippbot.
WAL mode
Section titled “WAL mode”All databases use SQLite WAL (Write-Ahead Logging) for performance:
- Concurrent reads are non-blocking (readers don’t block writers)
- Writes are fast (no full journal flush on each write)
- Data integrity is maintained on crash/power loss
WAL checkpoint files (.db-wal, .db-shm) are normal and should be included in backups.
Custom data directory
Section titled “Custom data directory”Change the data directory to a mounted volume for Docker or NFS:
snippbot config set data_dir /mnt/data/snippbotMake sure the directory is writable by the user running the daemon.
For Docker, the typical configuration mounts the host path:
volumes: - ~/.snippbot:/home/snippbot/.snippbotSee Docker deployment for the full compose configuration.
Opening databases directly
Section titled “Opening databases directly”All databases are standard SQLite files. You can query them with any SQLite tool:
# Using sqlite3 CLIsqlite3 ~/.snippbot/scheduler.db "SELECT name, status, run_count FROM scheduled_jobs;"
# Using DB Browser for SQLite (GUI)# Open any .db file from ~/.snippbot/