PostgreSQL is the agent's brain. This page covers schema management, applying changes, and resetting.
hexis doctor # check DB health
hexis reset # wipe and re-initialize (interactive confirmation)Schema files live in db/*.sql and are applied on fresh database initialization. They are baked into the Docker image at build time (not bind-mounted).
Editing SQL files on disk does NOT automatically affect the running container. To apply changes:
docker compose down -v # stop + remove data volume
docker compose build db # rebuild image with new SQL
docker compose up -d # start with new schemaNote: down -v destroys all data. Export anything you need first.
hexis reset # interactive confirmation
hexis reset --yes # skip confirmation (CI/scripts)This removes the data volume and re-initializes from db/*.sql.
# Check if a function exists
docker exec hexis_brain psql -U hexis_user -d hexis_memory -c "\df function_name"
# Check config keys
docker exec hexis_brain psql -U hexis_user -d hexis_memory -c "SELECT key, value FROM config WHERE key LIKE 'rlm.%'"
# Check table columns
docker exec hexis_brain psql -U hexis_user -d hexis_memory -c "SELECT column_name FROM information_schema.columns WHERE table_name = 'memories' ORDER BY ordinal_position"| Name | Context |
|---|---|
db |
Docker Compose service name (use with docker compose) |
hexis_brain |
Docker container name (use with docker exec) |
docker compose build db # correct
docker exec hexis_brain psql -U hexis_user -d hexis_memory # correct| Parameter | Default |
|---|---|
| Host | 127.0.0.1 |
| Port | 43815 (mapped to internal 5432) |
| Database | hexis_memory |
| User | hexis_user |
| Password | hexis_password |
DSN: postgresql://hexis_user:hexis_password@127.0.0.1:43815/hexis_memory
PostgreSQL extensions used by Hexis:
| Extension | Purpose |
|---|---|
pgvector |
Vector similarity search for embeddings |
age (Apache AGE) |
Graph database for memory relationships |
btree_gist |
GiST index support for range types |
pg_trgm |
Trigram text similarity for fuzzy search |
# Interactive psql
docker exec -it hexis_brain psql -U hexis_user -d hexis_memory
# Run a query
docker exec hexis_brain psql -U hexis_user -d hexis_memory -c "SELECT * FROM memory_health"- Database API -- SQL function reference
- Database Schema -- table reference
- Environment Variables -- DB connection config
- Troubleshooting -- database connection issues