GitHub for agent behavior

Fork, diff, test, and roll back agent behavior — just like code.

Designed for multi-step, tool-using, stateful systems.

Router v2.1
Agent Run
web_search
web_search
web_search
3 redundant tool calls
Analysis
Subtext Insight
Tool: web_search
Called 3x/run
80% unnecessary
Suggestion:
"Limit to 1x"
Router v2.2
Optimized
web_search
1 tool call
40% cheaper
2x faster

Subtext detects redundant tool calls and helps you optimize agent behavior

Everything you need to ship reliable agents

From local development to production monitoring, Subtext gives you visibility and control over your AI agents.

Version Control for Agents

Track every change to your agent's behavior. See exactly what changed between runs.

Behavioral Comparison

Compare versions by success rate, cost, and tool usage — not just text diffs.

Instant Rollback

Something broke? Roll back to a working version in one click.

How it works

Get started in minutes with just a few lines of code

1

Instrument your agent

Add the @trace decorator to your agent function

@trace(subtext, prompt="router")
def route_ticket(ticket: str):
    response = client.messages.create(...)
    return response
2

Run your agent

Every execution is automatically captured with full context

result = route_ticket("Help with billing")
# ✓ Trace captured automatically
# ✓ Tokens, cost, duration tracked
# ✓ Version created on changes
3

Compare & optimize

See behavioral metrics, get AI recommendations, rollback if needed

Compare v1.2 vs v1.3:
✓ Success rate: 85% → 92%
✓ Avg cost: $0.08/1K → $0.05/1K
✓ Tool calls: 3x → 1x

Ready to ship better agents?

Join developers who are using Subtext to build reliable AI agents.

Get Started Free