Skip to main content

AgentPulse Python SDK (agentpulse-sdk)

Production observability, prompt drift sentinel, and sub-millisecond circuit breakers for autonomous LLM agents (LangChain, AutoGen, CrewAI, LlamaIndex, or raw OpenAI/Anthropic).

🚀 Quickstart

1. Install

pip install agentpulse-sdk
# or install locally from source:
pip install -e sdk/

2. Wrap your Agent Function

from agentpulse import AgentPulse, CircuitBreaker

# Initialize sentinel
pulse = AgentPulse(
    api_key="ap_live_your_api_key_here",
    base_url="http://localhost:8000",   # Use https://api.agentpulse.io in production
    environment="production"
)

# Protect your agent with a circuit breaker
@pulse.monitor(
    agent_id="customer-support-copilot",
    model="claude-3-7-sonnet",
    circuit_breaker=CircuitBreaker(
        max_hops=6,                     # Abort if agent loops > 6 hops
        max_cost_usd=0.50,              # Kill if run exceeds $0.50
        kill_on_infinite_loop=True,     # Kill repetitive duplicate tool calls
        max_duplicate_calls=2
    )
)
def run_my_agent(user_query: str):
    # Record reasoning steps or tool calls inside your loop
    pulse.record_step(
        step_type="tool",
        title="CRM Search",
        content="Searching customer ticket history",
        tool_call_str='crm.search(query="invoice 9812")',
        input_tokens=1500,
        output_tokens=300
    )
    
    # If the agent attempts a runaway recursive loop, CircuitBreakerException
    # is raised in <1ms, killing the run and logging the incident to your dashboard!
    return "Resolved query."

3. Context Manager Syntax

You can also use AgentPulse as an explicit context manager:

with pulse.trace("sql-analyst", model="gpt-4o") as t:
    t.record_step(
        step_type="tool",
        title="Execute SQL",
        tool_call_str="SELECT * FROM users",
        input_tokens=800,
        output_tokens=200
    )

🛡️ Circuit Breakers & Guardrails

Guardrail Parameter Default Behavior
Max Hops max_hops 8 Aborts run if total reasoning steps / tool calls exceeds limit.
Cost Ceiling max_cost_usd $1.00 Calculates token spend against live model pricing; aborts if exceeded.
Infinite Recursion kill_on_infinite_loop True Intercepts repetitive duplicate queries with zero parameter change.
Duplicate Threshold max_duplicate_calls 2 Number of allowable consecutive duplicate calls before termination.

📦 Features

  • Zero latency impact: Telemetry payloads are delivered asynchronously using non-blocking HTTP workers.
  • In-process guardrail checks: All circuit-breaker decisions execute in memory in <1ms without waiting for network responses.
  • Auto cost calculation: Built-in pricing matrix for Claude 3.7/3.5, GPT-4o, Gemini 2.5, DeepSeek R1, and Llama 3.3.
  • Framework agnostic: Works natively with LangChain, AutoGen, CrewAI, LiteLLM, or plain Python functions.

Metadata

Release files for brenducate-sdk 0.1.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 brenducate-sdk 0.1.0
File Size Uploaded Provenance Actions
brenducate_sdk-0.1.0.tar.gz 22.4 kB Without provenance Details for brenducate_sdk-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for brenducate-sdk 0.1.0
File Interpreter ABI Platform Actions
brenducate_sdk-0.1.0-py3-none-any.whl Python 3 none any Details for brenducate_sdk-0.1.0-py3-none-any.whl

Total release size: 49.4 kB

Release files / brenducate_sdk-0.1.0.tar.gz

Download URL brenducate_sdk-0.1.0.tar.gz
Size 22.4 kB
Tags Source
SHA-256 checksum
How to use checksums
aedf8a5c474ff51dd6c9cd2b2e210a48962a8deb0bc4f36897ca8522b13a6552
BLAKE2b-256 checksum
How to use checksums
cc7a4f96675f5acb493fce34dc5a6ea0a91d4178a246affe61b36b69aa8a019f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / brenducate_sdk-0.1.0-py3-none-any.whl

Download URL brenducate_sdk-0.1.0-py3-none-any.whl
Size 26.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f574dffbd557d02779dd00df7373b0bf6bed6003b4fdf1ca3bba14876ae36448
BLAKE2b-256 checksum
How to use checksums
bc0c36c94f0d63227bbf5daae1f3b9ed4af68c09e110150db22d0f0e8f0c9a75
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Security for brenducate-sdk 0.1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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