Memory options for singular agents

Dear CrewAI Community,

I have a question regarding memory options for standalone agents

While the ‘Agent’ section in the CrewAI Documentation mentions standalone agents having a memory setting, Agent’s aren’t able to save their output to memory. It appears that memory is limited to entire crews, and not standalone agents.

Even external memory is only accessible to crews, and not standalone agents.

For my personal use case, I am implementing a flow which consists of 2 agents and 2 crews. I intend to have both the agents and both the crews have access to a common memory pool. In this case, what approach should I take to give my agents access to the same external memory as my crews?

One idea I have is: the knowledge attribute for Agents is somewhat similar to memory for Crews, since both are converted into vector DBs for the Agent / Crew to conduct a semantic search during their execution. As such, what if I:

  1. Create a vector collection to store information
  2. Configure both the agent and crews to use the same vector collection
  3. The Agent will use this collection as its knowledge base
  4. The Crews will use this collection as their external_memory
# Configure the same storage location for both systems
shared_storage_config = {
    "provider": "your_provider",
    "config": {
        "collection_name": "shared_knowledge_memory",
        # other shared settings
    }
}

agent = Agent(
    role="Specialist",
    embedder=shared_storage_config
)

# Crew with external memory pointing to same storage
external_memory = ExternalMemory(
    embedder_config=shared_storage_config  # Same configuration
)

crew = Crew(
    agents=[agent],
    external_memory=external_memory,
    tasks=[...]
)

This is assuming that agent knowledge and crew memory is treated in a similar manner by crewai.

Great question. I have found using an external memory like Mem0 useful when sharing memory with different crews Memory - CrewAI

You can link memory in hierarchies that can be very handy