v2.9.0
What's New
Pluggable memory: BaseChatHistory
You can now plug in your own chat history backend (persistent, database-backed, whatever you need) instead of being stuck with the built-in in-memory store.
BaseChatHistory is an interface-only abstract base class that declares the memory contract AtomicAgent depends on. ChatHistory is now the built-in implementation of it, and AgentConfig.history is typed to the base class, so any conforming backend drops straight in.
Features
- New
BaseChatHistoryABC inatomic_agents.contextdefining the full memory contract (add_message,get_history, turn handling,dump()/load(),copy(), plus thehistory/current_turn_idattributes). - New
persistent-memoryexample: a SQLite-backed history in ~40 lines using only the standard library, keyed bysession_id. Run it twice and the conversation rehydrates. - New "Writing a Custom Memory Backend" guide section.
Improvements
AgentConfig.historynow accepts anyBaseChatHistory, not justChatHistory.- Fixed a footgun where a provided-but-falsy custom history (e.g. one defining
__len__) could be silently discarded and replaced with a fresh in-memory store.
This release is fully backwards compatible. Existing code using ChatHistory keeps working unchanged, since ChatHistory now subclasses BaseChatHistory.