Multi-Tool Recovery Demo
This demo shows how StateBase handles a realistic production scenario: an AI travel agent that needs to call multiple external APIs (flights, hotels, weather) to complete a bookingβand what happens when those APIs fail.The Scenario
User Goal: Book a weekend trip to San Francisco Agent Tasks:- Search for flights
- Check hotel availability
- Get weather forecast
- Confirm booking
Without StateBase: Cascading Failures
Hereβs what happens in a traditional agent when APIs fail:With StateBase: Graceful Recovery
StateBase checkpoints progress after each successful step:The Recovery Flow
Hereβs what happens behind the scenes:Attempt 1: Partial Success
Attempt 2: Full Success
Code Walkthrough
Letβs break down the key StateBase features used:1. Checkpointing After Each Step
2. Checking for Cached Data
3. Graceful Degradation
4. Rollback on Critical Failures
Full Working Example
Hereβs a complete, runnable example:Key Takeaways
- Checkpoint after each successful step β Donβt lose progress
- Check cache before retrying β Save money and time
- Distinguish critical vs optional β Graceful degradation
- Roll back on corruption β Prevent cascading failures
Try It Yourself
- Copy the code above
- Replace
"your-key"with your StateBase API key - Run it multiple times to see different failure scenarios
- Observe how StateBase preserves progress across retries
Next Steps
- Checkpoints & Rollbacks: Deep dive into recovery strategies
- Failure Modes: Learn all 7 common failure patterns
- Tool Calling Pattern: Best practices for external API calls
The Bottom Line: Production AI agents deal with unreliable external systems. StateBase ensures that one API timeout doesnβt force users to start over from scratch.