Skip to content

Comments

feat: hybrid memory search with FTS5 + vector merge#385

Merged
bug-ops merged 2 commits intomainfrom
feat/m19/hybrid-memory-search
Feb 16, 2026
Merged

feat: hybrid memory search with FTS5 + vector merge#385
bug-ops merged 2 commits intomainfrom
feat/m19/hybrid-memory-search

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 16, 2026

Summary

  • Add SQLite FTS5 virtual table (messages_fts) with auto-sync triggers for keyword search over messages
  • SemanticMemory::recall() now runs both Qdrant vector similarity and FTS5 BM25 keyword search, merging results with configurable weights (default 0.7 vector / 0.3 keyword)
  • When Qdrant is unavailable, falls back to FTS5-only keyword search instead of returning empty results
  • New vector_weight/keyword_weight config in [memory.semantic]

Changes

File Change
migrations/008_fts5.sql FTS5 virtual table + backfill + INSERT/UPDATE/DELETE triggers
sqlite/messages.rs keyword_search() method with optional conversation filter
semantic.rs Hybrid recall with weighted merge, with_weights() constructor
config/types.rs vector_weight/keyword_weight fields on SemanticConfig
main.rs Wire config weights to SemanticMemory::with_weights()

Test plan

  • 4 new keyword search tests (basic, filter, no match, limit)
  • 4 new hybrid recall tests (FTS5 fallback, filter, no match, limit)
  • All 1435 existing tests pass
  • Clippy clean, fmt clean

Closes #372,Closes #373,Closes #374,Closes #364
Epic: #364

Add SQLite FTS5 virtual table for keyword search over messages with
auto-sync triggers. SemanticMemory.recall() now combines Qdrant vector
similarity and FTS5 BM25 keyword scores using configurable weights
(default 0.7/0.3). Falls back to FTS5-only when Qdrant is unavailable
instead of returning empty results.

Closes #372, #373, #374
@bug-ops bug-ops added the M19 Milestone 19: Hybrid memory search label Feb 16, 2026
@github-actions github-actions bot added documentation Improvements or additions to documentation memory Persistence and memory rust core config enhancement New feature or request size/L labels Feb 16, 2026
@bug-ops bug-ops enabled auto-merge (squash) February 16, 2026 22:09
@bug-ops bug-ops merged commit 3ffb385 into main Feb 16, 2026
23 checks passed
@bug-ops bug-ops deleted the feat/m19/hybrid-memory-search branch February 16, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config core documentation Improvements or additions to documentation enhancement New feature or request M19 Milestone 19: Hybrid memory search memory Persistence and memory rust size/L

Projects

None yet

1 participant