Opik Agent Logger icon

Opik Agent Logger

Create an Opik trace with spans from an n8n AI Agent run

Overview

The Opik Agent Logger node creates an Opik trace with spans from the output of an n8n AI Agent run. It is useful for logging and tracking AI agent executions by sending detailed trace data, including intermediate tool calls and summary spans, to the Opik service. This node is beneficial for monitoring AI workflows, debugging, and analyzing agent behavior in projects managed within Opik.

Use Case Examples

  1. Logging the full output of an AI agent run to Opik for traceability.
  2. Including intermediate steps of the AI agent's tool calls as spans for detailed analysis.
  3. Tagging traces for easier filtering and organization within the Opik platform.

Properties

Name Meaning
Agent Output Full JSON output emitted by the n8n AI Agent node, containing input, output, intermediate steps, and metadata.
Project Name or ID The Opik project to which the trace belongs, selectable from a list or specified by ID.
Trace Name Optional custom name for the trace; defaults to a timestamp if left empty.
Thread ID Optional identifier for the thread; auto-generated if left empty.
Tags Tags to label the trace for easier filtering in Opik; supports multiple values.
Include Intermediate Steps Whether to emit a span for each intermediate tool call made by the AI agent.
Include Summary Span Whether to include a summary span representing the overall agent run.
Summary Span Name Name of the summary span if included; defaults to 'Agent Summary'.

Output

JSON

  • traceId - Unique identifier of the created trace in Opik.
  • threadId - Identifier of the thread associated with the trace.
  • spanCount - Number of spans created for the trace, including intermediate steps and summary span.
  • spanIds - Array of unique identifiers for each span created in the trace.

Dependencies

  • Opik API with authentication credentials

Troubleshooting

  • Ensure the 'Agent Output' JSON is correctly formatted and contains necessary fields; missing or malformed data will cause errors.
  • Verify that the 'Project Name or ID' is valid and accessible with the provided credentials.
  • Network or authentication issues with the Opik API can cause request failures; check API credentials and connectivity.
  • If intermediate steps or summary spans are not appearing, verify the corresponding boolean properties are set correctly.

Links

Discussion