Skip to main content
This script demonstrates the “Senior Agent” pattern. It extracts its own state and memory using XML tags and uses StateBase to persist them across turns.

Key Engineering Takeaway

By using this pattern, your application code remains fixed. You can change the agent’s behavior, personality, or state schema entirely by just changing the system prompt—StateBase handles the heavy lifting of storage and retrieval automatically.