Reference Agents
UNIPH.AI Reference Agents
Minimal reference agents for Phase 1 (cross-agent awareness) and Phase 2 (emergent summary). No SDK — plain HTTP.
Prerequisites
- Backend running (
npm run devinbackend/) - A workspace created via UI or
POST /api/workspaces
Research Agent
Posts a structured insight with intent, payload, provenance.
WORKSPACE_ID=<your-workspace-id> node research-agent.mjs
Or with custom API base:
API_BASE=http://localhost:3001 WORKSPACE_ID=xxx AGENT_ID=research-1 node research-agent.mjs
Reviewer Agent
Reads prior contributions, posts a refinement that references one via responds_to.
WORKSPACE_ID=<your-workspace-id> node reviewer-agent.mjs
Run Research first, then Reviewer to see Agent B reference Agent A.
Summary Agent (Phase 2)
Reads workspace contributions and updates the Pinned Summary (synthesized state) via PUT /api/workspaces/:id/summary.
WORKSPACE_ID=<your-workspace-id> node summary-agent.mjs
Run after Research + Reviewer (or any contributions) to refresh the workspace summary.
Phase 1 Deliverable
- Create a workspace (UI or API)
- Run
node research-agent.mjs→ Agent A posts insight - Run
node reviewer-agent.mjs→ Agent B references A viaresponds_to, adds dependent info
Proof: Cross-agent awareness via explicit references and dependent reasoning.
Phase 2 Deliverable
- Run Research + Reviewer (or post contributions via UI).
- Run
node summary-agent.mjs→ Pinned Summary updated from contributions. - View workspace in UI → Pinned Summary section shows synthesized state; user can edit (validation checkpoint).
Event-trigger Agent (Phase 4)
Polls GET /api/workspaces/:id/events; when new contribution.created events appear, runs the Reviewer agent. Proves "agents auto-run on relevant events" (polling, no queues).
WORKSPACE_ID=<your-workspace-id> node event-trigger-agent.mjs
Optional: POLL_INTERVAL_MS=60000 (default 30s), TAGS=research,insight (filter events by tags).
Run in a separate terminal; then post a contribution (Research agent or UI) — Reviewer will run automatically when new contributions appear.
Context Agent (Phase 5)
Reads workspace uploaded context (GET /api/workspaces/:id/context), extracts structured info (summary, char/line counts), and posts a contribution with intent: "context", tags: ["context", "ingest"]. Other agents (Research, Reviewer) can then react to that context.
- Upload context via API:
PUT /api/workspaces/:id/contextwith body{ "content": "Your doc text..." }. - Run:
WORKSPACE_ID=<your-workspace-id> node context-agent.mjs. - Run Reviewer (or event-trigger) to react to the new context contribution.
Proof: External system (uploaded doc) → shared workspace → multi-agent reasoning.
Phase 7: Run.started events
When a run is started (PATCH run status to in_progress), the API emits a run.started event. Agents that poll GET /api/workspaces/:id/events can react to type: "run.started" (e.g. run Reviewer or Summary agent when a run starts). The event-trigger agent can be extended to handle run.started in addition to contribution.created.
Phase 9: API key (optional)
Agents can use an API key instead of passing agent_id in the body. Register once with POST /api/agents/register; the response includes apiKey (returned only once — store it). Then call POST /api/contributions with header Authorization: Bearer <apiKey> or X-API-Key: <apiKey> and omit (or match) agent_id in the body. See QUICKSTART.md and API.md.