Group Memory
Enable agents to share context and learn from each other through persistent group memory powered by mem0. Agents in the same memory group access shared knowledge, reducing redundant work and enabling collaborative problem-solving.
Overview
Without memory, agents are stateless — each request starts from scratch. Group memory transforms agents into collaborative systems where learned information persists across conversations and agents.
Key capabilities:
- Shared knowledge base — All agents in a group read/write the same memory
- Semantic search — Retrieve memories by meaning, not exact keywords
- Automatic persistence — Conversations and learnings stored without manual intervention
- Memory lifecycle — Configure retention policies (7 days, 30 days, forever)
- Cross-agent learning — One agent’s discoveries benefit all others in the group
Why Use Group Memory?
Avoid Redundant Work
Without memory:
User: "What's our Q4 revenue?"
Agent A: Queries database, returns $2.5M
User: "And Q4 expenses?"
Agent B: No context about revenue question, treats as isolated queryWith memory:
User: "What's our Q4 revenue?"
Agent A: Queries database, stores "Q4 revenue = $2.5M" in memory, returns $2.5M
User: "And Q4 expenses?"
Agent B: Recalls Q4 context from memory, queries expenses, returns $800K
Agent B: Stores "Q4 expenses = $800K" and calculates "Q4 profit = $1.7M" proactivelyEnable Collaborative Problem-Solving
Multiple agents working on the same problem share intermediate findings:
- Research Agent: Finds relevant papers, stores summaries in memory
- Analysis Agent: Recalls summaries, adds statistical analysis
- Writer Agent: Retrieves both research and analysis, generates comprehensive report
Each agent builds on previous work instead of starting from zero.
Maintain User Context
Conversations span multiple sessions. Memory preserves:
- User preferences (“always format dates as MM/DD/YYYY”)
- Previous requests (“continue our discussion about quantum computing”)
- Ongoing tasks (“you were helping me with the sales report”)
Group memory is shared across all agents in the group. For user-specific memory, configure separate memory groups per user.
How Memory Works
Memory Storage (mem0)
M3 Forge uses mem0 for memory management:
- Vector embeddings — Memories stored as semantic vectors
- Hybrid search — Combines vector similarity and keyword matching
- Intelligent summarization — Long conversations condensed to key facts
- Entity extraction — Automatic identification of people, places, dates
Memory Lifecycle
Write:
- Agent completes request
- Important information extracted (entities, facts, decisions)
- Memory written to group storage with metadata (timestamp, agent ID, source)
Read:
- Agent receives new request
- Query memory for relevant context
- Top-K most relevant memories retrieved
- Memories injected into agent’s context
Expire:
- Memories auto-expire based on retention policy
- Manual pruning for sensitive data
- Archival for long-term storage
Memory Scopes
| Scope | Visibility | Use Case |
|---|---|---|
| Session | Single conversation | Temporary context within one chat |
| User | All conversations with a user | User preferences, history |
| Group | All agents in a group | Shared knowledge base |
| Global | All agents across all groups | Universal facts, policies |
M3 Forge’s group memory implements the “Group” scope.
Creating a Memory Group
Navigate to Group Memory
Click “Agents” → “Group Memory” in the navigation.
Create New Group
Click “Create Memory Group”. A configuration panel opens.
Configure Group Settings
Required fields:
- Name — Descriptive identifier (e.g., “Customer Support Team”)
- Description — What agents in this group do
- Retention policy — How long to keep memories
Retention options:
- 7 days (short-term projects)
- 30 days (monthly cycles)
- 90 days (quarterly work)
- Forever (permanent knowledge base)
Optional settings:
- Max memory size — Limit total memories (prevents unbounded growth)
- Auto-summarization — Compress old memories to save space
- Privacy level — Who can view memories (agents only, admins, everyone)
Add Agents to Group
Select agents to join this memory group:
- Click “Add Agents”
- Multi-select from agent list
- Agents immediately gain access to shared memory
All agents in the group can now read and write memories.
Test Memory Sharing
- Send a request to Agent A with factual information
- Verify memory was stored (check memory dashboard)
- Send a related request to Agent B
- Confirm Agent B recalls information from Agent A’s interaction
Memory Dashboard
Memory Entry Table
View all memories in a group:
| Entry | Source | Timestamp | Relevance Score |
|---|---|---|---|
| ”Q4 revenue is $2.5M” | Agent A | 2026-03-19 10:23 | - |
| ”Customer prefers email” | Agent B | 2026-03-19 09:15 | - |
| ”Project deadline: March 31” | Agent C | 2026-03-18 14:00 | - |
Actions:
- View details — See full memory content and metadata
- Delete — Manually remove sensitive or incorrect memories
- Pin — Mark important memories to prioritize in retrieval
- Export — Download memories as JSON for backup
Memory Search Panel
Search memories by content:
- Enter search query (e.g., “revenue figures”)
- Results ranked by semantic similarity
- View which agent created each memory
- Click to see full context
Search modes:
- Semantic — Find memories by meaning (default)
- Keyword — Exact text matching
- Hybrid — Combine both for best results
Memory Statistics
Track memory usage:
- Total memories — Count of stored entries
- Storage used — Disk/vector DB space consumed
- Memory growth — New memories per day
- Top contributors — Which agents write most memories
- Retrieval stats — Most frequently accessed memories
Monitor memory growth to avoid unbounded storage costs. Set up alerts when storage exceeds thresholds.
Memory Best Practices
What to Store
Do store:
- Factual information (revenue, dates, names)
- User preferences (formatting, tone, output style)
- Intermediate results (research findings, calculations)
- Decisions and rationale (why X was chosen over Y)
Don’t store:
- Sensitive PII (SSN, credit cards, passwords)
- Temporary data that becomes stale quickly
- Duplicate information (dedup before storing)
- Hallucinated facts (validate before writing)
Memory Granularity
Good granularity:
"Customer Jane Doe prefers email communication"
"Project Alpha deadline: March 31, 2026"
"Q4 2025 revenue: $2.5M"Poor granularity:
"The customer said something about communication preferences" (too vague)
"Revenue: $2.5M" (missing context: which period?)
"Everything from yesterday's meeting" (too broad)Store specific, atomic facts that can be independently retrieved.
Memory Validation
Prevent hallucinated memories:
- Only store information from reliable sources (user input, database queries, verified APIs)
- Cite sources in memory metadata (“From customer email 2026-03-19”)
- Periodically audit memories for accuracy
- Delete contradicting memories (e.g., two different revenue figures for same quarter)
Agents may “remember” hallucinated information if not validated. Implement checks to ensure only verified facts are stored.
Advanced Features
Memory Prioritization
Not all memories are equally important. Configure priority levels:
- High priority — Always retrieve (pinned facts, critical constraints)
- Medium priority — Retrieve if relevant (general context)
- Low priority — Retrieve only if highly similar to query
High-priority memories appear first in retrieval results.
Memory Versioning
Track how facts change over time:
Version 1: "Q4 forecast: $2.3M" (created 2026-01-15)
Version 2: "Q4 forecast: $2.5M" (updated 2026-02-10)
Version 3: "Q4 actual: $2.7M" (updated 2026-04-01)Query specific versions or always retrieve the latest.
Memory Sharing Across Groups
Link memory groups for cross-team knowledge sharing:
- Research Group ← shared memories → Product Group
- Support Group ← shared memories → Sales Group
Configure sharing permissions:
- Read-only (other groups can view but not edit)
- Read-write (bidirectional sharing)
- Filtered (share only certain types of memories)
Memory Analytics
Analyze memory usage patterns:
- Most accessed memories — Which facts are frequently referenced?
- Orphaned memories — Never retrieved (candidates for deletion)
- Memory freshness — Age distribution (are memories stale?)
- Agent contribution — Which agents write vs. read memories
Use analytics to optimize retention policies and improve memory quality.
Security and Privacy
Access Control
Restrict who can view memories:
- Agent-only — Memories visible only to agents in the group
- Admin access — Admins can view/edit all memories
- User access — Users can view memories about their own data
Configure via memory group settings.
Data Retention Compliance
For GDPR/CCPA compliance:
- Set retention policies to auto-delete after legal retention periods
- Implement “right to be forgotten” (delete all memories for a user)
- Audit logs for memory access (who viewed what, when)
- Encrypt memories at rest and in transit
Sensitive Data Filtering
Prevent storage of PII:
- Enable automatic PII detection
- Redact before storing (e.g., “Customer SSN: XXX-XX-1234”)
- Tag sensitive memories for special handling
- Alert on attempted storage of credentials
Never store passwords, credit cards, or other credentials in memory. Use secure vaults for secrets.
Troubleshooting
Memories Not Being Retrieved
Symptoms: Agent doesn’t recall previously stored information
Causes:
- Memory query doesn’t match stored content (semantic mismatch)
- Too many memories (relevant ones buried in results)
- Memory expired due to retention policy
Solutions:
- Improve memory query phrasing
- Increase retrieval result count (top-10 instead of top-3)
- Extend retention policy or pin important memories
Memory Conflicts
Symptoms: Two contradictory facts in memory
Causes:
- Information changed over time
- Different sources with different values
- Agent hallucination stored as fact
Solutions:
- Implement memory versioning
- Add timestamps and sources to all memories
- Manual review and conflict resolution
Storage Costs Growing
Symptoms: Memory storage costs increasing rapidly
Causes:
- No retention policy (memories never deleted)
- Storing too-verbose memories
- Duplicate memories
Solutions:
- Enable auto-summarization
- Implement deduplication
- Set aggressive retention policies for non-critical groups
Integration with Orchestration
Group memory enhances orchestrations:
Sequential Pipeline:
Research Agent → stores findings in memory
Analysis Agent → retrieves findings, adds analysis to memory
Writer Agent → retrieves both, generates reportEach agent builds on the previous without explicit output passing.
Parallel Fan-Out:
Leader Agent → stores task context in memory
Workers (all read context from memory) → execute independently
Leader Agent → retrieves worker results from memory, aggregatesWorkers coordinate via shared memory instead of direct communication.
Next Steps
- Create orchestrations that leverage group memory for coordination
- Connect external agents and include them in memory groups
- Monitor memory usage in production environments