Skip to content

🔗 Feature: Relationship graph layer between memories #246

Closed

Description

@ajianaz

Feature: Relationship Graph Layer Between Memories

Problem

Vector similarity provides implicit "relatedness" but cannot capture structured relationships:

When Vector is Enough vs Not

Query Type Vector Graph
Semantic similar ✅ ✅
Cause-effect (bug → fix) ❌ ✅
Supersedes (old → new) ❌ ✅
Part-of hierarchy ❌ ✅
Contradicts ⚠️ Partial ✅

Implementation: Metadata-Based Edges (No New Schema)

Use existing metadata JSON field (populated by #251) to store relationship info:

uteke remember "Fix login timeout" --tags fix --meta "supersedes:bug-42"
uteke remember "gRPC migration" --tags decision --meta "contradicts:rest-decision"

Recall with Relationship Traversal

uteke recall "bug login" --related     # Follow first-level edges
uteke recall "architecture" --depth 2  # Follow N levels

Why v0.1.0

Acceptance Criteria

  • --meta "supersedes:ID" populates metadata.relationships
  • recall --related follows first-level edges
  • recall --depth N follows N levels of edges
  • Relationship types: supersedes, contradicts, part_of, references
  • JSON output includes relationship annotations
  • No new database tables — all via metadata JSON

Activity

  1. reopened this on Jun 9, 2026
  2. added
    v0.1.0
    type:feature
    enhancement
    and removed
    type:feature
    on Jun 9, 2026
  3. added this to the milestone on Jun 11, 2026
  4. ajianaz commented on Jun 11, 2026

    @ajianaz
    CollaboratorAuthor

    Room as Container Relationship (from SurrealDB Research — Jun 2026)

    After deep-diving SurrealDB's architecture, one pattern worth considering: Room as a contains container type in the relationship graph.

    Current Design

    Issue describes memory-to-memory edges: supersedes, contradicts, part_of, references.

    Proposed Addition: room as Container

    A Room (#278) is a collaboration context (e.g., a Discord thread). Memories stored in a room have an implicit contains relationship from the room to the memory. This gives us:

    How It Fits

    • Room is NOT a memory-to-memory edge — it's a room-to-memory edge (different direction)
    • Implementation: --meta "room:discord:xxx" or dedicated room column (see feat(#134): file permissions and ONNX model checksum verification #278)
    • The --related flag could optionally filter to same-room edges: recall --related --room discord:xxx
    • When implementing, contains type should be added to relationship types acceptance criteria

    SurrealDB Inspiration

    SurrealDB's Namespace > Database > Scope hierarchy isolates data at multiple levels. Room is conceptually similar to SurrealDB's Scope — a context boundary that groups related data without full isolation (rooms can overlap; memories can exist in multiple rooms or none).

    Priority Impact

    No change to current scope. This is a design note for implementation phase — when building the graph layer, room-container edges should be considered alongside the existing relationship types.

    Related: #278 (Room feature), #247 (importance with room factor)

  5. ajianaz commented on Jun 11, 2026

    @ajianaz
    CollaboratorAuthor

    🔗 Update: Room Integration (from SurrealDB analysis, #286)

    Room as Graph Node Hub

    With the new Room feature (#286), the graph layer should treat rooms as first-class nodes:

    Room:151452...  ←part_of—  Memory:abc123  (CTO analysis)
                    ←part_of—  Memory:def456  (Zeko status)
                    ←part_of—  Memory:ghi789  (BadSector risk)
                    ←references—  Memory:jkl012 (related past decision)
    

    Enhanced Graph Traversal with Rooms

    # Traverse from room to all connected memories
    uteke recall --room 151452... --depth 2
    # → Room → Memories → Related memories (2 hops)
    
    # Find related rooms via shared memories
    uteke recall "surrealdb" --rooms-related
    # → Returns rooms that discuss similar topics

    Updated Acceptance Criteria (add to existing)

    • Room nodes as hub in graph — part_of edges from memories to rooms
    • Graph traversal supports room-scoped queries (--room --depth N)
    • Cross-room traversal: find related rooms via shared concepts
    • Room connections contribute to connectivity_score in importance formula (⭐ Feature: Smart memory decay and importance scoring #247)

    Dependency Note

    #286 (Room) should be implemented BEFORE this issue. Graph layer will enhance room with traversal capabilities, but room tables must exist first. Recommended order: #249 → #286 → THIS (#246) → #248 → #247 → #181

  6. added a commit that references this issue on Jun 12, 2026
  7. added a commit that references this issue on Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpriority:mediumscope:corev0.1.0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions