Portal Community

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

MetricWhat to Watch ForAction
Routing confidenceConsistently below threshold (many fallbacks to default)Add intent examples, tune routing strategy
Handoff rateHigh % of conversations involving handoffsVerify routing keywords/embeddings are accurate
Specialist response latencyOne specialist much slower than othersCheck its tool calls, memory retrieval, LLM config
Token usage per teamUnexpectedly high — may signal context bloatReduce 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;
  }
});