Skip to main content
Multi-Agent Memory gives all agents in a workflow access to shared memory, so knowledge discovered by one agent is available to others.
from praisonaiagents import Agent, Task, PraisonAIAgents, MultiAgentMemoryConfig

researcher = Agent(name="Researcher", instructions="Research topics and share findings.")
writer = Agent(name="Writer", instructions="Write based on shared research.")

tasks = [
    Task(description="Research climate change impacts on agriculture", agent=researcher),
    Task(description="Write a policy brief based on the research", agent=writer),
]

workflow = PraisonAIAgents(
    agents=[researcher, writer],
    tasks=tasks,
    memory=MultiAgentMemoryConfig(user_id="project_climate", config={"provider": "rag"}),
)
workflow.start()
The user runs a multi-agent workflow; all agents read and write shared memory under one user id.

Quick Start

1

Simple Usage

from praisonaiagents import Agent, Task, PraisonAIAgents, MultiAgentMemoryConfig

agent1 = Agent(name="Gatherer", instructions="Gather and remember information.")
agent2 = Agent(name="Synthesizer", instructions="Synthesize remembered information.")

tasks = [
    Task(description="Gather key facts about solar energy", agent=agent1),
    Task(description="Create a summary from gathered facts", agent=agent2),
]

workflow = PraisonAIAgents(
    agents=[agent1, agent2],
    tasks=tasks,
    memory=MultiAgentMemoryConfig(user_id="solar_project"),
)
workflow.start()
2

With Custom Embedder

from praisonaiagents import Agent, Task, PraisonAIAgents, MultiAgentMemoryConfig

agents = [
    Agent(name="Expert", instructions="Provide domain expertise."),
    Agent(name="Summarizer", instructions="Summarize expert findings."),
]

tasks = [
    Task(description="Analyze cybersecurity vulnerabilities in cloud systems", agent=agents[0]),
    Task(description="Create an executive summary for non-technical stakeholders", agent=agents[1]),
]

workflow = PraisonAIAgents(
    agents=agents,
    tasks=tasks,
    memory=MultiAgentMemoryConfig(
        user_id="security_review",
        embedder={"provider": "openai", "config": {"model": "text-embedding-3-small"}},
        config={"provider": "rag"},
    ),
)
workflow.start()

Configuration Options

MultiAgentMemoryConfig SDK Reference

Full parameter reference for MultiAgentMemoryConfig
Precedence ladder:
# Level 1: Bool (enable with defaults)
team = PraisonAIAgents(memory=True)

# Level 2: MultiAgentMemoryConfig (full control)
team = PraisonAIAgents(memory=MultiAgentMemoryConfig(
    user_id="user-123",
    embedder={"provider": "openai"},
))
OptionTypeDefaultDescription
user_idstr | NoneNoneScope memory to a specific user or project
embedderAny | NoneNoneEmbedder configuration (e.g., {"provider": "openai"})

How It Works

PhaseWhat happens
1. StoreFirst agent saves discoveries to shared memory
2. RetrieveSubsequent agents access all stored context
3. BuildLater agents build on earlier agents’ work

Configuration Options

Full list of options, types, and defaults — MultiAgentMemoryConfig
OptionTypeDefaultDescription
user_idstr | NoneNoneShared user/project identifier for scoped memory
embedderAny | NoneNoneEmbedder configuration for semantic memory
configdict | NoneNoneMemory provider configuration

Common Patterns

Pattern 1 — Project-scoped research memory

from praisonaiagents import Agent, Task, PraisonAIAgents, MultiAgentMemoryConfig

agents = [
    Agent(name="Researcher", instructions="Research and document findings."),
    Agent(name="Analyst", instructions="Analyze documented findings."),
    Agent(name="Reporter", instructions="Create final reports."),
]

tasks = [
    Task(description="Research market trends in renewable energy", agent=agents[0]),
    Task(description="Identify key investment opportunities from research", agent=agents[1]),
    Task(description="Write an investment recommendation report", agent=agents[2]),
]

result = PraisonAIAgents(
    agents=agents,
    tasks=tasks,
    memory=MultiAgentMemoryConfig(user_id="renewable_energy_2025"),
).start()
print(result)

Best Practices

Set user_id to a unique project or session identifier to prevent memory from bleeding between unrelated workflows. Without user_id, all workflows share the same memory namespace.
Tasks run in order by default. Place information-gathering tasks first and synthesis/writing tasks later so downstream agents have full context from upstream agents.

Advanced Memory

Single-agent memory configuration

Multi-Agent Planning

Plan tasks before executing them

Multi-Agent Hooks

Intercept task lifecycle events

Learn

Continuous learning from conversations