Provides PersistentAgent class for Agent classes with persistent state (#603)#604
Provides PersistentAgent class for Agent classes with persistent state (#603)#604kiranandcode wants to merge 12 commits intomasterfrom
PersistentAgent class for Agent classes with persistent state (#603)#604Conversation
|
I don't think |
|
@eb8680 , Hmm, yeah, that makes sense. I opted for class based state first because that makes tracking histories a little easier as a first pass than using a global handler and then re-associating calls to specific agents, but a global handler might be cleaner. Will refactor. |
…ntegration tests due to weaker models
…d docs - Changed PersistenceHandler to accept db_path (Path to .db file) instead of persist_dir (directory), making the API explicit - Removed in-memory caching of handoffs and loaded sets; all state is now read from/written to SQLite directly (thread-local loaded tracking remains) - Made ensure_loaded and get_handoff private (_ensure_loaded, _get_handoff) - Added crash recovery example to docstring - Updated all tests to use new db_path API and reduced LLM call budgets for faster test execution Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This PR provides a subclass to the effectful API which allows users to create
PersistentAgents who store their state to file and can be restored and resumed on crash. These agents also compact and restore their context. Closes #603See
docs/source/multi_agent_example.pyfor an example of a non-trivial multi-agent workflow involving three agents doing a larger library task. This code is fairly robust, involves several agents, and can be Ctrl-C'd and restarted on demand.