Skip to main content

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: Routes traces to a specific project (creates it if new)
    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.

Deterministic Replay & Forking

The Python SDK generates stable, deterministic span IDs and parent-child linkages compatible with AeroGraph's Deterministic Replay engine (aerorepl / aerograph-replay-core):

  • Deterministic Cassette Slicing: When triggering ⑂ Fork and Resume in the Web UI or via aerorepl /fork <spanId>, the replay orchestrator slices the recorded cassette up to the target span.
  • Zero Token Cost: Pre-fork steps are served instantly from the local cassette cache with zero token cost, while post-fork Python code runs live.

License

Apache-2.0

Metadata

Release files for aerograph-sdk 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aerograph-sdk 0.5.0
File Size Uploaded Provenance Actions
aerograph_sdk-0.5.0.tar.gz 39.7 kB With provenance Details for aerograph_sdk-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aerograph-sdk 0.5.0
File Interpreter ABI Platform Actions
aerograph_sdk-0.5.0-py3-none-any.whl Python 3 none any Details for aerograph_sdk-0.5.0-py3-none-any.whl

Total release size: 70.6 kB

Release files / aerograph_sdk-0.5.0.tar.gz

Download URL aerograph_sdk-0.5.0.tar.gz
Size 39.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c4034688323d2c12d7a1f4162c3cf2d068c71e01f8516db67a66c5efccbf9de7
BLAKE2b-256 checksum
How to use checksums
6e568ccf42370172d46032592e78a5eb6b8e15e7eb9c86ee49825e41011a14d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Release files / aerograph_sdk-0.5.0-py3-none-any.whl

Download URL aerograph_sdk-0.5.0-py3-none-any.whl
Size 30.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9b8abb16c28009910edf78bd387050f640473a07389881e0e43e7e5af7de7fdb
BLAKE2b-256 checksum
How to use checksums
044f1e40fb6a07f05f116d75963e4f8831f69b496b160d883fe53b96760ba7aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

Security for aerograph-sdk 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aerograph_sdk-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 29, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page