Autopilot
Maev Autopilot is the active intervention layer that proxies, analyzes, and optimizes your agent's LLM calls. It utilizes a Hybrid Architecture by coupling our native SDK with a self-improving Gateway.
How the Hybrid Architecture Works
To get absolute control over your agent's execution loop (like local circuit breakers and local tool interceptions), you install the maev-sdk directly into your codebase. When you execute maev.run(agent, gateway=True), it achieves two things simultaneously:
- Client-side Interception: It patches your Python agent loop so Maev can natively intervene if an infinite tool loop occurs or a budget circuit breaker is hit.
- Transparent Proxying: It rewrites the base URL on your LLM client instances to point traffic through
https://gateway.maev.dev/v1— an OpenAI-compatible endpoint that routes to any provider.
Level 1: Immediate Protection
Because the gateway supports all major providers natively, you instantly get:
- Provider Fallbacks: If Anthropic fails, seamlessly route to OpenAI without crashing your agent.
- Auto-Retries: Native retry logic on rate limits or random API drops.
- Full Observability: Every request is captured with its exact latency, cost, and token usage.
Level 2: Automated Self-Reflection (After enough failures)
Once an agent accumulates enough failures, Maev's backend triggers an offline optimization cycle.
- Failure detected via the rules engine.
- The failing prompt and output are analyzed by Maev's backend.
- A new prompt candidate with targeted adjustments is generated automatically.
- The candidate is evaluated offline against past successful runs before being tested.
Level 3: Shadow & Canary Traffic
Once a candidate passes offline evaluation, the Gateway tests it in the real world:
- Shadow Mode: Incoming traffic is duplicated and run against the new candidate. The response is compared to the original, but never returned to the user.
- Canary Promotion: If shadow mode performs well, a small percentage of real traffic is routed to the new candidate.
- Live Promotion: If canary succeeds with higher quality and lower error rates, the new candidate replaces the base prompt entirely.
Observing the Process
Open any session in the Maev dashboard and look for:
- Optimization Activity — See exactly what shadow candidates are currently running in the background.
- Promotions & Rollbacks — Track when your agent gets formally upgraded to a newly generated prompt.
The Hybrid architecture ensures you have deep Python-level execution control (circuit breakers, loop stoppers) locally, while your heavy self-reflection cycles and offline evaluations are safely offloaded to the Gateway layer.