Skip to main content

VigilAgent Python SDK

Monitor, debug, and optimize your AI agents in real-time.

Website • Docs • GitHub


Installation

pip install vigilagent

Quick Start

from vigilagent import VigilAgent

# Initialize with your API key (find it in Settings)
va = VigilAgent(api_key="your-api-key")

# Log an LLM call with full message replay
va.log_event(
    agent_id="customer-support-agent",
    event_type="llm_call",
    payload={
        "model": "gpt-4o",
        "messages": [
            {"role": "system", "content": "You are a helpful assistant."},
            {"role": "user", "content": "What is AI?"},
            {"role": "assistant", "content": "AI stands for Artificial Intelligence..."}
        ]
    },
    tokens_in=25,
    tokens_out=150,
    cost=0.002,
    latency=320
)

Tracing (Group events into sessions)

# Start a trace (a group of related events)
trace = va.start_trace(
    agent_id="customer-support-agent",
    task_description="Summarize a 5-page PDF document"
)

# Log events within the trace
trace.log_event(
    event_type="llm_call",
    payload={"model": "gpt-4o", "messages": [...]},
    tokens_in=500,
    tokens_out=200,
    cost=0.005,
    latency=1200
)

trace.log_event(
    event_type="tool_call",
    payload={"tool_name": "web_search", "query": "latest AI news"}
)

# End the trace
trace.end(status="success")

OpenAI Auto-Instrumentation

from vigilagent import VigilAgent
from openai import OpenAI

va = VigilAgent(api_key="your-api-key")
client = OpenAI()

# Wrap your OpenAI client for automatic logging
wrapped_client = va.wrap_openai(client, agent_id="my-agent")

# Use it exactly like normal — all calls are logged automatically!
response = wrapped_client.chat.completions.create(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hello!"}]
)

Features

  • 📊 Real-time monitoring — Track every LLM call, tool invocation, and agent action
  • 💰 Cost tracking — Know exactly how much each agent costs per call
  • 🔍 Trace Replay — Step through agent execution like a debugger
  • ⚡ Low overhead — Async logging, minimal latency impact
  • 🔗 OpenAI integration — Auto-instrument with one line of code

License

MIT

Metadata

Release files for vigilagent-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 vigilagent-sdk 0.1.0
File Size Uploaded
vigilagent_sdk-0.1.0.tar.gz 7.1 kB Details

Built distribution (wheel)

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

Total release size: 14.9 kB

Release files / vigilagent_sdk-0.1.0.tar.gz

Download URL vigilagent_sdk-0.1.0.tar.gz
Size 7.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d05cf45fa5f3aad4a221ec1a5a18d44cc437d50e6a08d3a52196be879b85824f
BLAKE2b-256 checksum
How to use checksums
33cc62d407f7c79730730583e3d51d8fd1098e4ec51f38190ade3a283b05fa58
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

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

Download URL vigilagent_sdk-0.1.0-py3-none-any.whl
Size 7.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6896db5de05aaadfd35f05b13d7cb412e89979de35425a48af43ba71a69933e5
BLAKE2b-256 checksum
How to use checksums
56238107c8572419a32bc49a7a334523b4b4059566bcbfef0a2351f329c9bf3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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