Skip to content

fix(memory): use effective_embed_provider for all embedding ops in semantic submodules#3035

Merged
bug-ops merged 1 commit intomainfrom
3029-embed-dim-mismatch
Apr 15, 2026
Merged

fix(memory): use effective_embed_provider for all embedding ops in semantic submodules#3035
bug-ops merged 1 commit intomainfrom
3029-embed-dim-mismatch

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Apr 15, 2026

Summary

  • Replaces self.provider with self.effective_embed_provider() at all 18 embedding call sites across recall.rs, cross_session.rs, summarization.rs, and corrections.rs in zeph-memory
  • Adds regression test effective_embed_provider_routes_to_dedicated_embed_provider that verifies the dedicated embed provider is used instead of the main LLM provider

Root Cause

self.provider (main LLM provider, e.g. OpenAI/text-embedding-3-small, 1536 dim) was used at recall time instead of self.effective_embed_provider() (e.g. Ollama/nomic-embed-text-v2-moe, 768 dim). ensure_collection() detected the dimension mismatch and silently deleted and recreated all Qdrant memory collections on every session startup, losing all stored embeddings.

Test Plan

  • cargo build -p zeph-memory — passes, 0 errors
  • cargo clippy -p zeph-memory -- -D warnings — 0 warnings
  • cargo nextest run -p zeph-memory --lib — 1115 passed, 7 skipped, 0 failed
  • New regression test effective_embed_provider_routes_to_dedicated_embed_provider passes and would fail if any fixed call site reverted to self.provider
  • Verify with mixed-provider config: zeph_conversations collection no longer recreated on startup

Closes #3029

…mantic submodules

Replace self.provider with self.effective_embed_provider() at all 18
embedding call sites across recall.rs, cross_session.rs, summarization.rs,
and corrections.rs. The main LLM provider was used for embedding at recall
time, causing ensure_collection() to see a dimension mismatch (e.g. 1536
vs. 768) and silently delete and recreate Qdrant memory collections on
every session startup.

Add a regression test that constructs SemanticMemory with a dedicated embed
provider and asserts that effective_embed_provider() routes to it rather
than to self.provider.

Fixes #3029
@github-actions github-actions Bot added documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) rust Rust code changes bug Something isn't working size/M Medium PR (51-200 lines) labels Apr 15, 2026
@bug-ops bug-ops merged commit 75f9811 into main Apr 15, 2026
30 checks passed
@bug-ops bug-ops deleted the 3029-embed-dim-mismatch branch April 15, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation memory zeph-memory crate (SQLite) rust Rust code changes size/M Medium PR (51-200 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

memory: embedding dimension mismatch silently wipes Qdrant collections on startup

1 participant