Octopus
Monitoring Multi-Agent Flows
The AgentMonitor micro-frontend provides real-time and historical visibility into multi-agent flows — which agents were invoked, what each returned, routing decisions, handoff events, and timing data.
AgentMonitor Overview
AgentMonitor (accessible at /octopus/monitor) gives platform administrators a live view of all active conversations and a searchable history of completed ones. For multi-agent flows, it shows the full routing path for each conversation.
Conversation Trace
Each conversation generates a structured trace. For multi-agent flows, the trace shows a timeline of which agents participated:
public class ConversationTrace
{
public Guid ConversationId { get; set; }
public List<AgentTurnTrace> Turns { get; set; }
}
public class AgentTurnTrace
{
public Guid AgentId { get; set; }
public string AgentName { get; set; }
public string UserMessage { get; set; } // message received by this agent
public string Response { get; set; }
public List<ToolCallTrace> ToolCalls { get; set; }
public RoutingDecisionTrace? RoutingDecision { get; set; }
public TimeSpan Duration { get; set; }
public int InputTokens { get; set; }
public int OutputTokens { get; set; }
}
public class RoutingDecisionTrace
{
public string Strategy { get; set; } // "Embedding", "LLM", "Keyword"
public Guid TargetAgentId { get; set; }
public float Confidence { get; set; }
public string Reason { get; set; }
}
Key Metrics to Monitor
| Metric | What to Watch For | Action |
|---|---|---|
| Routing confidence | Consistently below threshold (many fallbacks to default) | Add intent examples, tune routing strategy |
| Handoff rate | High % of conversations involving handoffs | Verify routing keywords/embeddings are accurate |
| Specialist response latency | One specialist much slower than others | Check its tool calls, memory retrieval, LLM config |
| Token usage per team | Unexpectedly high — may signal context bloat | Reduce MaxHandoffHistoryMessages, enable pruning |
Real-Time Monitoring
AgentMonitor subscribes to Octopus events via EdgeStream. Live updates show routing decisions and handoffs as they happen:
// TypeScript: AgentMonitor live event subscription
const subscription = EdgeStream.subscribe('octopus:conversation:*', (event) => {
switch (event.type) {
case 'routing_decision':
updateRoutingPanel(event.data);
break;
case 'agent_handoff':
addHandoffMarker(event.data);
break;
case 'agent_turn_complete':
addTurnToTimeline(event.data);
break;
}
});