nomi

Setup guides · Python

OpenAI Agents SDK

One call at startup records model calls, tool calls and handoffs from every Runner.run. Optional run hooks make tool-call IDs exact and give each tool its line of code.

Versions
openai-agents >=0.20,<0.26 with openai >=2.45,<4; Python SDK (nomi-sdk) 1.0.0
Route
An adapter that adds to the framework's own tracing

Your coding agent can do the attaching. Ask it:

Use the attach-nomi skill and add nomi to this agent.

It finds the places to hook in and asks you the few things only you know. The steps below are what it does.

Start nomi

nomi is one program, nomi. Download it from the releases page, then:

nomi init
nomi configure -mode sdk -source my-agent -receiver-listen 127.0.0.1:4320
nomi start                                   # leave this running
nomi browser -home "$HOME/.nomi"  # opens the run view

Everything it records lives in ~/.nomi; -home on any command chooses another folder. nomi doctor says whether it's healthy.

Install the Python SDK into your agent's environment from the release's wheel (the same file comes with the program; it isn't on the Python package index) and tell it where nomi is:

pip install "nomi-sdk @ https://github.com/joshbodunrin/nomi/releases/download/v1.0.0/nomi_sdk-1.0.0-py3-none-any.whl"
export MYAGENT_NOMI_ENABLED=1
export MYAGENT_NOMI_ENDPOINT=http://127.0.0.1:4320
export MYAGENT_NOMI_TOKEN_FILE="$HOME/.nomi/write-token"

These are the same-machine settings. Your agent can also run in a container or on another machine of yours and send to the same nomi: where nomi runs has what changes, and the attach skill can set it up.

nomi never changes how your agent runs: if it’s off, down or hanging, your agent carries on with the same output.

Check your versions

from nomi.compatibility import openai_agents_support
print(openai_agents_support())

The range is openai-agents 0.20 up to (not including) 0.26, with openai 2.45 up to 4; pre-releases aren’t accepted.

Outside the range, instrument registers nothing and logs one nomi: OpenAI Agents adapter off line; your agent runs as usual, and scopes and declarations are still recorded. instrument(observer, strict=True) raises instead. Don’t downgrade your app’s packages to fit.

Attach

The default OpenAI exporter and any trace processors your app registered keep running.

  1. Once, where the observer is created:

    from nomi import Observer
    from nomi.integrations.openai_agents import instrument, run_hooks
    
    observer = Observer.from_env("support-desk", project="support-desk", agent="support-desk", prefix="SUPPORT_DESK_NOMI")
    instrument(observer)
    
  2. Wrap each unit of work. A Runner.run inside the scope joins its run; outside one, each Runner.run is its own run with no group:

    with observer.observe("support_turn", workflow="support", group=conversation.id, step="reply"):
        result = await Runner.run(agent, items, hooks=run_hooks(observer, inner=app_hooks))
    
  3. run_hooks is optional. inner keeps your app’s own hooks. Without it, tool-call IDs are matched rather than exact, and tools have no code location.

Recorded automatically

  • Model calls: the returned model (Responses) or requested model (Chat Completions), tokens, status (Responses), the output cap (the provider’s echo on Responses, the request on Chat Completions), and prompts and replies. An input list over a size bound (a later turn passes the whole conversation back) is kept as its JSON text, start and end, and shown as cut, with the reason. A failed model call carries the error’s type, HTTP status code and message, and the openai client’s attempts.
  • The provider: openai only when the client sends to api.openai.com. Pointed anywhere else (a proxy, a local model), the provider is unknown and the step shows the address the request went to.
  • Tool calls: name, arguments, result, duration and error status; the call ID; and, with run_hooks, the tool function’s file, function and line.
  • Structure: task, agent, turn, model, tool and handoff spans.
  • Runner-managed model retries (ModelSettings.retry): the failed call is a separate errored step in the same turn.

Declared by your code

Decisions (results and issues), effects, and logical actions (observer.tool(..., action_id=..., attempt=...) around a side effect’s own attempts), expected exceptions and waits. No hook provides them. An observer.tool(...) made inside a function tool nests under that tool’s step.

What it can’t see

  • The stop reason for Chat Completions: the step says it isn’t reported on this route. On Responses, a reply cut off at its cap raises ModelBehaviorError (seen in 0.24; other releases not checked), and its usage isn’t recorded.
  • Tokens on a stream that carries no usage: shown as unknown, never 0.
  • Retries inside the openai client on a call that succeeded: one longer model call, which says retries by the provider client aren’t reported on this route.
  • Reasoning text: this route doesn’t pass it on.
  • A tool’s exception message under the default failure handler, which redacts it. It is recorded when the tool has its own failure_error_function.
  • Success: framework spans are errored or unspecified, and a cancelled tool also ends without an error, so unspecified is never read as success.

In every guide: nothing below a tool’s boundary, such as HTTP retries in your own client, is seen unless your code declares its attempts. Retries inside a provider’s client library show as one longer model call; the step gives the client’s attempts where the route reports them, and otherwise says they aren’t reported. A model nomi has no price for, such as a local one, has its cost shown as unpriced, never as $0. A run that was still open when nomi stopped says its end was not received: its outcome is unknown, not interrupted.

Connect your coding agent

nomi includes a server with read-only tools for your coding agent, and a debug skill that teaches it to keep what was observed, what your code declared and what is unknown apart. Pick yours:

Claude Code

claude mcp add nomi -s user -- nomi mcp
mkdir -p ~/.claude/skills && cp -R skills/debug-agent-with-nomi ~/.claude/skills/

Codex

codex mcp add nomi -- nomi mcp
mkdir -p ~/.codex/skills && cp -R skills/debug-agent-with-nomi ~/.codex/skills/

Cursor, in ~/.cursor/mcp.json (or .cursor/mcp.json for one project)

{"mcpServers": {"nomi": {"type": "stdio", "command": "nomi", "args": ["mcp"]}}}

Cursor's debug skill (the skill needs Cursor 2.4 or later)

mkdir -p ~/.cursor/skills && cp -R skills/debug-agent-with-nomi ~/.cursor/skills/

Cursor also reads skills from ~/.claude/skills/, so if the skills are already installed for Claude Code, nothing needs copying.

Then open a session in your agent's repository and ask, for example:

  • “What went wrong in my agent's last few runs?”
  • “Why did this run fail?”
  • “What changed between these two runs?”