multi-agent-discuss README

The project's README from github.com/sjc88661/multi-agent-discuss. As one markdown file: README.md.

Multi-Agent Workbench

A local-first control room for orchestrating multiple coding agents as one disciplined team.

Status TypeScript Fastify React Node.js Tests License: MIT

Run one agent, you get a chatbot. Put several agents with real roles in the same room — and gate their actions behind your decisions — you get a team. Multi-Agent Workbench is the room.


The Problem

CLI coding agents are powerful, but each one is a lonely terminal: you prompt, it works, you review, repeat. Chaining them means copy-pasting context, losing track of who decided what, and trusting an agent to edit your repository without any guardrails.

Multi-Agent Workbench turns that into a structured collaboration system:

Local-first by design: no accounts, no cloud, no telemetry. It runs on your machine, against your project, with files you can read.


What's in the Box

Capability Status Details
🗣️ Task Rooms ✅ shipped Browser-based rooms with goal, members, timeline, decisions, approvals, artifacts
🤖 Persistent PTY agents ✅ shipped Long-lived agent sessions that survive UI refreshes, with status tracking and raw terminal logs
🧩 Agent-agnostic adapters ✅ shipped generic-pty, codex-cli, claude-cli with automatic command discovery; registry extensible via a documented interface
👥 Role cards & task templates ✅ shipped Human-readable YAML files — 6 roles, 4 templates, editable and versionable
⚙️ Orchestrator with decision gates ✅ shipped Rule-driven engine raises blocking decision requests before execution; pluggable strategy layer
🛡️ Risk-based approvals ✅ shipped Low/medium/high risk classification with approve / reject / modify resolution and full history
🌳 Worktree isolation & diff review 🔶 in progress One git worktree per executing agent, diff-stat scanning, patch/merge review flow
📦 Durable artifacts ✅ shipped Markdown task reports, decision logs, patches — written as readable files, not just database rows
⚡ Real-time updates ✅ shipped SSE event streaming from the backend to every open room
🔍 Event sourcing ✅ shipped 23 event types, projected into timeline, decisions, terminals, artifacts, and diff views

Architecture

A local event-driven stack. The browser never touches a PTY directly — every action goes through the API, is recorded as an event, and is projected into views.

flowchart LR
    subgraph Browser
        UI[React Workbench UI]
    end

    subgraph Server["Fastify Backend (127.0.0.1:3020)"]
        API[REST API]
        SSE[SSE Realtime Broker]
        ORCH[Orchestrator Engine]
        SESS[PTY Session Manager]
        ADAPT[Agent Adapter Registry]
        APPR[Approval Service]
        WORK[Worktree Manager]
        ART[Artifact Service]
        CFG[Role & Template Registries]
    end

    DB[(SQLite Event Store)]
    PTY[Persistent PTY Processes]
    WT[Isolated Git Worktrees]
    FILES[Markdown Artifacts]

    UI <--> API
    UI <--> SSE
    API <--> DB
    API <--> CFG
    SSE <--> DB
    ORCH --> SESS
    SESS --> ADAPT
    ADAPT --> PTY
    PTY --> DB
    ORCH <--> APPR
    APPR <--> UI
    WORK --> WT
    WORK --> DB
    ART --> FILES
    ART --> DB

Why event sourcing?

The event log is the single source of truth. Raw PTY output, agent messages, decisions, approvals, worktree updates, and artifacts are all append-only events. The UI state you see — the chat timeline, the pending decisions, the terminal drawers — is derived, not stored. That gives you:


Agent Compatibility

Adapters turn wildly different agent systems into one common interface: start command, input formatting, output parsing, capabilities, and lifecycle.

Adapter Agent Kind Maturity Notes
generic-pty Any terminal CLI pty-cli ✅ MVP Configure any command; use for scripts, fake agents, or CLIs without a dedicated adapter
codex-cli Codex CLI pty-cli ✅ MVP Auto-discovers codex/codex.exe; structured <agent-message> output
claude-cli Claude Code pty-cli ✅ MVP Auto-discovers claude/claude.exe; structured <agent-message> output
glm-cli GLM CLI pty-cli 🗓️ Planned Waiting on a stable local command and IO contract
cursor-agent Cursor-style agents editor-bridge 🗓️ Planned Requires a local bridge contract
harness-agent Harness-style agents cloud-api 🗓️ Planned Requires API credentials and a remote lifecycle model

Adapters declare capabilities honestly — including that approval interception is not yet a complete sandbox. Isolation, audit logs, and visible terminal output are the current safeguards. Full details in docs/agent-compatibility-matrix.md.


Roles, Templates, and Structured Speech

Agents don't free-chat into the void. They speak a structured protocol — group-chat for humans, typed events for the platform:

<agent-message intent="proposal">
We should extract the adapter registry behind an interface before adding the GLM adapter.
</agent-message>

Role cards are plain YAML with real permissions:

id: reviewer
name: Reviewer
description: Finds risks, contradictions, missing tests, and unsafe assumptions.
permissions:
  can_edit_files: false
  can_request_decision: true
  can_execute_commands: false
speaking:
  default_intents: ["critique", "risk", "question"]
  verbosity: concise

