Skip to content

CRITICAL: Vector index not synced in real-time — new memories invisible to semantic recall #544

Closed

Description

@ajianaz

Description

After storing memories via uteke remember, they are persisted in SQLite but NOT immediately indexed in the usearch vector index. Semantic recall (uteke recall) returns empty results for newly created memories until uteke repair is manually run to rebuild the index.

This is distinct from #543 (concurrent writes) — this bug also occurs with single sequential writes to a fresh namespace.

Environment

  • Uteke version: 0.6.1
  • OS: Linux 6.8.0-1054-oracle (Oracle Cloud ARM)
  • Reproducibility: Consistent on fresh namespace

Steps to Reproduce

# Fresh namespace
uteke namespace create ctest

# Store a memory
uteke remember --namespace ctest --type fact "Rust ownership model ensures memory safety"

# Immediately try semantic recall
uteke recall --namespace ctest "Rust ownership"
# Expected: returns the memory
# Actual: returns []

# Try FTS5 recall
uteke recall --strategy fts5 --namespace ctest "Rust"
# Expected: returns the memory
# Actual: returns []

# Text search works (different code path)
uteke search --namespace ctest "Rust"
# Returns: 1 result with score 1.0 ✅

# Run repair
uteke repair

# Now semantic recall works
uteke recall --namespace ctest "Rust ownership"
# Returns: 1 result with score 0.66 ✅

Root Cause Analysis

Before repair:

  • DB count: 19324
  • Index count: 19448 (124 extra/stale vectors)

This suggests the usearch index accumulates stale entries and does not properly sync with SQLite inserts. The uteke search command works because it uses a different FTS5 code path (direct SQLite query) vs uteke recall --strategy fts5 which routes through the vector/FTS5 hybrid path.

Expected Behavior

After uteke remember, the memory should be immediately searchable via all recall strategies (vector, FTS5, hybrid).

Actual Behavior

Memory is in SQLite but not in vector index. uteke recall returns [] until uteke repair rebuilds the index from scratch.

Impact

  • Critical for multi-agent use: Agents storing memories cannot recall them in subsequent turns
  • Production blocker: Any workflow relying on write-then-read patterns is broken
  • Confusing UX: Write appears successful (exit code 0, memory ID returned) but recall fails silently

Suggested Fix

  1. Ensure vector index is updated synchronously after each remember call
  2. Add a consistency check that verifies the vector was actually inserted
  3. Consider an index write-ahead log to prevent stale entries

Workaround

Run uteke repair after storing new memories. Or use uteke search (text search) instead of uteke recall (semantic search) for immediate lookups.

Activity

  1. added
    bug
    scope:core
    priority:critical
    on Jul 3, 2026
  2. added 2 commits that reference 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

    bugpriority:criticalscope:core

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions