Skip to content

[Feature]: Conversations API - Shared Memory Across Parallel Sessions #88

@zircote

Description

@zircote

Problem Statement

When users interact with multiple AI sessions simultaneously (e.g., different Claude Code windows, multiple agent instances), memories captured in one session are not immediately available to others. This creates:

  • Inconsistent context across parallel sessions
  • Duplicate captures of the same information
  • Lost continuity when switching between sessions

Letta Conversations API enables agents to maintain shared memory across parallel user experiences.

Proposed Solution

Implement a Conversations API that enables:

  1. Real-time Memory Sync: New memories propagated to active sessions
  2. Session Awareness: Track which session captured what
  3. Conflict Handling: Resolve concurrent captures
  4. Selective Sync: Configure which namespaces sync

Architecture:

  • Event bus for memory change notifications
  • Session registry tracking active sessions
  • Optimistic locking for concurrent updates
  • WebSocket/SSE for real-time push

Proposed API:

pub struct ConversationsApi {
    sessions: SessionRegistry,
    event_bus: EventBus,
}

pub struct Session {
    id: SessionId,
    user_id: UserId,
    subscriptions: Vec<Namespace>,
    last_sync: DateTime,
}

MCP tools:

subcog_session_register:
  session_id: "claude-code-1"
  subscribe: ["decisions", "patterns"]

subcog_session_sync:
  session_id: "claude-code-1"
  since: "last"  # or timestamp

Events pushed to sessions:

MemoryEvent::Captured { memory, source_session }
MemoryEvent::Updated { memory_id, changes, source_session }
MemoryEvent::Deleted { memory_id, source_session }

Alternatives Considered

  • Poll-based sync (current via recall) - not real-time
  • File-system watchers - platform-dependent
  • External message queue - over-engineered for local use

Additional Context

  • Letta Conversations API (Jan 2026): https://www.letta.com/
  • Important for power users with multiple sessions
  • Foundation for future collaborative features

Breaking Change: No
Priority: Nice to have
Contribution: Yes, with guidance

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions