Agent Council is a multi-agent decision workspace where several AI agents debate a question, critique each other, and converge on a final recommendation.
It includes:
- a Next.js frontend for configuring debates and visualizing debate graphs
- a Hono + TypeScript backend that orchestrates debate phases and streams events
- Postgres persistence (via Drizzle ORM) for debates, branches, nodes, edges, and runs
- Contributors who want to build or extend the system
- Developers who want to try structured multi-agent debates locally
- Anyone evaluating this project as a prototype for orchestrated agent workflows
- Configure a debate with multiple agents (model + personality per agent)
- Orchestrator-driven debate phases (instead of uncontrolled free chat)
- Streamed debate output via SSE
- Lane-aware graph view of message nodes and relationships
- ELK-based graph layout for cleaner node placement
- Bottom tabbed workspace for node details, including tab movement and reordering
- Debate sidebar with loading and error states
- User interventions during a run
- Regeneration from a specific node into a new branch
- Personality preset and custom personality management
- Model catalog browsing with pricing estimation and session usage tracking
- Frontend: Next.js (App Router), React, TypeScript, Tailwind, shadcn/ui
- Backend: Hono, TypeScript, Node.js, Drizzle ORM
- Database: Postgres
- Model providers: OpenRouter
agent-counsil/
├── frontend/ # Next.js app (UI)
├── backend/ # Hono API + orchestrator + DB layer
├── docs/ # Feature-specific documentation
├── SPEC.md # Current UX/implementation spec notes
├── prd.md # Product requirements document
└── render.yaml # Render deployment config (backend)
The root README stays intentionally short. For feature-specific details, start here:
- Documentation index
- Graph layout and lane mapping
- Bottom tabbed workspace
- Sidebar, debate switching, and model usage
- Node.js 18+
- npm
- A running Postgres database
cd backend
npm installCreate backend/.env with at least:
DATABASE_URL=postgres://USER:PASSWORD@HOST:5432/DB_NAME
DRIZZLE_DATABASE_URL=postgres://USER:PASSWORD@HOST:5432/DB_NAME
# Required model provider
OPENROUTER_API_KEY=sk-or-...
# Optional runtime config
PORT=3001Then run:
npm run db:push
npm run devBackend default URL: http://localhost:3001
In a second terminal:
cd frontend
npm installCreate frontend/.env.local:
NEXT_PUBLIC_API_BASE_URL=http://localhost:3001Then run:
npm run devFrontend default URL: http://localhost:3000
DATABASE_URL(required): runtime DB connectionDRIZZLE_DATABASE_URL(required fornpm run db:push): migration/schema push connectionOPENROUTER_API_KEY(required): enables OpenRouter-backed modelsPORT(optional): backend port (defaults to3001)OPENROUTER_REFERER(optional): OpenRouter request header overrideOPENROUTER_TITLE(optional): OpenRouter request header override
NEXT_PUBLIC_API_BASE_URL(optional): API base URL (defaults tohttp://localhost:3001)
Base URL: http://localhost:3001
GET /healthGET /api/modelsGET /api/personalitiesPOST /api/personalitiesPATCH /api/personalities/:idDELETE /api/personalities/:idPOST /api/debatesGET /api/debatesGET /api/debates/:idGET /api/debates/:id/graphPOST /api/debates/:id/startPOST /api/debates/:id/continuePOST /api/debates/:id/intervenePOST /api/debates/:id/finalizePOST /api/debates/nodes/:nodeId/regeneratePOST /api/debates/:id/branches/:branchId/activateGET /api/stream/:id/stream(SSE)
- Fork or branch from
main. - Install dependencies in both
backend/andfrontend/. - Run backend + frontend locally and verify core flows (create debate, start debate, receive streamed messages, view graph updates).
- Open a PR with a short change summary and any setup notes.
DATABASE_URL environment variable is required- Ensure
backend/.envexists and includesDATABASE_URL.
- Ensure
db:pushfails due to missing URL- Set
DRIZZLE_DATABASE_URLinbackend/.env.
- Set
- Frontend cannot reach backend
- Check
NEXT_PUBLIC_API_BASE_URLand confirm backend is running.
- Check
- CORS errors from non-localhost origin
- Current backend CORS policy explicitly allows localhost/127.0.0.1 origins.
Prototype in active development. Expect breaking changes in API shape and UI behavior as debate orchestration and workspace UX continue to evolve.