Agent Thinking Overview
The Agent Thinking subsystem captures, stores, and analyzes the reasoning processes of AI agents during execution. It records every thinking step, LLM API call, and decision point as structured traces, then generates embeddings for similarity search and reasoning analytics.
Architecture
+-------------------+ +-------------------------+
| Agent Orchestrator| --> | Orchestrator Hooks |
+-------------------+ +------------+------------+
|
+------------v------------+
| AgentThinkingCapture |
| Service |
+------------+------------+
|
+------------------+------------------+
| | |
+-------v------+ +--------v-------+ +------v--------+
| Dgraph Store | | Kafka Producer | | Thinking |
| (persistence)| | (streaming) | | Embeddings |
+--------------+ +----------------+ +---------------+Key Components
| Component | Description |
|---|---|
AgentThinkingCaptureService | Captures agent reasoning during execution |
ThinkingEmbeddingService | Generates vector embeddings for thinking traces |
DgraphContextStore | Persists traces, steps, and API calls to Dgraph |
ContextGraphOrchestratorHooks | Non-invasive integration with agent orchestrators |
Subsections
| Page | Description |
|---|---|
| Thinking Traces | Structure and lifecycle of agent thinking traces |
| Thinking Embeddings | Vector embedding generation for trace similarity |
| Reasoning Analytics | Analytics dashboards for agent reasoning patterns |
Thinking Step Types
| Step Type | Description |
|---|---|
INTENT_ANALYSIS | Analyzing user intent from the query |
ENTITY_EXTRACTION | Extracting entities from the query context |
SQL_GENERATION | Generating SQL from natural language |
TOOL_SELECTION | Choosing which tool or agent to delegate to |
VALIDATION | Validating generated outputs |
REFINEMENT | Refining results based on feedback |