Converge is an AI workflow recovery platform built around a strict control plane and evidence-first replay flow.
Target architecture:
- FastAPI control API
- Redis Streams event queue
- Go replay workers
- PostgreSQL claim locking and idempotency state
- Supabase-backed trace and recovery storage
- React dashboard deployed on Vercel
- OpenAI and Gemini judge layer for recovery comparison
- Events are ingested through FastAPI and written with idempotency protection.
- Outbox rows close the DB-commit / Redis-publish gap.
- Go workers claim stream entries, process them, and ack only after database state is committed.
- Trace, eval, and comparison records are persisted in PostgreSQL, which can be pointed at Supabase in production.
- Recovery evidence is surfaced in the React dashboard and benchmark artifacts.
- External judge providers are optional; deterministic local judges remain the default when keys are absent.
flowchart LR
A[Client / AI agent] --> B[FastAPI control API]
B --> C[(PostgreSQL / Supabase)]
B --> D[(Transactional outbox)]
D --> E[Redis Streams queue]
E --> F[Go replay workers]
F --> C
G[Recovery scanner] --> D
H[OpenAI / Gemini judge layer] --> C
I[React dashboard on Vercel] --> B
docker compose up --build -dPorts:
- API:
http://127.0.0.1:8101 - API docs:
http://127.0.0.1:8101/docs - Health:
http://127.0.0.1:8101/health - Frontend:
http://localhost:5171
Backend:
DATABASE_URLpoints to PostgreSQL or Supabase PostgresREDIS_URLpoints to Redis StreamsJUDGE_PROVIDERdefaults toautoOPENAI_API_KEYenables the OpenAI judge providerGEMINI_API_KEYenables the Gemini judge providerOPENAI_JUDGE_MODELdefaults togpt-4o-miniGEMINI_JUDGE_MODELdefaults togemini-1.5-flash
Frontend:
VITE_API_BASE_URLshould be set on Vercel for production- leave
VITE_API_BASE_URLblank for local proxying frontend/vercel.jsonrewrites client routes toindex.html
/landing page/apprecovery console/app/workersworker health and claim state/app/streamsRedis backlog and retry pressure/app/replayDLQ inspection and replay/app/convergenceconvergence verification/app/benchmarksbenchmark explorer/app/ai-runsagent run dashboard/app/ai-runs/:agentRunIdtrace viewer/app/ai-runs/:agentRunId/comparetrace comparison/app/ai-evalseval results/app/architecturesystem architecture
The repo keeps machine-readable benchmark and chaos artifacts under benchmarks/ as JSON only.
| Artifact | Status | Submitted | DLQ | Pending after recovery | Recovery time | Throughput |
|---|---|---|---|---|---|---|
benchmarks/benchmark_replay_20260702T213707Z.json |
converged | 1000 | 0 | 0 | 9.10s | 109.57 events/sec |
benchmarks/chaos_replay_20260701T223433Z.json |
converged | 10 | 0 | 0 | 3.82s | 2.62 events/sec |
The UI reads these JSON artifacts directly. Markdown benchmark/postmortem outputs have been removed from the repository.
Relevant trace and evaluation fields:
agent_run_idstep_idparent_step_idtool_namemodel_nameprovider_nameprompt_hashsystem_prompt_hashinput_tokensoutput_tokensretry_reasontrace_statusevaluation_statusreplay_confidenceoriginal_output_hashreplayed_output_hashtool_call_args_hashtool_call_result_hashstructured_output_validfailure_category
- The API accepts a workflow event or AI step.
- The event and outbox row are written in PostgreSQL in one transaction.
- Redis Streams receives the event, or the outbox recovery path republishes it later.
- Go workers claim the stream message and write claim / attempt state to the database.
- Pending entries are reclaimed by the worker janitor.
- DLQ items can be replayed by an operator.
- Trace comparison and judge-backed evaluation run against original and replayed outputs.
- Convergence is reported only when database, Redis, and worker state are clean.
- Deterministic exact-match, schema, rubric, and fake-LLM judges are available locally.
- OpenAI and Gemini judges are enabled only when their API keys are present.
- The provider endpoint reports the active provider, model, and whether the source is local or external.
- The dashboard shows provider fallback and trace comparison output alongside the replay confidence score.
Backend:
pytest -q api/app/tests/test_ai_ops.py
pytest -q api/app/tests/test_event_ingestion.py api/app/tests/test_replay.py api/app/tests/test_convergence.py
python -m compileall api/app scriptsFrontend:
cd frontend
npm run buildGo worker:
cd worker
go test ./...Compose validation:
docker compose configBenchmark and chaos:
python scripts/benchmark_replay.py --events 1000 --workers 2 --mode generic
python scripts/benchmark_replay.py --events 1000 --workers 2 --mode ai-agent --eval-enabled --trace-comparison-enabled
python scripts/chaos_replay.py --events 10 --workers 2 --kill-delay 2Generated benchmark and postmortem commands now emit JSON artifacts only.
- Legacy markdown documentation has been removed everywhere except this README.
- The repo still supports local Docker Compose development.
- Supabase is the intended managed Postgres target for production trace and recovery state.
- Vercel is the intended deployment target for the React dashboard.