maitai.observe() once at process start. Maitai instruments installed frameworks and exports OpenInference/OTel spans to POST /api/v1/traces. Observed runs show up as agents in the Portal (same Runs / session / cost surfaces as native agents).
Requires the optional extra:
pip install 'maitai-python[observe]'. Capture is fire-and-forget — never raises into your application. Use MAITAI_LOGGING_ENABLED / sample-rate env vars the same way as maitai.log().One-line setup
Agent name (multi-agent processes)
When frameworks emit generic span names, two agents in one process can collapse into a single observed agent. Stamp an explicit name:agent.name on spans (does not override a name the framework already set). The backend already prefers agent.name when resolving the observed agent.
maitai.agent is also the hosted-agent client package (Completions). Calling it as maitai.agent("name") enters the observe naming context; importing from maitai.agent import Completions is unchanged.Intent override
Observed LLM steps defaultaction_type to the span name. Override when you want a stable Maitai intent:
maitai.set_intent("classify_ticket"). Backend reads maitai.intent when re-logging LLM steps through the BYO chat-log path.
Session contract
Workflows vs agents
A fixed pipeline should be a workflow, not an observed agent. Declare it:workflow_run for the container plus observed agents for nested boundaries. Profile spans carry refs / nav_path so the Portal can drill into those agents. The workflow root is not double-counted as an agent.
See Workflow logging (BYOW) for code-native and no-code workflow capture without observe().