import type { Metadata } from "next"; export const metadata: Metadata = { title: "Core Concepts", description: "Understand the four core data types in AgentLens: Traces, Spans, Decision Points, and Events.", }; function CodeBlock({ children, title }: { children: string; title?: string }) { return (
{title && (
{title}
)}
        {children}
      
); } function ConceptCard({ title, description, children, }: { title: string; description: string; children: React.ReactNode; }) { return (

{title}

{description}

{children}
); } export default function ConceptsPage() { return (

Core Concepts

AgentLens organizes observability data into four core types. Together they give you a complete picture of what your agents do and why.

Properties

Field Type Description
id string Unique identifier (UUID v4)
name string Human-readable label for the trace
status enum RUNNING, COMPLETED, or ERROR
tags string[] Freeform labels for filtering
sessionId string? Groups traces from the same session
startedAt ISO datetime When the trace began
endedAt ISO datetime? When the trace finished (null if still running)

Span Types

{[ { type: "LLM_CALL", desc: "A call to a language model (OpenAI, Anthropic, etc.)" }, { type: "TOOL_CALL", desc: "An invocation of an external tool or function" }, { type: "MEMORY_OP", desc: "A read or write to a vector store or memory system" }, { type: "CHAIN", desc: "A sequential pipeline of operations" }, { type: "AGENT", desc: "A top-level agent or sub-agent execution" }, { type: "CUSTOM", desc: "Any user-defined operation type" }, ].map((item) => (
{item.type}

{item.desc}

))}

Nesting example

{`Trace: "research-agent" Span: "agent" (AGENT) Span: "plan" (LLM_CALL) Span: "web-search" (TOOL_CALL) Span: "summarize" (LLM_CALL)`}

Key properties

Decision Point Types

{[ { type: "TOOL_SELECTION", desc: "Agent chose which tool to call" }, { type: "ROUTING", desc: "Agent routed to a specific sub-agent or branch" }, { type: "RETRY", desc: "Agent decided to retry a failed operation" }, { type: "ESCALATION", desc: "Agent escalated to a human or higher-level agent" }, { type: "MEMORY_RETRIEVAL", desc: "Agent chose what context to retrieve" }, { type: "PLANNING", desc: "Agent formulated a multi-step plan" }, ].map((item) => (
{item.type}

{item.desc}

))}

Structure

{`{ "type": "TOOL_SELECTION", "reasoning": "User asked about weather, need real-time data", "chosen": { "tool": "weather_api", "confidence": 0.95 }, "alternatives": [ { "tool": "web_search", "confidence": 0.72 }, { "tool": "knowledge_base", "confidence": 0.31 } ], "contextSnapshot": { "user_intent": "weather_query" } }`}

Event Types

{[ { type: "ERROR", desc: "An exception or failure occurred" }, { type: "RETRY", desc: "An operation was retried" }, { type: "FALLBACK", desc: "A fallback path was triggered" }, { type: "CONTEXT_OVERFLOW", desc: "Context window limit was exceeded" }, { type: "USER_FEEDBACK", desc: "User provided feedback on an output" }, { type: "CUSTOM", desc: "Any user-defined event type" }, ].map((item) => (
{item.type}

{item.desc}

))}

Example

{`{ "type": "CONTEXT_OVERFLOW", "name": "token-limit-exceeded", "metadata": { "limit": 128000, "actual": 131072, "truncated_chars": 4200 }, "timestamp": "2026-01-15T10:30:00.000Z" }`}

How they fit together

{`Trace: "customer-support-agent" | +-- Span: "classify-intent" (LLM_CALL) | Decision: ROUTING -> chose "refund-flow" over "faq-flow" | +-- Span: "refund-flow" (AGENT) | +-- Span: "lookup-order" (TOOL_CALL) | +-- Span: "process-refund" (TOOL_CALL) | Event: ERROR -> "payment-gateway-timeout" | Event: RETRY -> "retrying with backup gateway" | +-- Span: "process-refund-retry" (TOOL_CALL) | +-- Span: "compose-response" (LLM_CALL)`}
); }