Python SDK for AeroGraph — emit trace events from Python agent workflows.
Project description
aerograph-sdk
The core Python Flight Recorder for emitting normalized trace events from any Python codebase to the AeroGraph collector.
Overview
AeroGraph is an open-source cognitive observability layer for AI agent workflows. It allows you to record, playback, and visually inspect the deterministic decision-making paths of your agents.
This SDK provides a FlightRecorder instance to seamlessly construct and emit strictly validated TraceEvent objects.
Installation
pip install aerograph-sdk
(Requires Python >= 3.10)
Quick Start
from aerograph_sdk import FlightRecorder
# 1. Initialize the recorder
recorder = FlightRecorder(
endpoint="http://localhost:4317", # AeroGraph Collector URL
actor={"id": "my-travel-agent", "name": "Travel Planner"},
project_id="travel-app", # Optional (v1.1.0)
environment="production" # Optional (v1.1.0)
)
# 2. Emit events
prompt_event = recorder.prompt(
text="Plan a trip to Tokyo",
model={"name": "gpt-4o", "provider": "openai"},
usage={"inputTokens": 10, "totalTokens": 10},
duration_ms=50
)
response_event = recorder.response(
parent_span_id=prompt_event.spanId,
text="Here is your 3-day itinerary...",
usage={"inputTokens": 10, "outputTokens": 50, "totalTokens": 60},
duration_ms=2500
)
Async Usage
Every method has an _async twin:
await recorder.prompt_async(text="Hello")
Available Event Kinds
The FlightRecorder supports 10 canonical event kinds:
prompt: Input sent to an LLM.response: Output from an LLM.tool_call: Invocation of a tool.tool_result: The tool's resulting output.handoff: Delegating execution from one agent to another.error: Any exception or system failure.retriever: RAG retrieval query and source documents.state_snapshot: A deterministic hash of a LangGraph node's state.checkpoint: A human-in-the-loop pause.note: Freeform structured annotations.
Span Hierarchy
Every event acts as a "span" in the trace tree. To link a child event to a parent event, pass the parent's spanId via the parent_span_id parameter.
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
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 aerograph_sdk-0.3.0.tar.gz.
File metadata
- Download URL: aerograph_sdk-0.3.0.tar.gz
- Upload date:
- Size: 27.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
06c7784ecf7709fac691b70dd432f17f31fad5c27b6e241aeb7ab2ecbd6b9606
|
|
| MD5 |
407641f905d8193bf8884ec27a138f9c
|
|
| BLAKE2b-256 |
b7e799f5d84fd932b4900b885459724b111ca919dfa1ae24be7ee24e2fc52312
|
Provenance
The following attestation bundles were made for aerograph_sdk-0.3.0.tar.gz:
Publisher:
release-python.yml on SGcpu/AeroGraph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aerograph_sdk-0.3.0.tar.gz -
Subject digest:
06c7784ecf7709fac691b70dd432f17f31fad5c27b6e241aeb7ab2ecbd6b9606 - Sigstore transparency entry: 2020602686
- Sigstore integration time:
-
Permalink:
SGcpu/AeroGraph@9504b907ff5e3c49d3ec8c6e8f47fb2f46d1436f -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/SGcpu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@9504b907ff5e3c49d3ec8c6e8f47fb2f46d1436f -
Trigger Event:
release
-
Statement type:
File details
Details for the file aerograph_sdk-0.3.0-py3-none-any.whl.
File metadata
- Download URL: aerograph_sdk-0.3.0-py3-none-any.whl
- Upload date:
- Size: 20.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
12225e8b6a089cf64014a8dc3372bbad4c447744bb073c8b446ea936538377ac
|
|
| MD5 |
c47148cba891b2497743959287208c7c
|
|
| BLAKE2b-256 |
cba607d16f200f1be60a139ae4a9eaeec64e2215594d2f54529aa1b76734dfa8
|
Provenance
The following attestation bundles were made for aerograph_sdk-0.3.0-py3-none-any.whl:
Publisher:
release-python.yml on SGcpu/AeroGraph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aerograph_sdk-0.3.0-py3-none-any.whl -
Subject digest:
12225e8b6a089cf64014a8dc3372bbad4c447744bb073c8b446ea936538377ac - Sigstore transparency entry: 2020602933
- Sigstore integration time:
-
Permalink:
SGcpu/AeroGraph@9504b907ff5e3c49d3ec8c6e8f47fb2f46d1436f -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/SGcpu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-python.yml@9504b907ff5e3c49d3ec8c6e8f47fb2f46d1436f -
Trigger Event:
release
-
Statement type: