Skip to main content

Observability and reliability platform for agentic AI systems

Project description

Anjor

CI Coverage PyPI Python License: MIT

AI agents fail silently. A tool times out, a schema drifts, the context window fills up — and you find out from a user complaint, not a dashboard.

Anjor fixes that. It intercepts your agent's HTTP traffic at the protocol layer and gives you full visibility into every LLM call and tool use — latency, token usage, context window growth, schema drift, prompt changes — without changing a single line of your agent code. Beyond passive logging, it surfaces actionable intelligence: failure pattern clustering, token optimization suggestions, and per-tool quality grades (A–F).

One-line install. No cloud. No account required.


Install

pip install anjor

Quickstart

1. Start the collector and dashboard (one command, one port):

anjor start
# Anjor collector  http://localhost:7843/health
# Anjor dashboard  http://localhost:7843/ui/

2. Add one line to your agent:

import anjor
anjor.patch()   # that's it — httpx is now instrumented

import anthropic
client = anthropic.Anthropic()
# make calls as normal — they're captured automatically

Open http://localhost:7843/ui/ to see the dashboard.

3. Query the API directly:

curl http://localhost:7843/health
curl http://localhost:7843/tools
curl http://localhost:7843/intelligence/failures
curl http://localhost:7843/intelligence/quality/tools

What it captures

Signal Details
Tool calls Name, status (success/failure), failure type
Schema fingerprints SHA-256 structural hash of tool input/output shape
Schema drift Field-level diff against the baseline for each tool
Latency Per-call and aggregated (p50/p95/p99)
LLM calls Model, latency, finish reason — Anthropic, OpenAI, and Gemini
Token usage Input + output + cache_read tokens per call
Context window Tokens used vs model limit, utilisation %, per-trace growth
Context hogs Per-tool average output size, % of context consumed
System prompt drift SHA-256 per agent — alerts when prompt changes between calls
Failure patterns Clustered failure analysis with descriptions and fix suggestions
Token optimization Tools consuming >5% of context window, cost savings estimates
Quality scores Per-tool reliability/schema-stability/latency grade (A–F)
Run quality Per-trace context efficiency, failure recovery, diversity grade
Multi-agent spans Parent/child span linking across agent boundaries
Trace graphs DAG reconstruction, topological order, cycle detection
Cross-agent attribution Token usage and failure rate broken down per agent

Supported providers

Provider SDK Intercepted endpoint
Anthropic anthropic api.anthropic.com/v1/messages
OpenAI openai api.openai.com/v1/chat/completions
Google Gemini google-generativeai generativelanguage.googleapis.com/.../generateContent

All three providers are auto-detected — no configuration required.


Configuration

Via environment variables:

ANJOR_DB_PATH=./my_project.db python my_agent.py
ANJOR_BATCH_SIZE=1 ANJOR_BATCH_INTERVAL_MS=100 python my_agent.py
ANJOR_LOG_LEVEL=DEBUG python my_agent.py

Via .anjor.toml in your project root:

db_path = "my_project.db"
batch_size = 10
batch_interval_ms = 200
log_level = "DEBUG"

Via code:

import anjor
from anjor.core.config import AnjorConfig

anjor.patch(config=AnjorConfig(db_path="my_project.db", batch_size=1))

Limitations

  • requests library not intercepted — all three provider SDKs use httpx by default
  • Streaming responses are not parsed; only non-streaming calls are captured
  • No cloud sync, authentication, or team features

Development

git clone https://github.com/anjor-labs/anjor.git
cd anjor
pip install -e ".[dev]"
pytest --cov=anjor --cov-fail-under=95 -q
ruff check anjor/ tests/
mypy anjor/
anjor start

See CONTRIBUTING.md for full guidelines.


Documentation


Contributing & Contact

License

MIT © Anjor Labs

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

anjor-0.5.1.tar.gz (68.3 kB view details)

Uploaded Source

Built Distribution

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

anjor-0.5.1-py3-none-any.whl (97.5 kB view details)

Uploaded Python 3

File details

Details for the file anjor-0.5.1.tar.gz.

File metadata

  • Download URL: anjor-0.5.1.tar.gz
  • Upload date:
  • Size: 68.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for anjor-0.5.1.tar.gz
Algorithm Hash digest
SHA256 091c542d1288e1eaaec802e8b788d1125bf5701859d89e9c35d05ef2e5440e8c
MD5 65fc1d3a260b870e4523f58a5aec0cb5
BLAKE2b-256 51946ed9b4cdd5e861472931da03a176dffa01db55f302b531adb6832b90b5a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for anjor-0.5.1.tar.gz:

Publisher: publish.yml on anjor-labs/anjor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file anjor-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: anjor-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 97.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for anjor-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7e4b2b2adde1f3c6bdd7bee60f08ae95f4da8765ef999ce4b202275cbbb37511
MD5 d1bc314279b65e3479595884a2aad223
BLAKE2b-256 f2355e93920b9e43db99fadd9b69098babc4cb76f9bd890c8df01f5e9138b6bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for anjor-0.5.1-py3-none-any.whl:

Publisher: publish.yml on anjor-labs/anjor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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