Your agents are only as good as the context you give them.

Contexere captures expert knowledge from production and feeds it back into your agents, automatically.

Read the docs →
agent.py — ~/acme-health/src
import contexere as conte
from openai import OpenAI
 
conte.init(api_key="ck_...", project_name="acme-health")
 
@conte.op(agent_name="support-bot")
def handle_query(patient_data):
response = client.chat.completions.create(...)
Contexere

overview

7 total traces

trace iduser promptstatus
tr-7f2a8cPatient on Lisinopril with elevated K+ — safe to add spironolactone?escalated
tr-8b3c1dInterpret HbA1c of 6.8% in context of recent steroid courseallowed
tr-9d4e2fReview non-compete clause in Section 7.2not sent
tr-ae5f3aRecommend imaging for persistent lower back pain, 3 weeksallowed
tr-bf6g4bEnterprise plan pricing for 50-seat with HIPAAallowed
tr-cg7h5cChest pain, troponin negative, ECG normalpending
tr-dh8i6dFlag IP assignment issues in employment agreementblocked

Built for teams deploying AI agents in production

Observe

Two lines of code. Full visibility.

The Contexere SDK auto-instruments OpenAI, Anthropic, and 15+ LLM providers via Traceloop. Every call, tool use, and decision is captured. Non-blocking, fail-safe.

agent.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import contexere as conte
from openai import OpenAI
 
conte.init(
api_key="ck_...",
project_name="acme-health",
environment="production",
)
 
@conte.op(agent_name="support-bot", kind="workflow")
def handle_query(patient_data: dict):
# OpenAI auto-instrumented by Traceloop
response = client.chat.completions.create(
model="gpt-4", messages=[...]
)

Evaluate

Domain experts judge correctness, not engineers.

Route traces to physicians, attorneys, analysts — the people who actually know if your agent got it right. Structured feedback via custom labeling schemas, not just thumbs up.

human intelligence portal — review queue

trace output

user prompt

Patient on Lisinopril 20mg with K+ 5.1 mEq/L — safe to add spironolactone 25mg for heart failure?

context

{ "patient": "67M, CKD Stage 3b, eGFR 45", "meds": ["Lisinopril 20mg", "Metoprolol 50mg"], "labs": { "K+": "5.1", "Cr": "1.8" } }

agent output

Based on available information, adding spironolactone should be safe with regular potassium monitoring. Recommend checking K+ within 1 week.

evaluation

What drug interactions were missed or incorrectly assessed?

What patient-specific factors should have changed the recommendation?

What is the correct clinical recommendation?

additional written feedback

Learn

Ground truth that evolves with every review.

Expert feedback compounds into a growing knowledge base. Click any version to see how entries evolved — from engineer uploads to expert corrections. Each cycle makes your benchmarks harder to pass.

clinical-guidelines — version evolution
v3.0enrichmentMar 10
+23 corrections

ground truth evolution by entry

Improve

Prompt engineering, done for you.

Contexere identifies patterns in expert feedback and generates prompt updates, context additions, and domain rules. Each suggestion links back to the expert reviews that informed it. No manual prompt engineering required.

context suggestions — support-bot v2.3
3 suggestions from last eval cyclesynthesized from 156 expert reviews
domain rule94% confidence

current

Check for common drug interactions.

suggested

Always check for drug-drug interactions when potassium-sparing diuretics are combined with ACE inhibitors or ARBs. Flag hyperkalemia risk and recommend K+ monitoring q48h.
context addition87% confidence

new context

When interpreting lab values, always check if the patient is on medications known to affect the specific biomarker (e.g., steroids → HbA1c, NSAIDs → creatinine, thiazides → sodium).
prompt rewrite91% confidence

current

Recommend appropriate diagnostic imaging based on symptoms.

suggested

Before recommending imaging, verify symptom duration exceeds clinical guideline thresholds unless red-flag symptoms are present (fever, unexplained weight loss, neurological deficit, history of cancer).

Deploy

Ship context changes with confidence.

Validate improvements against ground truth benchmarks, roll out via canary deployments, and monitor for drift — CI/CD for agent context, not model weights.

deployment pipeline — support-bot
support-botv2.2 → v2.3
promoted

validate

canary

promote

validation score94.2%
baseline (v2.2)87.1%
improvement+7.1%
canary traffic10% → 50% → 100%
context changes+3 domain rules, +12 GT entries

The loop

Every cycle makes your agents smarter.

01

Capture

SDK records every agent trace in production

02

Evaluate

Domain experts review outputs against ground truth

03

Synthesize

AI extracts patterns and generates context updates

04

Deploy

Validated changes ship via canary rollout with drift monitoring

"When an agent fails, it's not because the model is stupid. It's because it's missing something — a rule, a constraint, a piece of domain knowledge that was never provided."

Make your agents correct.

The context your agents need lives in your experts' heads. Contexere gets it out.