[T3] PostgreSQL database for shared state #6

Open
opened 2026-05-21 13:05:21 +00:00 by kaykayyali · 0 comments
Owner

Goal

Replace per-agent JSON files with a shared PostgreSQL database so all agents see the same project state.

Implementation

  1. Add Postgres service to docker-compose.yml
  2. Create schema migration file: db/schema.sql
    • projects table (id, name, status, created_at, ...)
    • deliverables table (id, project_id, agent, type, status, ...)
    • decisions table (id, project_id, decided_by, decision, ...)
    • conversations table (id, thread_id, participants, ...)
  3. Add db/connection.py — singleton connection manager, used by all agents
  4. Replace self._load_state() / self._save_state() in BaseAgent with DB calls
  5. Add ProjectManager class that provides:
    • create_project(name)
    • get_project_status(project_id)
    • update_project_phase(project_id, phase)
    • list_active_projects()
  6. All agents write to the same database — VP gets instant visibility into all work

Files

  • docker-compose.yml — add postgres service
  • db/schema.sql — new
  • db/connection.py — new
  • db/project_manager.py — new
  • agents/base_agent.py — replace JSON state with DB

Acceptance

  • VP can query project_manager.list_active_projects() and see all work
  • Engineer marks deliverable as "done" → VP instantly sees it
  • Database survives container restarts (volume mount)
## Goal Replace per-agent JSON files with a shared PostgreSQL database so all agents see the same project state. ## Implementation 1. Add Postgres service to docker-compose.yml 2. Create schema migration file: `db/schema.sql` - `projects` table (id, name, status, created_at, ...) - `deliverables` table (id, project_id, agent, type, status, ...) - `decisions` table (id, project_id, decided_by, decision, ...) - `conversations` table (id, thread_id, participants, ...) 3. Add `db/connection.py` — singleton connection manager, used by all agents 4. Replace `self._load_state()` / `self._save_state()` in BaseAgent with DB calls 5. Add `ProjectManager` class that provides: - `create_project(name)` - `get_project_status(project_id)` - `update_project_phase(project_id, phase)` - `list_active_projects()` 6. All agents write to the same database — VP gets instant visibility into all work ## Files - `docker-compose.yml` — add postgres service - `db/schema.sql` — new - `db/connection.py` — new - `db/project_manager.py` — new - `agents/base_agent.py` — replace JSON state with DB ## Acceptance - VP can query `project_manager.list_active_projects()` and see all work - Engineer marks deliverable as "done" → VP instantly sees it - Database survives container restarts (volume mount)
kaykayyali added this to the v2.0 Tier 3 — Project State & Management milestone 2026-05-21 13:05:21 +00:00
This repo is archived. You cannot comment on issues.
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kaykayyali/damascus-frontier#6