Hello,
I have some (potentially basic) questions about memory, but I’m having trouble finding clear answers in the documentation or threads.
I’m not sure if anyone has already looked into these topics.
what I understand so far:
- Short-term memory & entity memory: Allow agents to maintain context, share their results, and collaborate within a single crew execution.
- Long-term memory: Stores various results from the crew or agents over time and retrieves them for improvement purposes.
Maintaining context across multiple executions
It is mentioned that combining these different memory types enables the crew to maintain context within a single execution as well as across multiple executions (essentially within a conversation). However, when I queried the CrewAI codebase with a cursor chatbot about memory, it mentioned that the primary goal of these memory systems is not to maintain a conversational history or contextual memory between the user and the crew.
- Given this, would it be advisable to complement CrewAI’s memory system with another conversation history tracking? (For example: passing the last 30 messages between the user and the assistant to the crew) in order to ensure a consistent conversation context for each user, with a minimum contextual window.
Memory isolation in multi-user environments
In a multi-user setup, are CrewAI’s memory systems isolated per user?
For instance, if:
- User A states that they are looking for a primary residence in France, and
- User B states that they are looking for a secondary residence in Spain,
- If both requests happen at the same time or close to each other, could there be a risk of context mixing between A and B?
Would this lead to execution issues, where Crew A and Crew B could mix their context and tasks results, causing incorrect answers to be given to users?
- Is it relevant to implement a filtering system based on
user_id
orsession_id
when handling CrewAI memory? - Alternatively, would it be best to run one execution per instance, ensuring that there is only one active crew per user at a time, and resetting short-term and entity memory after each execution? Several Cloud Run instances with 1 execution at a time for example.
- This way, STM and entity memory would only persist for a single execution per user, reducing the risk of cross-contamination.
Thanks for your help !