Skip to main content

Observability and reliability platform for agentic AI systems

Project description

Anjor

CI Coverage Python License: MIT

Observability and intelligence for AI agents. One-line install. No cloud. No account required.

Anjor 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 how you build. In Phase 3 it moves from passive logging to active recommendations: failure pattern clustering, token optimization suggestions, and per-tool quality scores.


Install

pip install anjor

Quickstart

1. Start the local collector (stores events to SQLite):

python scripts/start_collector.py

2. Add one line to your agent:

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

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

3. (Optional) Start the local dashboard:

bash scripts/start_dashboard.sh   # opens http://localhost:7844

4. Query data directly:

curl http://localhost:7843/health
curl http://localhost:7843/tools
curl http://localhost:7843/intelligence/failures    # Phase 3: failure patterns
curl http://localhost:7843/intelligence/quality/tools   # Phase 3: quality scores

No API key? Use respx to replay a mock response — see the quickstart guide.


What it captures

Signal Phase Details
Tool calls 1 Name, status (success/failure), failure type
Schema fingerprints 1 SHA-256 structural hash of tool input/output shape
Schema drift 1 Field-level diff against the baseline for each tool
Latency 1 Per-call and aggregated (p50/p95/p99)
LLM calls 2 Model, latency, finish reason — for every Anthropic /v1/messages call
Token usage 2 Input + output + cache_read tokens per call
Context window 2 Tokens used vs model limit, utilisation %, per-trace growth rate
Context hogs 2 Per-tool average output size, % of context consumed
System prompt drift 2 SHA-256 per agent — alerts when prompt changes between calls
Trace context 1–2 Trace ID, session ID, agent ID — consistent across LLM + tool events
Failure patterns 3 Clustered failure analysis with natural-language descriptions and fix suggestions
Token optimization 3 Tools consuming >5% of context window, estimated token waste and cost savings
Quality scores 3 Per-tool reliability/schema-stability/latency-consistency grade (A–F)
Run quality 3 Per-trace context efficiency, failure recovery, tool diversity grade (A–F)

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))

What is NOT in v0.3

  • No multi-agent tracing (Phase 4)
  • No cloud sync, authentication, or team management
  • requests library not intercepted (Anthropic SDK uses httpx by default)
  • OpenAI parser not implemented (stub only)
  • Intelligence suggestions are heuristic — no LLM-powered explanations yet

Development

git clone https://github.com/anjor-labs/anjor.git
cd anjor
bash scripts/dev_setup.sh   # creates .venv, installs deps
source .venv/bin/activate
.venv/bin/pytest            # ≥95% coverage enforced
ruff check .                # zero lint errors
mypy anjor/            # strict type checking

See CONTRIBUTING.md for full guidelines.


Documentation


License

MIT © Anjani Kumar

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.3.0.tar.gz (44.5 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.3.0-py3-none-any.whl (58.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: anjor-0.3.0.tar.gz
  • Upload date:
  • Size: 44.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for anjor-0.3.0.tar.gz
Algorithm Hash digest
SHA256 c8cf8649a193820fda8280f2f9bbf3807341075b1c25c8fc726f319333b8f263
MD5 b5a6b47bbe63bc5457acc41523b4be6d
BLAKE2b-256 042ce8633820e3f8c720725437a5440356590240170d69971bad4accce375b50

See more details on using hashes here.

File details

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

File metadata

  • Download URL: anjor-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 58.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for anjor-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f8a352b4dbe1a7356aa433ddb2fb835a76e4cca47961c8a89e9deb992c23b5f4
MD5 94ddab73deffca70f3f126c2ea6704e8
BLAKE2b-256 68bb0310e5091d0d3ba1a55c935a5c9f0caad540d2e0908ac69bbb099253556d

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