Minimum requirements to run AgentOffice in development or production.
From installation to your first automatically routed response.
# agents
## builder
Software development specialist. Writes clean code and tests.
Skills: TypeScript, Node.js, software architecture.
## reviewer
Reviews code with a focus on quality, security, and performance.
Skills: code review, static analysis, best practices.
## devops
Infrastructure and deployment automation specialist.
Skills: Docker, Kubernetes, CI/CD, observability.
{
"providers": {
"anthropic": {
"apiKey": "sk-ant-..."
}
},
"extensions": ["agent-office"],
"routing": {
"scorer": "hybrid",
"rerank": false
}
}
The fundamental building blocks that make up AgentOffice.
pi -e extensions/agent-office.ts.
The Pi runtime manages the conversation loop, context, and agent lifecycle.
Configure AgentOffice's behavior via environment variables or .env.
| Variable | Type | Description |
|---|---|---|
| ANTHROPIC_API_KEY | string | Anthropic API key. Required when the selected provider is anthropic. |
| OPENAI_API_KEY | string | OpenAI API key. Used when the alternate provider is openai. |
| PI_NATS_URL | string | NATS server URL (e.g. nats://localhost:4222). Enables P2P transport between instances. |
| PI_NATS_TOKEN | string | Shared token for authenticating against the NATS cluster. Connectivity mode B. |
| QDRANT_URL | string | Qdrant server URL (e.g. http://localhost:6333). Enables QdrantScorer for catalogs with 1000+ agents. |
| ROUTING_RERANK | boolean | Enables the cross-encoder for re-ranking candidates. Increases precision by ~12%, adds ~15ms of latency. |
| OFFICE_PORT | number | REST API port. Default: 3777. |
| OFFICE_PORTAL_PORT | number | Next.js portal port. Default: 3000. |
| OFFICE_MAX_SESSIONS | number | Limit of concurrent sessions per instance. Default: 50. Adjust based on available RAM. |
| OFFICE_SESSION_TTL | number | Expiration time for idle sessions, in seconds. Default: 1800 (30 min). |
| ROUTING_EMBED_MODEL | string | Embedding model for the semantic scorer. Default: text-embedding-3-small. |
| ROUTING_CACHE_TTL | number | TTL of the routing decision cache, in seconds. Default: 300. |
| LOG_LEVEL | string | Log level: error | warn | info | debug. Default: info. |
| METRICS_ENABLED | boolean | Exposes the /metrics endpoint in Prometheus format. Default: true. |
All endpoints accept and return JSON. Streaming routes return text/event-stream.
| Method | Endpoint | Description |
|---|---|---|
| GET | /agents | Lists all available agents with current status and declared capabilities. |
| POST | /message | Sends a message. Returns an SSE stream with the routing decision and the selected agent's response. |
| GET | /agents/:id/status | Current state of an agent: idle | thinking | responding. |
| GET | /stream/:sessionId | Reconnects to the SSE stream of an existing session. Useful for resuming after a dropped connection. |
| POST | /teams | Creates a team of agents with a defined collaboration and orchestration configuration. |
| GET | /teams | Lists all configured teams with members and operating mode. |
| POST | /teams/:id/message | Sends a message to an entire team. Orchestration distributes it to the relevant members. |
| DELETE | /sessions/:id | Ends a session and releases associated resources (context, streaming buffers). |
| GET | /routing/log | Paginated history of routing decisions with scores and metadata for each choice. |
| GET | /routing/log/:id | Full details of a specific decision: candidates, scores, and rationale. |
| POST | /agents/:id/cancel | Cancels an agent's in-progress execution and releases the response token. |
| GET | /metrics | Prometheus endpoint with latency, throughput, and agent utilization metrics. |
| GET | /health | Health check for the Kubernetes liveness probe. Returns 200 OK when the process is healthy. |
| GET | /ready | Readiness probe: confirms the router is initialized and the agents are loaded. |
# Request body
{
"message": "Review PR #42 before it merges",
"sessionId": "ses_abc123", // optional — creates a new one if omitted
"stream": true // returns SSE when true
}
# SSE response
event: routing
data: {"agent":"reviewer","score":0.96,"reason":"code review intent"}
event: delta
data: {"content":"Analyzing PR #42..."}
event: done
data: {"sessionId":"ses_abc123","tokensUsed":312}
From local development to a multi-node, highly available cluster.
services:
agent-office:
image: ghcr.io/your-org/agent-office:latest
ports:
- "3000:3000" # portal
- "3777:3777" # api
- "8787:8787" # coms-net
environment:
ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY}
PI_NATS_URL: nats://nats:4222
QDRANT_URL: http://qdrant:6333
volumes:
- ./AGENTS.md:/app/AGENTS.md:ro
- ./settings.json:/app/settings.json:ro
- ./projects:/app/projects
depends_on: [nats, qdrant]
nats:
image: nats:2.10-alpine
ports: ["4222:4222"]
qdrant:
image: qdrant/qdrant:v1.8.0
ports: ["6333:6333"]
volumes: [qdrant_data:/qdrant/storage]
volumes:
qdrant_data: