The persistent state management(save_state) enhanced by TTL policy #6169
Replies: 2 comments 6 replies
-
I feel this can follow once we have a persistent layer for teams, e.g., rather than using the in-memory state, we always persist state in a storage while running. TTL could be then something implemented with that persistent layer. I feel this is beyond the prototyping stage. Curious what is your scenario for needing this type of feature? |
Beta Was this translation helpful? Give feedback.
-
Hi, @ekzhu . from datetime import datetime, timezone
class BaseChatMessage(BaseMessage, ABC):
created_at: datetime = Field(default_factory=lambda: datetime.now(timezone.utc))
...
class BaseAgentEvent(BaseMessage, ABC):
created_at: datetime = Field(default_factory=lambda: datetime.now(timezone.utc))
... This is so simple that we don't have to change the internal structure of AutoGen too much. If you think this suggestion has no problem, I'll create a new PR. Thanks. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, AutoGen team.
I already know about
team.save_state()
andteam.load_state()
from https://microsoft.github.io/autogen/stable/user-guide/agentchat-user-guide/tutorial/state.html#saving-and-loading-teams. However, if we use persistent state through external DB, all conversation history will be stored in message_thread, which will affect the storage capacity of external DB.So I suggest adding a new TTL policy to the state management of AutoGen. Each item stored in message_thread has a timestamp, and AutoGen does not store items smaller than a specific timestamp when users call
team.save_state()
.Is there a better way? Thanks.
Beta Was this translation helpful? Give feedback.
All reactions