Skip to main content

Hive Mode

What is Hive Mode?

Hive Mode enables multiple AI tools to share ONE memory space. When Cursor learns your preference, Claude knows it too. No duplication, no sync issues—like bees working in one hive.


Quick Comparison

FeatureHive ModeCollaboration Mode
Memory Spaces1 shared spaceN separate spaces
StorageSingle writeDual-write (A2A)
ParticipantsMultiple in same spaceEach in own space
ConsistencyAlways consistentEventually consistent
Use CasePersonal AI tools, MCPAutonomous agents
ExampleCursor + ClaudeFinance agent + HR agent

How Hive Mode Works

Hive Mode Architecture
AI Tools

Cursor • Claude • Notion AI • Custom Tools

Shared Memory Space

user-123-personal • All tools read and write here

Unified Memories

ONE write benefits ALL tools • Zero duplication

Multiple tools share ONE memory space
Key Benefit

When Cursor stores a memory, Claude can immediately recall it. No sync delays, no duplication.


When to Use Hive Mode

Perfect For

Personal AI Ecosystems

Cursor + Claude + Notion AI sharing your personal knowledge

MCP Integration

Memory follows you across all MCP-compatible tools

Team Workspaces

Multiple bots in Slack sharing team context

Multi-Platform Apps

Web + mobile + CLI with consistent memory everywhere

Not Ideal For

Consider Alternatives
  • Autonomous Multi-Agent Systems — Use Collaboration Mode instead. Each agent needs independent memory.
  • Strict Compliance — Some regulations require per-agent isolation and separate audit trails.
  • Multi-Tenant SaaS — Each customer should have separate memory spaces. Don't mix customer data.

Setting Up Hive Mode

1

Create shared memory space

await cortex.memorySpaces.register({
memorySpaceId: 'user-123-personal',
name: "Alice's Personal AI Memory",
type: 'personal',
participants: [
{ id: 'cursor', type: 'ai-tool' },
{ id: 'claude', type: 'ai-tool' },
{ id: 'notion-ai', type: 'ai-tool' },
],
});
2

Each tool uses the same space

// Tool 1: Cursor
await cortex.memory.remember({
memorySpaceId: 'user-123-personal',
participantId: 'cursor',
conversationId: 'conv-1',
userMessage: 'I prefer TypeScript',
agentResponse: 'Noted!',
userId: 'user-123',
userName: 'Alice',
});

// Tool 2: Claude
await cortex.memory.remember({
memorySpaceId: 'user-123-personal', // Same space
participantId: 'claude',
conversationId: 'conv-2',
userMessage: 'Generate TypeScript code',
agentResponse: 'Here is TypeScript code...',
userId: 'user-123',
userName: 'Alice',
});
3

All tools can read all memories

// Any tool can search the shared space
const memories = await cortex.memory.search(
'user-123-personal',
'user preferences'
);
// Returns memories from Cursor, Claude, and all participants
Implicit Creation

You can skip explicit registration—just use the same memorySpaceId across tools. The space is auto-created on first write.


Participant Tracking

Who Stored What?

Use participantId to track which tool stored each memory for debugging, analytics, and audit trails.

// Store with participant tracking
await cortex.memory.remember({
memorySpaceId: 'team-engineering',
participantId: 'code-review-bot', // Track source
conversationId: 'slack-thread-456',
userMessage: '[From user] Please review PR #123',
agentResponse: 'Code review complete',
userId: 'engineer-bob',
userName: 'Bob',
});

// Later: filter by participant
const reviewBotMemories = await cortex.memory.list({
memorySpaceId: 'team-engineering',
participantId: 'code-review-bot',
});

// Audit who contributed what
const allMemories = await cortex.memory.list({ memorySpaceId: 'team-engineering' });
allMemories.forEach(m => {
console.log(`${m.participantId}: ${m.content.substring(0, 50)}...`);
});

Real-World Example: MCP

// Setup: User installs MCP server
// MCP creates one memory space per user

// In Cursor IDE
await cortex.memory.remember({
memorySpaceId: 'user-alice-personal',
participantId: 'cursor',
userMessage: 'Show me TypeScript best practices',
agentResponse: 'Here are TS best practices...',
userId: 'user-alice',
userName: 'Alice',
});

// Later in Claude Desktop
const memories = await cortex.memory.search(
'user-alice-personal',
'typescript coding'
);
// Returns: "User interested in TypeScript best practices" (from Cursor!)

// Claude provides context-aware response
const response = "I see you've been learning TypeScript. Let me help...";

Result: Memory follows the user across all tools.


Performance Benefits

FeatureTraditional (Separate Spaces)Hive Mode (Shared Space)
Storage3× writes (one per tool)1× write (all benefit)
ConsistencyMinutes (sync delay)Instant (<10ms)
QueriesQuery 3 spaces + mergeQuery 1 space
DeduplicationCross-space dedup neededBuilt-in (same space)

Best Practices

Always Set participantId
await cortex.memory.remember({
memorySpaceId: 'team-workspace',
participantId: 'deployment-bot', // Clear tracking
// ...
});

Track who stores what for debugging and analytics.

Use Clear Memory Space Names
// Good: Descriptive, scoped
'user-123-personal'
'team-engineering-workspace'
'project-apollo-memory'

// Bad: Ambiguous
'space1'
'memory'
'default'
One Space per Tenant
// Good: Isolated per customer
await cortex.memory.remember({
memorySpaceId: `customer-${customerId}-space`,
// ...
});

// Bad: All customers in one hive (privacy violation!)
await cortex.memory.remember({
memorySpaceId: 'saas-app-memory', // Don't do this
// ...
});

Troubleshooting

// List all memories with participant info
const memories = await cortex.memory.list({ memorySpaceId: 'team-workspace' });

memories.forEach(m => {
console.log(`${m.participantId}: ${m.content.substring(0, 50)}...`);
});
// Delete all memories from specific participant
const badMemories = await cortex.memory.list({
memorySpaceId: 'team-workspace',
participantId: 'buggy-bot',
});

for (const memory of badMemories) {
await cortex.memory.delete('team-workspace', memory.id);
}

Pick one pattern per use case. For Hive Mode, all participants use same memorySpaceId. For Collaboration, use separate spaces with A2A communication.


Next Steps