Debugger and monitor for AI agents
Project description
watchagent
watchagent is a debugger and monitor for AI agents.
Core dependencies: anthropic, click, rich, and sqlite3 (built into Python standard library).
Install
pip install watchagent
Quickstart
from watchagent import watch, logger
@watch(name="my-agent", timeout=120, loop_limit=10)
def my_agent(task):
logger.step("Searching web", data={"query": task})
logger.tool_call("browser", input={"query": task}, output={"hits": 3})
logger.llm_call("claude-sonnet-4", input_tokens=450, output_tokens=180)
logger.decision("Route A chosen", reason="fastest path")
return {"done": True}
my_agent("Find 3 product ideas")
Launch the dashboard:
watchagent serve
Production rollout checklist and deployment sequence:
CLI
watchagent list
watchagent show <id>
watchagent cost
watchagent serve
watchagent activate <license-key>
watchagent license-status
watchagent config --slack-webhook <url>
watchagent config --alert-email <email>
watchagent config --team-add <email>
watchagent export --format json --output ./runs.json
Data is stored locally in ~/.watchagent/logs.db.
Plans
Free (default)
- 1 active monitored agent at a time
- 7 days log retention
- Terminal CLI only
- Local SQLite storage
Pro ($15/month)
- Unlimited active monitored agents
- 90 days log retention
- Full web dashboard
- Replay mode
- Slack + email crash alerts
- Team sharing up to 5 members
- CSV/JSON export
License activation
Activate once on the machine:
watchagent activate <license-key>
License checks run on startup and support a 7-day offline grace period.
Encrypted license data is stored in ~/.watchagent/config.json.
Dashboard
watchagent serve starts:
- FastAPI backend on
http://127.0.0.1:8000 - React + Vite dashboard on
http://127.0.0.1:3001
Backend endpoints:
GET /api/runspaginated runs listGET /api/runs/{id}run detailGET /api/runs/{id}/stepsrun stepsGET /api/statstotal runs, success rate, monthly costGET /api/runs/liveSSE stream for live updatesDELETE /api/runs/{id}delete run
The dashboard streams live events and updates timeline steps in real time for running agents.
Alerts
Configure Slack and email alerts:
watchagent config --slack-webhook https://hooks.slack.com/services/...
watchagent config --alert-email ops@example.com
Set environment variable for SendGrid delivery:
SENDGRID_API_KEY=<your_sendgrid_key>
On crash, alerts include agent name, error, AI explanation, and a run dashboard link.
License server + Stripe
A separate FastAPI service for Railway is available in license-server/.
It provides:
POST /api/license/validatePOST /api/license/activateGET /api/license/statusPOST /api/stripe/checkoutPOST /api/stripe/webhook
Webhook flow: successful Stripe checkout issues a license key and emails it via SendGrid.
Crash analysis uses the Anthropic Messages API when ANTHROPIC_API_KEY is set;
otherwise watchagent stores a local fallback explanation.
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 watchagent-0.1.0.tar.gz.
File metadata
- Download URL: watchagent-0.1.0.tar.gz
- Upload date:
- Size: 20.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
464416e2503ca2ac47ca0078a641fc511c69aaddda0261a8b29fd4c9fe8c40f2
|
|
| MD5 |
f8fa565abe1a837dc02b5374637a0d14
|
|
| BLAKE2b-256 |
20537eaafde0d9ab2480f067eba2e9bb8245ce337d8a73afd646dbf3818f225d
|
File details
Details for the file watchagent-0.1.0-py3-none-any.whl.
File metadata
- Download URL: watchagent-0.1.0-py3-none-any.whl
- Upload date:
- Size: 24.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f57782ec8f26fbf543db0df0985101f9ef38ff6dc6c0c4dd4f3a29d64b32f48e
|
|
| MD5 |
a48b08801e2c6778d9c9b0fe15636f84
|
|
| BLAKE2b-256 |
2f329cb46ed798dd5686e79f42707400d693867b27edef14cda5f26a17fb1890
|