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 (under 10 lines)
import agentwatch
agentwatch.init(
api_key="YOUR_AGENTWATCH_API_KEY",
base_url="https://api.agentwatch.in", # or http://localhost:8000 for local dev
)
with agentwatch.run("my-agent") as run:
run.log_llm(
model="gpt-4o-mini",
input_tokens=120,
output_tokens=40,
output="Hello from AgentWatch!",
)
Open the AgentWatch dashboard → Runs to see the trace.
Local model example (Ollama)
import requests
import agentwatch
agentwatch.init(api_key="YOUR_AGENTWATCH_API_KEY", base_url="http://localhost:8000")
def call_local_model(prompt: str) -> str:
response = requests.post(
"http://localhost:11434/api/generate",
json={"model": "llama3", "prompt": prompt, "stream": False},
timeout=60,
)
response.raise_for_status()
return response.json()["response"]
with agentwatch.run("my-local-agent") as run:
prompt = "Summarize observability in one sentence."
reply = call_local_model(prompt)
run.log_tool(
"ollama:llama3",
input_data={"prompt": prompt},
output_data={"reply": reply},
)
Framework-agnostic API
agentwatch.run(...)— context managerrun.log_llm(...)— LLM step with token/cost trackingrun.log_tool(...)— tool call stepagentwatch.track(...)— decoratoragentwatch.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.
- Bump
versioninpyproject.tomlandagentwatch/__init__.py cd sdk && python -m buildtwine check dist/*- Upload to TestPyPI first:
twine upload --repository testpypi dist/* - After verification, upload to PyPI:
twine upload dist/*
See CONTRIBUTING.md for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agentwatch_observe-0.1.0.tar.gz.
File metadata
- Download URL: agentwatch_observe-0.1.0.tar.gz
- Upload date:
- Size: 13.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abf1e47d882f46186e7d33c3bd8d4ba752f7cf97abddf20f4a15f9893388b9a7
|
|
| MD5 |
8a3283e729bb11bdfc947e7496419acc
|
|
| BLAKE2b-256 |
fb39f3969f9c7ffa7f6205417237f319558670965760988bab56b0f13fde0aea
|
File details
Details for the file agentwatch_observe-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agentwatch_observe-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
092ad62c2ff5b876b28acd534f1744cb8d0b7ac183708781be73b431a3f11d38
|
|
| MD5 |
c9b75eb460a4ca8d090e1272458c4a3c
|
|
| BLAKE2b-256 |
a81cbbe6f2f24b34cd3af8d77f1eabe2908b2f28dccaff3991ae4d1837b840bb
|