Managing Shared Team Memory (Hive Minds)
Hive Minds let teams share memories, knowledge graphs, workflows, and preferences across all members. Build collective intelligence that grows as your team works together.
Overview
A Hive is a shared memory context. When a member writes a memory to the hive, all other members can search and access it. This creates a team knowledge base that grows organically from everyone's work -- shared debugging knowledge, architectural decisions, onboarding context, and team preferences.
Memory contexts
Rekall has three memory contexts: Personal (private to a user), Hive (shared with team), and Agent (scoped to an agent identity). When you create a memory, you choose which context it belongs to. See Memory Contexts for details.
Creating Hives
import Rekall from '@rekall/agent-sdk';const rekall = new Rekall({ apiKey: 'rk_your_key' });// Create a team hiveconst hive = await rekall.hives.create({name: 'Platform Team',description: 'Shared memory for the platform engineering team',settings: {defaultVisibility: 'members', // Only members can see memoriesallowExternalSharing: false, // Cannot share outside the hiveautoSharePreferences: true, // Team preferences are auto-shared},});console.log(`Hive created: ${hive.id}`); // hive_abc123console.log(`Invite code: ${hive.inviteCode}`);
Adding Members
// Add members by emailawait rekall.hives.addMembers({hiveId: hive.id,members: [{ email: 'alice@example.com', role: 'admin' },{ email: 'bob@example.com', role: 'member' },{ email: 'carol@example.com', role: 'member' },],});// Or invite via invite codeconst invite = await rekall.hives.createInvite({hiveId: hive.id,role: 'member',expiresIn: '7d',maxUses: 10,});console.log(`Share this link: https://rekall.ai/invite/${invite.code}`);// List current membersconst members = await rekall.hives.listMembers({hiveId: hive.id,});for (const member of members.items) {console.log(`${member.name} (${member.role}) - joined ${member.joinedAt}`);}
Roles & Permissions
| Role | Read | Write | Delete | Manage Members | Settings |
|---|---|---|---|---|---|
| owner | Yes | Yes | Yes | Yes | Yes |
| admin | Yes | Yes | Yes | Yes | No |
| member | Yes | Yes | Own only | No | No |
| viewer | Yes | No | No | No | No |
Sharing Memories Across Team
Writing to Hive Context
To share a memory with the team, create it in the hive context.
// Create a memory in hive contextconst sharedMemory = await rekall.memories.create({type: 'episodic',content: 'Discovered that the Redis connection pool needs to be at least 50 connections for the payment service under peak load.',context: {hiveId: hive.id, // This makes it shared},metadata: {tags: ['infrastructure', 'redis', 'performance'],source: 'debugging-session',},importance: 0.9,});// You can also promote a personal memory to hiveawait rekall.memories.share({memoryId: 'mem_personal_abc',hiveId: hive.id,visibility: 'members',});
Searching Hive Memories
// Search only within a specific hiveconst results = await rekall.memories.search({query: 'Redis performance tuning',context: { hiveId: hive.id },limit: 10,});// Search across personal + hive memories simultaneouslyconst combined = await rekall.memories.search({query: 'Redis performance tuning',context: { includeHives: true }, // Includes all hives you belong tolimit: 10,});// Each result indicates its source contextfor (const memory of combined.memories) {const source = memory.context.hiveId? `hive:${memory.context.hiveName}`: 'personal';console.log(`[${source}] ${memory.content}`);}
Access Control
Visibility Levels
Each memory in a hive can have its own visibility level:
// Visible to all hive members (default)await rekall.memories.create({content: 'Team standup notes...',context: { hiveId: hive.id, visibility: 'members' },});// Visible only to admins and ownerawait rekall.memories.create({content: 'Salary discussion notes...',context: { hiveId: hive.id, visibility: 'admins' },});// Visible to specific membersawait rekall.memories.create({content: 'Project proposal draft...',context: {hiveId: hive.id,visibility: 'specific',visibleTo: ['user_alice', 'user_bob'],},});
Privacy
Personal memories are never visible to hive members unless explicitly shared. The includeHives: true flag in search only returns memories that were created in or shared to the hive context.
Shared Knowledge Graphs
Hives support shared knowledge graphs, so the entire team contributes to and benefits from the same entity and relationship data.
// Create entities in hive contextconst service = await rekall.semantic.createEntity({name: 'api-gateway',type: 'service',description: 'Central API gateway for all microservices',context: { hiveId: hive.id },});// Any team member can add relationshipsawait rekall.semantic.createRelationship({sourceId: service.id,targetId: 'ent_postgres',type: 'uses',context: { hiveId: hive.id },});// Query the shared graphconst graph = await rekall.semantic.searchEntities({query: 'core infrastructure services',context: { hiveId: hive.id },types: ['service'],});// Traverse shared graph for impact analysisconst impacted = await rekall.semantic.traverse({startEntityId: 'ent_postgres',path: [{ type: 'uses', direction: 'incoming' }],context: { hiveId: hive.id },});console.log('Services that use PostgreSQL:');for (const node of impacted.nodes) {console.log(` - ${node.name}`);}
Team Workflows
Share procedural workflows across the team so everyone follows the same processes.
// Create a team workflowconst onboarding = await rekall.procedural.createWorkflow({name: 'New Engineer Onboarding',description: 'Standard onboarding checklist for new engineers',context: { hiveId: hive.id },steps: [{ name: 'Set up dev environment', action: 'checklist', params: { items: ['Install Node.js 20+', 'Clone monorepo', 'Run setup script','Verify tests pass', 'Set up IDE extensions',]}},{ name: 'Access provisioning', action: 'checklist', params: { items: ['GitHub org invite', 'Neon database access', 'Sentry project access','Slack channels', 'AWS IAM role',]}},{ name: 'First task assignment', action: 'assign_task', params: {type: 'good-first-issue',mentor: '{{assignedMentor}}',}},],});// Any team member can trigger the shared workflowconst execution = await rekall.procedural.triggerWorkflow({workflowId: onboarding.id,params: { assignedMentor: 'alice' },context: { hiveId: hive.id },});
Evolving workflows
When any team member suggests improvements to a shared workflow, Rekall tracks the change as a new version. Admins can review and approve changes before they take effect.
Next Steps
- •Knowledge Graphs -- Detailed guide on building knowledge graphs
- •Agent Memory -- Combine hive memory with agent-scoped memory
- •Memory Contexts -- Understanding personal, hive, and agent contexts
- •Hive API Reference -- Full endpoint documentation