Six roles ship out of the box — Orchestrator, Architect, Implementer, Reviewer, Researcher, Summarizer — plus four task templates: Architecture Design, Code Implementation, Code Review, and Research Discussion. Because everything is YAML, you can version your team's roles like code.


Quick Start

Prerequisites: Node.js 20+, npm, and (optionally) a real CLI agent such as Codex CLI or Claude Code.

# 1. Install dependencies
npm install

# 2. Start the backend (Fastify API on 127.0.0.1:3020)
npm run dev

# 3. In a second terminal, start the web app (Vite on 127.0.0.1:5173)
npm run dev:web

Open http://127.0.0.1:5173 and:

  1. Create a task with the Architecture Design template.
  2. Open the task room and pick an adapter preset from the runtime panel.
  3. Start an agent — try a Generic PTY command that prints <agent-message intent="status">Ready</agent-message> for a zero-dependency smoke test.
  4. Watch its messages land in the timeline; drill into raw output in its terminal drawer.
  5. Trigger a decision request, resolve it, then generate the task report and check .multi-agent/tasks/<task-id>/report.md.

For real agents, read docs/adapter-runtime-local-setup.md first — the workbench provides worktree-friendly runtime controls and visible logs, not a complete command sandbox.

Development commands

npm test           # Vitest across the workspace
npm run typecheck  # tsc project references across server, web, shared
npm run build      # production build of all workspaces

Repository Layout

multi-agent-workbench/
├── apps/
│   ├── server/            # Fastify API, event store, PTY runtime, orchestrator, approvals
│   └── web/               # React + Vite workbench UI
├── packages/
│   └── shared/            # @maw/shared — event protocol, projections, API types (single source of truth)
├── docs/
│   ├── superpowers/       # design spec & MVP implementation plan
│   ├── agent-compatibility-matrix.md
│   ├── adapter-development.md
│   └── adapter-runtime-local-setup.md
└── .multi-agent/          # role cards, task templates (runtime data is gitignored)

Server modules — EventStore · TaskRoomService · SessionManager · AgentRegistry · RoleRegistry · TemplateRegistry · OrchestratorEngine · ApprovalService · WorktreeManager · ArtifactService · SseBroker

UI views — Task List · Create Task · Task Room · Agent Roster · Message Timeline · Decision Panel · Approval Panel · Terminal Drawer · Artifact Panel · Diff Review


Roadmap


Documentation


License

Released under the MIT License — an OSI-approved permissive license. You are free to use, modify, and distribute this project for any purpose, including commercial, as long as the copyright notice is preserved.

Copyright (c) 2026 sjc88661

multi-agent-discuss (sjc88661/multi-agent-discuss)

Searching Database…

这是什么?Multi-Agent Workbench 是一个本地优先的控制室,用于让多个编程 agent(如 Claude Code 和 Codex CLI)在明确的角色下协同运行,执行有风险的操作之前需要你的批准。
这是我要导入的库,还是要运行的应用?它是一个开箱即用的本地 Web 应用:一个 Node.js 服务器加浏览器界面,不是要导入你自己代码的库或 SDK。
怎么让它跑起来?安装 Node.js 20+ 和 npm,运行服务器和 web 开发脚本(`npm run dev -w apps/server`、`npm run dev:web`),然后打开应用,用内置模板之一创建一个任务房间来启动 agent。
需要先准备 API 密钥或安装编程 agent 吗?不需要账号或 API 密钥,因为一切都在本地运行。要编排真实的 agent,需要安装 Codex CLI 或 Claude Code,你也可以用一个零依赖的通用 PTY 命令来测试流程。
它能完全沙箱化 agent 对我仓库的操作吗?还不完全——适配器坦率承认审批拦截并不是完整的沙箱,而带 diff 审查的每 agent git worktree 隔离在路线图上仍标记为“进行中”。
我的代码和聊天数据会去哪里?哪里都不去,只留在你的机器上:没有账号、没有云同步、也没有遥测——事件日志保存在本地 SQLite 存储中,agent 在本地 git worktree 中工作。
现在实际能接入哪些编程 agent?通用 PTY 命令行工具、Codex CLI 和 Claude Code(通过 claude-cli)目前已随项目发布且可用。GLM CLI、Cursor 风格的编辑器桥接和 Harness 风格的云端 agent 已列入计划,但尚未提供。
为什么把一切都记录为事件,而不用普通数据库?只追加的事件日志是唯一的真相来源,它提供完整的审计轨迹、通过重放日志实现的崩溃恢复,并把嘈杂的原始终端输出与可读的聊天时间线分开。
我可以给 agent 分配哪些角色?开箱即带六个角色——Orchestrator、Architect、Implementer、Reviewer、Researcher 和 Summarizer——每个角色都定义成一张可编辑、可纳入版本控制的 YAML 角色卡,并带有真实权限。
我的文件如何免受行为异常 agent 的破坏?编写代码的 agent 在隔离的 git worktree 中工作,它们的更改只能通过由基于风险的审批(批准、拒绝或修改)把关的审查流程,才能进入你的主工作区。
Creator
sjc88661
Size
0.2 MB
Stars
213
Updated
CommitSep 10
Age
2mo
Commits · 90 Days