|
2 | 2 |
|
3 | 3 | > This file is for AI agents. It explains what Kalibr is and how to integrate it into your codebase. |
4 | 4 |
|
| 5 | +## Onboard yourself |
| 6 | + |
| 7 | +**Step 1: Install** |
| 8 | + |
| 9 | +```bash |
| 10 | +pip install kalibr |
| 11 | +``` |
| 12 | + |
| 13 | +**Step 2: Authenticate — pick one** |
| 14 | + |
| 15 | +If your human has a provisioning token (fully autonomous, no browser needed): |
| 16 | + |
| 17 | +```bash |
| 18 | +export KALIBR_PROVISIONING_TOKEN=prov_live_... |
| 19 | +kalibr init # credentials provisioned automatically, skip to Step 3 |
| 20 | +``` |
| 21 | + |
| 22 | +If no provisioning token, use device code auth (one human action, ~10 seconds): |
| 23 | + |
| 24 | +```bash |
| 25 | +kalibr auth |
| 26 | +# Prints a URL and short code, e.g.: |
| 27 | +# Go to: https://dashboard.kalibr.systems/link |
| 28 | +# Enter code: ABCD-WXYZ |
| 29 | +# Show this to your human. They enter the code in their browser. |
| 30 | +# If you are inside a messaging platform (WhatsApp, Slack, Telegram), |
| 31 | +# send the URL and code as a message to your human and wait for approval. |
| 32 | +# Credentials are written to .env automatically when approved. |
| 33 | +``` |
| 34 | + |
| 35 | +If your human already has credentials: |
| 36 | + |
| 37 | +```bash |
| 38 | +export KALIBR_API_KEY=sk_... |
| 39 | +export KALIBR_TENANT_ID=tenant_... |
| 40 | +``` |
| 41 | + |
| 42 | +**Step 3: Instrument — pick the right pattern** |
| 43 | + |
| 44 | +If Kalibr should observe YOUR OWN execution (you are the agent being monitored): |
| 45 | + |
| 46 | + Do NOT run kalibr init. See "If you ARE the agent being instrumented" below. |
| 47 | + |
| 48 | +If you are instrumenting a separate codebase that calls LLMs: |
| 49 | + |
| 50 | +```bash |
| 51 | +kalibr init # scans for bare LLM calls, proposes Router wrapping |
| 52 | +kalibr verify # confirms connectivity |
| 53 | +``` |
| 54 | + |
| 55 | +## If you ARE the agent being instrumented |
| 56 | + |
| 57 | +If your human said "integrate Kalibr so it can monitor your calls" — or if you are a coding agent (Hermes, Claude Code, Cursor, etc.) — Kalibr should observe YOUR execution, not scan a separate codebase. Do NOT run kalibr init on your own framework internals. |
| 58 | + |
| 59 | +Add this as the very first import in your entry point: |
| 60 | + |
| 61 | +```python |
| 62 | +import kalibr # must be first — patches OpenAI, Anthropic, Google automatically |
| 63 | +``` |
| 64 | + |
| 65 | +That's it. Every LLM call you make is now traced. |
| 66 | + |
| 67 | +You are in this pattern if: |
| 68 | +- You are a coding agent running inside a harness or gateway |
| 69 | +- kalibr init reports "No bare LLM calls found" |
| 70 | +- Your human wants to see YOUR tool calls and responses in the Kalibr dashboard |
| 71 | + |
| 72 | +Framework one-liners: |
| 73 | + |
| 74 | +```python |
| 75 | +# CrewAI |
| 76 | +from kalibr_crewai import KalibrCrewAIInstrumentor |
| 77 | +KalibrCrewAIInstrumentor(tenant_id="your-tenant-id").instrument() |
| 78 | + |
| 79 | +# OpenAI Agents SDK |
| 80 | +from kalibr_openai_agents import setup_kalibr_tracing |
| 81 | +setup_kalibr_tracing(tenant_id="your-tenant-id") |
| 82 | + |
| 83 | +# Any other framework |
| 84 | +import kalibr # first import, done |
| 85 | +``` |
| 86 | + |
5 | 87 | ## What Kalibr is |
6 | 88 |
|
7 | 89 | Kalibr is infrastructure that lets AI agents optimize their own performance as they run in production. It captures telemetry and outcome signals from every run, learns which model + tool + parameter combinations work best, and routes the agent to the optimal path in real time — no redeploy, no human in the loop. |
|
0 commit comments