Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aerograph_sdk-0.3.0.tar.gz (27.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aerograph_sdk-0.3.0-py3-none-any.whl (20.5 kB view details)

Uploaded Python 3

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

Hashes for aerograph_sdk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 06c7784ecf7709fac691b70dd432f17f31fad5c27b6e241aeb7ab2ecbd6b9606
MD5 407641f905d8193bf8884ec27a138f9c
BLAKE2b-256 b7e799f5d84fd932b4900b885459724b111ca919dfa1ae24be7ee24e2fc52312

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerograph_sdk-0.3.0.tar.gz:

Publisher: release-python.yml on SGcpu/AeroGraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for aerograph_sdk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12225e8b6a089cf64014a8dc3372bbad4c447744bb073c8b446ea936538377ac
MD5 c47148cba891b2497743959287208c7c
BLAKE2b-256 cba607d16f200f1be60a139ae4a9eaeec64e2215594d2f54529aa1b76734dfa8

See more details on using hashes here.

Provenance

The following attestation bundles were made for aerograph_sdk-0.3.0-py3-none-any.whl:

Publisher: release-python.yml on SGcpu/AeroGraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page