Skip to main content
The arzule-ingest package provides everything you need to capture traces from your Python-based AI agents.

Installation

pip install arzule-ingest
This includes all framework integrations (CrewAI, LangChain, AutoGen) and SOC2 compliance features by default.

Core API

arzule_ingest.init()

Initialize the SDK with automatic instrumentation:
import arzule_ingest

arzule_ingest.init(
    api_key="...",       # Optional: defaults to ARZULE_API_KEY env var
    tenant_id="...",     # Optional: defaults to ARZULE_TENANT_ID env var
    project_id="...",    # Optional: defaults to ARZULE_PROJECT_ID env var
    redact_secrets=True, # Optional: enable PII redaction
    batch_size=100,      # Optional: events per batch
)

ArzuleRun

Context manager for manual run control:
from arzule_ingest import ArzuleRun
from arzule_ingest.sinks import JsonlFileSink

with ArzuleRun(
    tenant_id="...",
    project_id="...",
    sink=JsonlFileSink("traces.jsonl")
) as run:
    # Your agent code here
    print(f"Run ID: {run.run_id}")

Sinks

Sinks determine where trace events are sent:
SinkPurpose
HttpBatchSinkSend to Arzule cloud (default)
JsonlFileSinkWrite to local JSONL file
CompositeSinkSend to multiple destinations
from arzule_ingest.sinks import JsonlFileSink, HttpBatchSink, CompositeSink

# Local file
file_sink = JsonlFileSink("traces.jsonl")

# Remote endpoint
http_sink = HttpBatchSink(
    endpoint_url="https://ingest.arzule.com",
    api_key="..."
)

# Both at once
multi_sink = CompositeSink([file_sink, http_sink])

Framework integrations

CrewAI

from arzule_ingest.crewai import instrument_crewai

# Call once at startup
instrument_crewai()
Or use the automatic approach:
import arzule_ingest
arzule_ingest.init()  # Auto-detects and instruments CrewAI

CLI

The SDK includes a command-line tool:
# View traces
arzule view traces.jsonl

# Show statistics
arzule stats traces.jsonl

Module structure

arzule_ingest/
├── __init__.py      # init(), version
├── run.py           # ArzuleRun context manager
├── sinks/           # Output destinations
│   ├── base.py      # BaseSink interface
│   ├── http.py      # HttpBatchSink
│   ├── jsonl.py     # JsonlFileSink
│   └── composite.py # CompositeSink
├── crewai/          # CrewAI integration
│   └── normalize.py # Event normalization
├── redaction.py     # PII redaction
├── ids.py           # ID generation
└── cli.py           # Command-line interface

Next steps