Skip to main content
Enable multiple AI agents to share and coordinate memory.

Use Case

A team of AI agents working on a project:
  • Research agent finds information
  • Coding agent implements features
  • Review agent checks code quality
  • All share context via MemoClaw

Implementation

Share Findings Between Agents

# Research agent stores findings
memoclaw store "Found that pgvector HNSW index performs better than IVFFlat for small datasets" \
  --importance 0.85 \
  --agent research-001 \
  --namespace project-backend \
  --type decision

# Coding agent recalls research findings
memoclaw recall "vector database performance research" \
  --namespace project-backend \
  --limit 5
from memoclaw import MemoClaw

research_agent = MemoClaw()
research_agent.agent_id = "research-001"

coding_agent = MemoClaw()
coding_agent.agent_id = "coding-001"

# Research agent stores findings
research_agent.store(
    content="Found that pgvector HNSW index performs better than IVFFlat for small datasets",
    importance=0.85,
    agent_id="research-001",
    namespace="project-backend",
    memory_type="decision"
)

# Coding agent recalls research findings
findings = coding_agent.recall(
    query="vector database performance research",
    namespace="project-backend",
    limit=5
)

import { MemoClawClient } from "memoclaw";

const researchAgent = new MemoClawClient({ agentId: "research-001" });
const codingAgent = new MemoClawClient({ agentId: "coding-001" });

// Research agent stores findings
await researchAgent.store({
  content: "Found that pgvector HNSW index performs better than IVFFlat for small datasets",
  importance: 0.85,
  agent_id: "research-001",
  namespace: "project-backend",
  memory_type: "decision",
});

// Coding agent recalls research findings
const findings = await codingAgent.recall({
  query: "vector database performance research",
  namespace: "project-backend",
  limit: 5,
});

Filter by Agent

memoclaw list --agent research-001 --namespace project-backend
agent_memories = client.list(
    agent_id="research-001",
    namespace="project-backend"
)

const agentMemories = await client.list({
  agent_id: "research-001",
  namespace: "project-backend",
});

Create Relations Between Agents’ Memories

# Store research finding
memoclaw store "HNSW is better for our use case" \
  --agent research-001 --namespace project-backend
# Note the returned ID, e.g. <research-id>

# Store implementation note
memoclaw store "Implemented HNSW index for vector search" \
  --agent coding-001 --namespace project-backend
# Note the returned ID, e.g. <impl-id>

# Link them
memoclaw relate <impl-id> <research-id> --type derived_from
research_memory = research_agent.store(
    content="HNSW is better for our use case",
    agent_id="research-001",
    namespace="project-backend"
)

implementation_memory = coding_agent.store(
    content="Implemented HNSW index for vector search",
    agent_id="coding-001", 
    namespace="project-backend"
)

client.create_relation(
    memory_id=implementation_memory.id,
    target_id=research_memory.id,
    relation_type="derived_from"
)

const researchMemory = await researchAgent.store({
  content: "HNSW is better for our use case",
  agent_id: "research-001",
  namespace: "project-backend",
});

const implMemory = await codingAgent.store({
  content: "Implemented HNSW index for vector search",
  agent_id: "coding-001",
  namespace: "project-backend",
});

await client.createRelation(implMemory.id, {
  targetId: researchMemory.id,
  relationType: "derived_from",
});

Memory Isolation

  • Same wallet = same user identity
  • Different agent_ids = different agent perspectives on same memory store
  • Namespaces = completely separate memory pools

Best Practices

  1. Use consistent agent_id naming: {role}-{number} or {name}
  2. Use namespace to separate projects
  3. Use relations to link cross-agent dependencies
  4. Use memory_type to distinguish findings vs implementations vs reviews