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
| Feature | Hive Mode | Collaboration Mode |
|---|---|---|
| Memory Spaces | 1 shared space | N separate spaces |
| Storage | Single write | Dual-write (A2A) |
| Participants | Multiple in same space | Each in own space |
| Consistency | Always consistent | Eventually consistent |
| Use Case | Personal AI tools, MCP | Autonomous agents |
| Example | Cursor + Claude | Finance agent + HR agent |
How Hive Mode Works
Cursor • Claude • Notion AI • Custom Tools
user-123-personal • All tools read and write here
ONE write benefits ALL tools • Zero duplication
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
- 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
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' },
],
});
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',
});
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
You can skip explicit registration—just use the same memorySpaceId across tools. The space is auto-created on first write.
Participant Tracking
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
| Feature | Traditional (Separate Spaces) | Hive Mode (Shared Space) |
|---|---|---|
| Storage | 3× writes (one per tool) | 1× write (all benefit) |
| Consistency | Minutes (sync delay) | Instant (<10ms) |
| Queries | Query 3 spaces + merge | Query 1 space |
| Deduplication | Cross-space dedup needed | Built-in (same space) |
Best Practices
await cortex.memory.remember({
memorySpaceId: 'team-workspace',
participantId: 'deployment-bot', // Clear tracking
// ...
});
Track who stores what for debugging and analytics.
// Good: Descriptive, scoped
'user-123-personal'
'team-engineering-workspace'
'project-apollo-memory'
// Bad: Ambiguous
'space1'
'memory'
'default'
// 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.