Chain of Thought
The Chain of Thought components at frontend/agentic-workbench/src/components/ChainOfThought/ provide LLM reasoning transparency by visualizing the step-by-step thought process of AI agents.
ChainOfThoughtViewer
File: frontend/agentic-workbench/src/components/ChainOfThought/ChainOfThoughtViewer.tsx
Renders the agent's reasoning chain as an expandable tree:
- Each thought step shows the LLM's reasoning
- Tool calls are displayed with inputs and outputs
- Decision points highlight which branch was taken
- Token counts per step
- Latency per step
- Confidence scores where available
Types
// frontend/agentic-workbench/src/components/ChainOfThought/types.ts
interface ThoughtStep {
id: string;
type: 'reasoning' | 'tool_call' | 'decision' | 'output';
content: string;
toolName?: string;
toolInput?: Record<string, unknown>;
toolOutput?: string;
tokenCount: number;
latencyMs: number;
children?: ThoughtStep[];
}Integration
The Chain of Thought viewer integrates with the AI Service's streaming response to render thought steps in real-time as the agent processes a request.