TL;DR
- Create an account @ https://app.brixo.com/sign_up
- Grab an API key and add it to your environment
- Install the Brixo SDK
- Instrument your agent application
- Watch traces appear in Brixo’s Live View and confirm they look good
Prerequisites
- Python 3.10+
- Brixo account + API key
Step 1 — Create an account
Create an account @ https://app.brixo.com/sign_upStep 2 — Get an API key and add it to your environment
Generate an API key from the in-app instruction page and set the BRIXO_API_KEY environment variable to it:Step 3 — Install the Brixo SDK
Step 4 — Instrument your agent application
The typical flow is:- Initialize Brixo once at application startup
- Wrap each user interaction with
@Brixo.interaction - Attach context (user, account, session, input, output)
- Let the interaction finish so traces can be flushed
About user.id
Brixo is designed to use user.id as a stable identifier from your system of record—most commonly a CRM such as Salesforce.
Using a UID that can be mapped to a CRM record enables Brixo to:
- Automatically enrich interactions with CRM metadata when Brixo’s CRM connector is enabled
- Power segmentation by plan, industry, territory, role, lifecycle stage, and more
- Keep analytics consistent across agents, channels, and tools
- Avoid duplicating or syncing customer data manually
user.id: the user’s email
Example
Below is a minimal but complete example that instruments a single agent interaction loop. Create a file calledmain.py:
Key Concepts
Initialization
Brixo.init(...)
Initializes the Brixo SDK once at application startup. This sets runtime-wide settings (like app_name and environment) and configures the SDK so that any subsequent instrumented code can emit traces.
When to call it:
- Call exactly once, as early as possible in your app startup.
- Call it before any instrumented code runs (before your first
@Brixo.interactionexecutes).
Initialization Attributes
Some attributes apply to the application runtime (not a single interaction). These are configured once viaBrixo.init(...) and automatically apply to all interactions.
app_name (required)
Name of the agent application
environment (required)
Execution environment for this app/runtime.
developmentstagingproduction
Interaction Boundaries
@Brixo.interaction(name)
Marks a single, bounded user interaction (one request → one response). Brixo uses this boundary to group spans/attributes into one trace and flush it when the function returns.
name(required): Descriptive interaction name shown in Brixo- Use one interaction per user request
- The decorated function must terminate (no infinite loops)
- Choose descriptive names — they improve trace readability
Brixo.begin_context(...)
Starts an interaction context and attaches initial attributes.
Typical use cases:
- Attach
user,account,session_id - Record raw user
input
Brixo.update_context(...)
Adds or updates context attributes while the interaction is in progress.
Typical use cases:
- Derived metrics
- Tool results
- Partial summaries
- Intermediate state
Brixo.end_context(...)
Adds or updates context attributes and explicitly closes the interaction.
Typical use cases:
- Attach final
output - Add outcome-related metadata
Context Attributes (Per Interaction)
Brixo interactions support a common set of context attributes that describe who the interaction is for, what happened, and what the outcome was. These attributes can be set or updated at any point during an interaction lifecycle using:Brixo.begin_context(...)Brixo.update_context(...)Brixo.end_context(...)
You do not need to provide all attributes up front. A common pattern is to attach identifiers and input early, and attach derived data or outputs later.
Supported Context Attributes
Required for every interaction:user.idanduser.nameaccount.idandaccount.namesession_idinputoutput
input is typically set inBrixo.begin_context(...), and output is typically set inBrixo.end_context(...). You may set them viaBrixo.update_context(...)as long as they are present before the interaction finishes.
user
Identifies the end user interacting with the agent.
-
id(required): Stable internal identifier for the user Typically an email address, which can be mapped to a CRM record (e.g. Salesforce) when a connector is enabled. -
name(required): Display name
account
Identifies the customer, tenant, or organization associated with the interaction.
id(required): Stable internal identifier for the account or customername(required): Human-readable display name
session_id
Logical identifier that groups multiple interactions into a session.
- Use the same
session_idacross multiple interactions to enable session-level analysis
input
Raw user input that initiated the interaction.
- Required for every interaction
- Typically set at the beginning of an interaction
- Used for analytics, debugging, and replay
output
Final agent output for the interaction.
- Required for every interaction
- Typically set via
Brixo.end_context(...) - Represents the resolved response returned to the user
metadata
Arbitrary structured key-value data associated with the interaction.
- Useful for custom segmentation and filtering
- Values must be JSON-serializable
Best Practices
- One interaction = one user request
- Keep interaction functions short and bounded
- Use descriptive interaction names
- Attach inputs early and outputs late
- Initialize Brixo early at startup; if you rely on auto-instrumentation, import those libraries after
Brixo.init(...) - Use
update_contextfreely — it does not end the interaction - Close every interaction so traces can be flushed and analyzed
Support
If you have questions or run into issues:- Check the Brixo Live View for trace visibility
- Reach out to the Brixo team at [email protected]
