You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is the concept of storage and the concept of memory. There appears to be an unintended overlap between them which pulls user memories into session storage even if the conversation or tasks are unrelated.
Steps to Reproduce
Create an agent using storage and memory with multiple chat sessions.
If a session results in 'user' memory being updated that update will be pulled into sessions as 'session memory'.
Agent Configuration (if applicable)
agent = Agent(
telemetry=False,
user_id="[email protected]",
model=Gemini(
id=model,
generation_config=generation_config,
safety_settings=safety_settings,
system_prompt=system_prompt,
),
storage=FirestoreAgentStorage(
collection_name="agent_sessions",
),
# Store memories in Firestore, options off
memory=AgentMemory(
db=FirestoreMemoryDb(),
create_user_memories=True,
create_session_summary=True,
update_user_memories_after_run=True,
update_session_summary_after_run=True,
classifier=MemoryClassifier(model=Gemini(id="gemini-1.5-pro")),
summarizer=MemorySummarizer(model=Gemini(id="gemini-1.5-pro")),
manager=MemoryManager(model=Gemini(id="gemini-1.5-pro")),
),
# Set add_history_to_messages=true to add the previous chat history to the messages sent to the Model.
add_history_to_messages=True,
# Number of historical responses to add to the messages.
num_history_responses=10,
create_default_user_message=False,
retries=3,
instructions=system_prompt,
markdown=True,
)
Expected Behavior
I expected the user memory store to updated with key facts about the user (name, interests, etc) and the session memory store to remain relevant to the session.
Actual Behavior
The user memory store was updated according to a conversation in a session. That session included the memories.
When starting another conversation in a different session, the memories from the user were imported into this session but we not relevant.
Screenshots or Logs (if applicable)
User memory after a conversation about beer:
Session data object after the same conversation:
Session data after a subsequent conversation about whiskey:
Later when the agent saves it's information to storage, this is used as 'memories' in the session data object.
Could there be a flag to not store user memory in the session? This would make it clear that they are only related to the user and not the session.
Could there be a better prompt for user memory such that it is less about the conversation and more about the facts (name, likes, etc)? This way it would be less likely to influence the session conversation.
Additional Context
This could lead to confusing inferences from the model if it stores data in one context, but uses it in another session inappropriately.
The text was updated successfully, but these errors were encountered:
Description
There is the concept of storage and the concept of memory. There appears to be an unintended overlap between them which pulls user memories into session storage even if the conversation or tasks are unrelated.
Steps to Reproduce
Create an agent using storage and memory with multiple chat sessions.
If a session results in 'user' memory being updated that update will be pulled into sessions as 'session memory'.
Agent Configuration (if applicable)
Expected Behavior
I expected the user memory store to updated with key facts about the user (name, interests, etc) and the session memory store to remain relevant to the session.
Actual Behavior
The user memory store was updated according to a conversation in a session. That session included the memories.
When starting another conversation in a different session, the memories from the user were imported into this session but we not relevant.
Screenshots or Logs (if applicable)
User memory after a conversation about beer:
Session data object after the same conversation:
Session data after a subsequent conversation about whiskey:
Environment
Possible Solutions (optional)
I believe this is happening due to the agent.get_agent_session pulling in memories from the user memory store
https://github.com/agno-agi/agno/blob/main/libs/agno/agno/agent/agent.py#L1453
'Memory' is stored and retrieved by user id. https://github.com/agno-agi/agno/blob/main/libs/agno/agno/memory/db/mongodb.py#L71
'Session' storage is by session ID and user idbut due to the call above in get_agent_session it imports user memories. https://github.com/agno-agi/agno/blob/main/libs/agno/agno/storage/agent/mongodb.py#L61
Later when the agent saves it's information to storage, this is used as 'memories' in the session data object.
Could there be a flag to not store user memory in the session? This would make it clear that they are only related to the user and not the session.
Could there be a better prompt for user memory such that it is less about the conversation and more about the facts (name, likes, etc)? This way it would be less likely to influence the session conversation.
Additional Context
This could lead to confusing inferences from the model if it stores data in one context, but uses it in another session inappropriately.
The text was updated successfully, but these errors were encountered: