Skip to main content

Lightweight observability SDK for AI agents — wrap any agent framework, get anomaly detection, guardrails, and cost tracking.

Project description

agentwatch-observe

Lightweight observability for AI agents. Wrap any local or cloud model call, stream steps to AgentWatch, and get cost tracking, anomaly detection, and guardrails on the dashboard at agentwatch.in.

Privacy: Your model credentials (OpenAI, Gemini, Ollama, etc.) stay on your machine. AgentWatch only receives telemetry — tokens, cost estimates, tool names, timing, and step metadata — never your API keys or raw model weights.

Install

pip install agentwatch-observe

Optional LangChain integration:

pip install "agentwatch-observe[langchain]"

Quickstart (any agent, any model)

Add to your project .env:

AGENTWATCH_API_KEY=your_key_here
AGENTWATCH_BASE_URL=https://api.agentwatch.in   # optional

Two lines in your agent code — works with Gemini, OpenAI, Ollama, LangChain, or custom logic:

import agentwatch

agentwatch.bootstrap()  # reads AGENTWATCH_API_KEY from env

@agentwatch.track(agent_name="my-agent")
def handle_message(message: str):
    return your_existing_agent_logic(message)

Open the AgentWatch dashboardRuns to see the trace.

Optional: auto-capture provider SDK calls

If you call a provider SDK directly, wrap it once and every LLM call is logged:

from google import genai
client = agentwatch.instrument_google_genai_client(genai.Client(api_key="..."))
# client.models.generate_content(...) is now auto-logged inside an active run

# Also: instrument_openai(OpenAI()), instrument_anthropic(Anthropic())

Manual step logging (advanced)

with agentwatch.run("my-agent") as run:
    run.log_llm(model="gpt-4o-mini", input_tokens=120, output_tokens=40, output="Hello!")
    run.log_tool("search", input_data={"q": "hello"}, output_data={"results": []})

Framework-agnostic API

  • agentwatch.run(...) — context manager
  • run.log_llm(...) — LLM step with token/cost tracking
  • run.log_tool(...) — tool call step
  • agentwatch.track(...) — decorator
  • agentwatch.instrument_openai(client) — auto-log OpenAI calls

See the full docs at agentwatch.in.

Releasing a new version

PyPI never allows re-uploading the same version number.

  1. Bump version in pyproject.toml and agentwatch/__init__.py
  2. cd sdk && python -m build
  3. twine check dist/*
  4. Upload to TestPyPI first: twine upload --repository testpypi dist/*
  5. After verification, upload to PyPI: twine upload dist/*

See CONTRIBUTING.md for details.

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

agentwatch_observe-0.1.1.tar.gz (14.3 kB view details)

Uploaded Source

Built Distribution

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

agentwatch_observe-0.1.1-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file agentwatch_observe-0.1.1.tar.gz.

File metadata

  • Download URL: agentwatch_observe-0.1.1.tar.gz
  • Upload date:
  • Size: 14.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for agentwatch_observe-0.1.1.tar.gz
Algorithm Hash digest
SHA256 73ea955a70bdf5146bb7ad15e33146e7201518b8e3dcda5ab8cf06411dda45b8
MD5 0aef4d478b5f612be9ba377e08e12310
BLAKE2b-256 eb8bd0d1a2f88389148ce94d69d40ef668b28ca70dba270cd7016161552a981e

See more details on using hashes here.

File details

Details for the file agentwatch_observe-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for agentwatch_observe-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4347d4273c77377b763ffda572bc74ee2996d48fc2b22f6cc752cd542baa93b6
MD5 b2911d42cc95fdd199eaa1215f74555d
BLAKE2b-256 c1e8d1d90417893a0083ff144ad672ca759cfb842eabc000a77c5e71739c3f84

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