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.4.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.4.0
File Size Uploaded Provenance Actions
aerograph_sdk-0.4.0.tar.gz 28.7 kB With provenance Details for aerograph_sdk-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 50.6 kB

Release files / aerograph_sdk-0.4.0.tar.gz

Download URL aerograph_sdk-0.4.0.tar.gz
Size 28.7 kB
Tags Source
SHA-256 checksum
How to use checksums
38d7c7001b015a6c1c5b616afdbd202d59f81048828f75bc3a63065be5f6b98e
BLAKE2b-256 checksum
How to use checksums
ab6c09dfac851f0840ca505db6bc01780535e7f3b15c50972692ea1f5875b3f1
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 6, 2026.

Transparency log

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

Download URL aerograph_sdk-0.4.0-py3-none-any.whl
Size 21.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
916faba266ab8b4201ed50e1c3a937a1cb8f63a9bcf7601cb6586bac43ae381c
BLAKE2b-256 checksum
How to use checksums
3eda93ea1bed0923186d766cf2e73931b8afc7d5214d73a66c70664c3e4ab4da
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 6, 2026.

Transparency log

Security for aerograph-sdk 0.4.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.4.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 6, 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