Skip to main content

Overview

The Event object is the fundamental building block of Fabraix’s observability system. Every action, decision, and interaction in your agent’s lifecycle is captured as an Event.

Event Structure

The Event object has a precise structure designed for flexibility and comprehensive tracking:

Field Definitions

string
required
A unique identifier for the event (typically a UUID). This ID is generated by your system and should be globally unique.Example: "e7d4f3a2-8b1c-4d9e-a5f6-2c3d4e5f6a7b"
datetime
required
The precise time when the event occurred, formatted as ISO 8601.Format: YYYY-MM-DDTHH:mm:ss.sssZExample: "2024-01-15T14:30:45.123Z"
string
required
The unique session identifier returned from /register-agent-run. This links the event to a specific agent session.Example: "f4f4f4f4-f4f4-f4f4-f4f4-f4f4f4f4f4f4"
enum
required
The logical category of the event. Must be one of:
  • user - Human user input
  • model_input - Data sent to LLM
  • model_output - LLM responses
  • system - System-level events
  • tool - Tool/function calls
  • environment - External system data
  • memory - Memory operations
  • error - Error conditions
string
required
The actual event data as a stringified JSON object. This must validate against the provided schema.Example:
string
required
A stringified JSON Schema that defines the structure of the content field. This enables dynamic validation and understanding of diverse event types.Example:

Content and Schema Relationship

The power of Fabraix’s data model lies in the relationship between content and schema. The schema defines what the content should look like, enabling:
  • Dynamic Validation: Content is validated against its schema
  • Type Safety: Clear contracts for event data
  • Flexibility: Support for any data structure
  • Documentation: Self-describing events

Example: Tool Event

Here’s how content and schema work together for a tool call:

Event Type Examples

User Event

Captures input from human users:

Model Input Event

Data sent to the LLM:

Model Output Event

LLM responses:

Memory Event

Memory operations:

Environment Event

External system interactions:

Handling Complex Data

Images and Binary Data

For images and binary data, use base64 encoding within the JSON:

Nested Structures

Support complex nested data structures:

Best Practices

Generate UUIDs for event IDs to ensure uniqueness:
Add contextual information that might be useful for analysis:
Include constraints, formats, and descriptions:
Log errors as events for debugging:

Validation

Fabraix validates all events against their schemas. Common validation errors:
Schema Mismatch: Content doesn’t match schema structure
Invalid JSON: Content or schema is not valid JSON
Type Mismatch: Wrong data type for a field

Next Steps

Now that you understand the Event data model:

Agent Lifecycle

See how events flow through an agent’s lifecycle

API Reference

Explore the Event endpoint documentation