[GH-ISSUE #2283] [Issue]: Sidecar ONNX embedder retirement silently degrades semantic memory/knowledge to lexical hashing, and ships an orphaned model bundle #1119

Closed
opened 2026-10-21 05:27:14 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @Romuromylus on GitHub (Jun 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2283

Originally assigned to: @SpicyMarinara on GitHub.

Summary

The refactor intentionally retires the in-process ONNX all-MiniLM-L6-v2 embedder, but with no embedding provider configured it silently falls back to an FNV-hash bag-of-words for memory embeddings and short-circuits the knowledge-router semantic shortlist to keyword candidates, with no user-facing warning. The MiniLM model files still ship under resources but are referenced by zero code.

Expected behavior

Either keep a zero-config local embedding path, or surface a clear indication that semantic memory recall and semantic knowledge routing require a configured embedding-capable connection, and drop the now-orphaned model bundle from the shipped resources.

Actual behavior

With no embedding connection, memory embeddings become source: "lexical" (FNV hash) and embedQuery returns null so knowledge-router returns keyword fallback candidates, both silently. The retired model still ships at src-tauri/resources/default-data/models/Xenova/all-MiniLM-L6-v2/ as dead weight.

Steps to reproduce

  1. Run the refactor with no embedding-capable connection configured (the zero-config default that worked on main via the local embedder).
  2. Use memory recall and the knowledge router.
  3. Observe lexical-only matching with no indication, and the orphaned model files present in the bundle.

Impact area

  • React-free engine behavior, contracts, agents, or capability ports
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime

Regression notes

Worked on main with zero config. Main is local-first: packages/server/src/services/memory-recall.ts:64-66 calls localEmbed first, local-embedder.ts:84 loads Xenova/all-MiniLM-L6-v2, and memory-recall-embedding.ts:129 reports availability with no remote provider. The refactor has no ONNX/candle/fastembed/tokenizers code anywhere in src, src-tauri, or crates, and prompts.rs:531-535 states the sidecar embeddings are retired. Lexical fallback at src-tauri/src/commands/storage/chats.rs:139-160,236-241; knowledge-router localEmbedder is a dead pass-through never populated (src/engine/agents-runtime/knowledge/knowledge-router.ts:232,240-242, embeddings.ts:44). I acknowledge the retirement is intentional; this issue is about the silent (unwarned) degradation plus the orphaned model bundle.

Environment

  • Branch or commit: refactor @ 5ddb9840 (compared against main @ b4ab97f)
  • Run mode: Tauri desktop
  • OS + version: Windows 11
  • Node + pnpm versions: not relevant (static source comparison)
  • Rust version, if relevant: not relevant (static source comparison)
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: see body

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Romuromylus on GitHub (Jun 5, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2283 Originally assigned to: @SpicyMarinara on GitHub. ## Summary The refactor intentionally retires the in-process ONNX all-MiniLM-L6-v2 embedder, but with no embedding provider configured it silently falls back to an FNV-hash bag-of-words for memory embeddings and short-circuits the knowledge-router semantic shortlist to keyword candidates, with no user-facing warning. The MiniLM model files still ship under resources but are referenced by zero code. ## Expected behavior Either keep a zero-config local embedding path, or surface a clear indication that semantic memory recall and semantic knowledge routing require a configured embedding-capable connection, and drop the now-orphaned model bundle from the shipped resources. ## Actual behavior With no embedding connection, memory embeddings become `source: "lexical"` (FNV hash) and `embedQuery` returns null so knowledge-router returns keyword fallback candidates, both silently. The retired model still ships at `src-tauri/resources/default-data/models/Xenova/all-MiniLM-L6-v2/` as dead weight. ## Steps to reproduce 1. Run the refactor with no embedding-capable connection configured (the zero-config default that worked on main via the local embedder). 2. Use memory recall and the knowledge router. 3. Observe lexical-only matching with no indication, and the orphaned model files present in the bundle. ## Impact area - [x] React-free engine behavior, contracts, agents, or capability ports - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime ## Regression notes Worked on main with zero config. Main is local-first: `packages/server/src/services/memory-recall.ts:64-66` calls `localEmbed` first, `local-embedder.ts:84` loads `Xenova/all-MiniLM-L6-v2`, and `memory-recall-embedding.ts:129` reports availability with no remote provider. The refactor has no ONNX/candle/fastembed/tokenizers code anywhere in src, src-tauri, or crates, and `prompts.rs:531-535` states the sidecar embeddings are retired. Lexical fallback at `src-tauri/src/commands/storage/chats.rs:139-160,236-241`; knowledge-router `localEmbedder` is a dead pass-through never populated (`src/engine/agents-runtime/knowledge/knowledge-router.ts:232,240-242`, `embeddings.ts:44`). I acknowledge the retirement is intentional; this issue is about the silent (unwarned) degradation plus the orphaned model bundle. ## Environment - Branch or commit: refactor @ 5ddb9840 (compared against main @ b4ab97f) - Run mode: Tauri desktop - OS + version: Windows 11 - Node + pnpm versions: not relevant (static source comparison) - Rust version, if relevant: not relevant (static source comparison) - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: see body ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:27:14 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Jun 6, 2026):

Let's drop the embedding model, allow the users to provide their own one or set up their own. Unless we need it for basic Memory Recall? The one we enable via Chat Settings. Let me cook.

<!-- gh-comment-id:4637976410 --> @SpicyMarinara commented on GitHub (Jun 6, 2026): Let's drop the embedding model, allow the users to provide their own one or set up their own. Unless we need it for basic Memory Recall? The one we enable via Chat Settings. Let me cook.
Author
Owner

@SpicyMarinara commented on GitHub (Jun 6, 2026):

Fixed on refactor in 75f548c7.

What changed:

  • Removed the retired Xenova/all-MiniLM-L6-v2 default resource bundle.
  • Replaced the old lexical hash fallback with weighted Unicode lexical feature hashing for Memory Recall storage and prompt-assembly fallback scoring.
  • Surfaced semantic-provider vs lexical-fallback status in Chat Settings, and clarified embedding model settings copy for the local fallback path.

Validation:

  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-engine lexical_memory
  • cargo test --manifest-path src-tauri/Cargo.toml -p marinara-engine embed_memory_content_uses_lexical_fallback_without_context
  • pnpm typecheck
  • cargo check --manifest-path src-tauri/Cargo.toml
  • pnpm check:architecture
  • pnpm build
  • pnpm check

Closing as completed.

<!-- gh-comment-id:4638021936 --> @SpicyMarinara commented on GitHub (Jun 6, 2026): Fixed on `refactor` in `75f548c7`. What changed: - Removed the retired `Xenova/all-MiniLM-L6-v2` default resource bundle. - Replaced the old lexical hash fallback with weighted Unicode lexical feature hashing for Memory Recall storage and prompt-assembly fallback scoring. - Surfaced semantic-provider vs lexical-fallback status in Chat Settings, and clarified embedding model settings copy for the local fallback path. Validation: - `cargo test --manifest-path src-tauri/Cargo.toml -p marinara-engine lexical_memory` - `cargo test --manifest-path src-tauri/Cargo.toml -p marinara-engine embed_memory_content_uses_lexical_fallback_without_context` - `pnpm typecheck` - `cargo check --manifest-path src-tauri/Cargo.toml` - `pnpm check:architecture` - `pnpm build` - `pnpm check` Closing as completed.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#1119
No description provided.