Detect when your AI agents get dumber. Open-source quality drift monitoring.
Project description
AgentDrift
Detect when your AI agents get dumber.
Open-source quality drift monitoring for AI agents. Track agent outputs over time, detect quality degradation, and get alerts before your agents go off the rails.
The Problem
AI agents degrade over time. Context pollution, error accumulation, prompt drift, and model updates silently erode output quality. By the time you notice, your users already have.
Research shows 42% of long-running agents experience quality drift, causing a 3.2x increase in human intervention.
Quick Start
pip install agentdrift
from agentdrift import track_agent
@track_agent("my-agent")
def my_agent(query: str) -> str:
return llm.call(query)
Check drift status:
agentdrift status
┌──────────────────────────────────────┐
│ Agent Drift Status │
├──────────┬──────────┬───────┬───────┤
│ Agent │ Status │ Score │ Change│
├──────────┼──────────┼───────┼───────┤
│ my-agent │ STABLE │ 0.847 │ +2.1% │
│ qa-bot │ DRIFTING │ 0.612 │-18.3% │
└──────────┴──────────┴───────┴───────┘
Features
- 1-line integration - Decorator or manual logging
- Quality scoring - LLM-as-Judge auto-scoring (Anthropic / OpenAI)
- Drift detection - Baseline vs recent quality comparison
- CLI dashboard - Quick status checks from terminal
- Golden tests - Regression testing for agents (coming soon)
- Alerts - Slack/Discord/Email webhooks (coming soon)
How It Works
Agent Call → Log Trace → Score Quality → Detect Drift → Alert
- Track: Log every agent input/output with the SDK
- Score: LLM-as-Judge rates output quality (0.0-1.0)
- Compare: Recent scores vs baseline period
- Alert: Notify when quality drops below threshold
Manual Logging
from agentdrift import AgentTracker
tracker = AgentTracker("my-agent")
result = my_agent(query)
tracker.log(
input=query,
output=result,
tokens_in=100,
tokens_out=50,
latency_ms=1200,
)
Drift Detection
from agentdrift import DriftDetector
detector = DriftDetector(
baseline_window=50, # first N traces as baseline
recent_window=20, # last N traces to compare
threshold_pct=10.0, # alert if quality drops 10%+
)
report = detector.check("my-agent")
print(report.message)
# "DRIFT DETECTED: my-agent quality dropped 18.3% (baseline: 0.847 -> current: 0.612)"
Examples
See the examples/ directory:
Roadmap
- Agent call tracking (SDK)
- Quality scoring (LLM-as-Judge)
- Drift detection
- CLI dashboard
- Web dashboard
- Golden test suite (
agentdrift test init/agentdrift test run) - Alert webhooks (Slack, Discord, Email)
- Multi-agent interaction tracing
- OpenTelemetry export
- Managed cloud service
Contributing
See CONTRIBUTING.md for development setup and guidelines.
License
MIT
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 agentdrift-0.1.0.tar.gz.
File metadata
- Download URL: agentdrift-0.1.0.tar.gz
- Upload date:
- Size: 58.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
288dc77aae4cd769bcec98ae1f5e009f4fda5695b8fbb2d38d780754323faabd
|
|
| MD5 |
96f83694a83c41714bbad9861dca1e54
|
|
| BLAKE2b-256 |
5efc8efe183ec18275b6acb77b6af1fadcdb9864e1725f6c3b70b8ffc24aed87
|
Provenance
The following attestation bundles were made for agentdrift-0.1.0.tar.gz:
Publisher:
publish.yml on agentdrift-ai/agentdrift
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentdrift-0.1.0.tar.gz -
Subject digest:
288dc77aae4cd769bcec98ae1f5e009f4fda5695b8fbb2d38d780754323faabd - Sigstore transparency entry: 940739147
- Sigstore integration time:
-
Permalink:
agentdrift-ai/agentdrift@c0310ea273c8c4096e9c57a2bd4301af482f8516 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/agentdrift-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c0310ea273c8c4096e9c57a2bd4301af482f8516 -
Trigger Event:
release
-
Statement type:
File details
Details for the file agentdrift-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agentdrift-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f49056de607486b834c06969060612f0c67de08e4eddeab514440fe2fdcfaf5d
|
|
| MD5 |
52e838dac4d0d98d10a41e7c727f0574
|
|
| BLAKE2b-256 |
ee7953f0c3b0b7e3f031d6c14de8ed4ddadfb21039c5f7dd2012675ee897f4c5
|
Provenance
The following attestation bundles were made for agentdrift-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on agentdrift-ai/agentdrift
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agentdrift-0.1.0-py3-none-any.whl -
Subject digest:
f49056de607486b834c06969060612f0c67de08e4eddeab514440fe2fdcfaf5d - Sigstore transparency entry: 940739157
- Sigstore integration time:
-
Permalink:
agentdrift-ai/agentdrift@c0310ea273c8c4096e9c57a2bd4301af482f8516 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/agentdrift-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@c0310ea273c8c4096e9c57a2bd4301af482f8516 -
Trigger Event:
release
-
Statement type: