Skip to main content

Lightweight monitoring for indie AI agents

Project description

AgentPulse Python SDK

Lightweight monitoring for indie AI agents. Zero dependencies. Fire-and-forget.

Install

pip install agentpulse

Quick Start

from agentpulse import pulse, init

# Initialize with your API key
init(api_key="ap_...")

# Track sessions
pulse.session_start("main")
pulse.session_event("main", "tool_call", {"tool": "web_search"})
pulse.session_end("main")

# Report cron jobs
pulse.cron_report("email-check", status="ok", duration_ms=1200)
pulse.cron_report("backup", status="error", summary="disk full")

# Track costs
pulse.cost_event(model="claude-opus-4", input_tokens=5000, output_tokens=1000, cost=0.15)

# Monitor memory
pulse.memory_report("MEMORY.md", size_bytes=45000, lines=800)

# Custom metrics
pulse.metric("response_time_ms", 342)

# Alerts
pulse.alert("Cost spike detected", severity="warning", details="$5.20 in last hour")

# Heartbeat
pulse.heartbeat()

How It Works

Events are queued locally and flushed to the AgentPulse API in batches every 10 seconds. Zero blocking. If the API is unreachable, events are retried on the next flush cycle.

Environment Variables

Variable Description
AGENTPULSE_API_KEY Your API key
AGENTPULSE_ENDPOINT Custom API endpoint
AGENTPULSE_AGENT Agent name (defaults to hostname)

License

MIT

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

agentpulse_sdk-0.1.0.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

agentpulse_sdk-0.1.0-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file agentpulse_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: agentpulse_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for agentpulse_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 536563febcec2541ddf0eb7979a796c47f1a2fc330e831329de18368e7791084
MD5 e54f2b871aae09b6ca3b60cd7ef66606
BLAKE2b-256 9eebbf020315754c0fa32bcf46d271fc5d1c5d268d0e442ebcc6fc67c1cb1194

See more details on using hashes here.

File details

Details for the file agentpulse_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: agentpulse_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for agentpulse_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 105f54b8ba84dbe2d258685c9b089c76d47179a5d21df291976dfe73f76483ac
MD5 f833331fa3359788c80e12a4f1f34529
BLAKE2b-256 6994707d9a7181fecc463a14eabd82a2be35764575637605100a18d0cc01059c

See more details on using hashes here.

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