Skip to content

v2.9.0

Choose a tag to compare

@Eigenwise Eigenwise released this 09 Jul 12:52

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 BaseChatHistory ABC in atomic_agents.context defining the full memory contract (add_message, get_history, turn handling, dump()/load(), copy(), plus the history/current_turn_id attributes).
  • New persistent-memory example: a SQLite-backed history in ~40 lines using only the standard library, keyed by session_id. Run it twice and the conversation rehydrates.
  • New "Writing a Custom Memory Backend" guide section.

Improvements

  • AgentConfig.history now accepts any BaseChatHistory, not just ChatHistory.
  • 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.

Full Changelog

v2.8.1...v2.9.0