OpenInference Open Agent Spec Instrumentation
Project description
OpenInference Agent Spec Instrumentation
Python auto-instrumentation library for Agent Spec.
Open Agent Spec (Agent Spec) is a portable, platform-agnostic configuration language that allows Agents and Agentic Systems to be described with high fidelity. It defines the conceptual building blocks—called components—that make up agents in typical agent-based systems. This includes the properties that configure each component and the semantics that govern their behavior.
Agent Spec Tracing is an extension of Agent Spec that standardizes how agent and flow executions emit traces. It enables:
- Runtime adapters to emit consistent traces across different frameworks.
- Consumers (observability backends, UIs, developer tooling) to ingest one standardized format regardless of the producer.
You can find more information about Agent Spec and Agent Spec Tracing at:
- Agent Spec: https://oracle.github.io/agent-spec/development/agentspec/index.html
- Tracing: https://oracle.github.io/agent-spec/development/agentspec/tracing.html
The traces emitted by this instrumentation are fully OpenTelemetry compatible and can be sent to an OpenTelemetry
collector for viewing, such as arize-phoenix
Installation
pip install openinference-instrumentation-agentspec
Quickstart
In this example we will instrument a small program that uses Agent Spec Tracing and observe
the traces via arize-phoenix.
Install packages.
pip install openinference-instrumentation-agentspec pyagentspec[langgraph] arize-phoenix opentelemetry-sdk opentelemetry-exporter-otlp
Start the phoenix server so that it is ready to collect traces. The Phoenix server runs entirely on your machine and does not send data over the internet.
phoenix serve
In a python file (e.g., agentspec_agent.py) , set up the AgentSpecInstrumentor and configure
the tracer to send traces to Phoenix.
from pyagentspec.adapters.langgraph import AgentSpecLoader
from pyagentspec.agent import Agent
from pyagentspec.llms import OpenAiConfig
agent = Agent(
name="assistant",
description="An general purpose agent without tools",
llm_config=OpenAiConfig(name="openai-gpt-5-mini", model_id="gpt-5-mini"),
system_prompt="You are a helpful assistant. Help the user answering politely.",
)
langgraph_agent = AgentSpecLoader().load_component(agent)
from phoenix.otel import register
from openinference.instrumentation.agentspec import AgentSpecInstrumentor
tracer_provider = register(batch=True, project_name="hello-world-app")
AgentSpecInstrumentor().instrument(tracer_provider=tracer_provider)
while True:
user_input = input("USER >>> ")
if user_input.lower() in ["exit", "quit"]:
break
response = langgraph_agent.invoke(
input={"messages": [{"role": "user", "content": user_input}]},
config={"configurable": {"thread_id": "1"}},
)
print("AGENT >>>", response['messages'][-1].content.strip())
Now simply run the python file and observe the traces in Phoenix.
python agentspec_agent.py
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file openinference_instrumentation_agentspec-0.1.2.tar.gz.
File metadata
- Download URL: openinference_instrumentation_agentspec-0.1.2.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
823215a4ea682b8cebccfef9cde294b1a66fbf62afe60b993d13cb1e5e808f11
|
|
| MD5 |
99e5d2c40c8c75d725f300d8ac71f087
|
|
| BLAKE2b-256 |
4a2af02a098f0479aee7caf0d7fe43037b28ec0b7f8850a45131bedde4a55730
|
Provenance
The following attestation bundles were made for openinference_instrumentation_agentspec-0.1.2.tar.gz:
Publisher:
publish.yaml on Arize-ai/openinference
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openinference_instrumentation_agentspec-0.1.2.tar.gz -
Subject digest:
823215a4ea682b8cebccfef9cde294b1a66fbf62afe60b993d13cb1e5e808f11 - Sigstore transparency entry: 1540291305
- Sigstore integration time:
-
Permalink:
Arize-ai/openinference@b5f174deffc29105d7a6f20965b5aa9d635a3920 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Arize-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@b5f174deffc29105d7a6f20965b5aa9d635a3920 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file openinference_instrumentation_agentspec-0.1.2-py3-none-any.whl.
File metadata
- Download URL: openinference_instrumentation_agentspec-0.1.2-py3-none-any.whl
- Upload date:
- Size: 17.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5910afb13fc5ffd641e6d67994e3c1cfe1694de8f25ee844c3f26cfc965fb9b3
|
|
| MD5 |
6f8e0ace1521674389c07295bb54d129
|
|
| BLAKE2b-256 |
c64bd116126ca58ea9ac81f4ebf2840f01250ce04bcc557b1562a772065ac478
|
Provenance
The following attestation bundles were made for openinference_instrumentation_agentspec-0.1.2-py3-none-any.whl:
Publisher:
publish.yaml on Arize-ai/openinference
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
openinference_instrumentation_agentspec-0.1.2-py3-none-any.whl -
Subject digest:
5910afb13fc5ffd641e6d67994e3c1cfe1694de8f25ee844c3f26cfc965fb9b3 - Sigstore transparency entry: 1540291574
- Sigstore integration time:
-
Permalink:
Arize-ai/openinference@b5f174deffc29105d7a6f20965b5aa9d635a3920 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Arize-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@b5f174deffc29105d7a6f20965b5aa9d635a3920 -
Trigger Event:
workflow_dispatch
-
Statement type: