[PR #1310] [MERGED] fix(long-term-memory): 1.4.26 — embed recall queries as queries #1395

Closed
opened 2026-10-21 05:10:22 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Agents/pull/1310
Author: @Promansis
Created: 10/11/2026
Status: ✅ Merged
Merged: 10/11/2026
Merged by: @Promansis

Base: staging ← Head: fix(long-term-memory)/1302-recall-query-input-type


📝 Commits (2)

  • 6224f42 fix(long-term-memory): 1.4.26 — embed recall queries as queries
  • b50490e Merge branch 'staging' into fix(long-term-memory)/1302-recall-query-input-type

📊 Changes

15 files changed (+72 additions, -49 deletions)

View changed files

➕ artifacts/long-term-memory-1.4.26.zip (+0 -0)
📝 catalog/catalog.json (+6 -6)
📝 catalog/notes.json (+6 -6)
📝 catalog/v2/catalog.json (+6 -6)
📝 catalog/v2/notes.json (+6 -6)
📝 catalog/v3/catalog.json (+6 -6)
📝 catalog/v3/notes.json (+6 -6)
📝 packages/long-term-memory/CHANGELOG.md (+4 -0)
📝 packages/long-term-memory/manifest.json (+3 -3)
📝 packages/long-term-memory/server.mjs (+2 -2)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/embedding-adapter.ts (+10 -3)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/package-runtime.ts (+1 -1)
📝 packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/retrieval.ts (+3 -1)
📝 scripts/build-feature-packages.mjs (+1 -1)
📝 tests/long-term-memory-runtime.regression.ts (+12 -2)

📄 Description

Pull request

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #1302

Why this change

Long-Term Memory embedded the recall search text through the same path as indexed chunks and never marked it as a query. With E5, nomic-embed-text or Snowflake Arctic Embed v2 models, the search therefore received the document prefix instead of the query prefix, which weakens semantic recall. This is the package half of Pasta-Devs/Marinara-Engine#7429; the Engine half applies the input type, and this change is what makes LTM send it.

What changed

  • Affected package: long-term-memory 1.4.25 → 1.4.26.
  • package-runtime.ts: PackageEmbeddingAdapter.embed takes an optional third positional inputType ("query" | "document").
  • embedding-adapter.ts: the embedder passes inputType to both adapter.embed calls and defaults to "document". The option is declared on the embedder only, not on the shared MemoryRecallEmbeddingOptions, so a rebuild or retrieval input cannot carry it.
  • retrieval.ts: the recall query embed passes inputType: "query"; rebuild.ts is unchanged and gets "document" through the default.
  • tests/long-term-memory-runtime.regression.ts: the fake adapter records the third argument. Rebuild must send only "document" (including both batches of a split batch), and the recall query must send "query".
  • Rebuilt outputs from the builder only: manifest.json, server.mjs (2 changed spans), artifacts/long-term-memory-1.4.26.zip, the catalog lanes and release notes. scripts/build-feature-packages.mjs carries the version.

Package and security impact

  • Affected package IDs: long-term-memory
  • Engine compatibility impact: none. engine.min 2.4.1 / maxExclusive 4.0.0 and capabilityApi 1.6 are unchanged. The argument is positional because older Engines hand the second argument to AbortSignal.any, which would throw on an options object; they ignore a third one. The change takes effect on Engines that include Pasta-Devs/Marinara-Engine#7429.
  • New or changed permissions/entrypoints: none.
  • Restart, storage, update, or uninstall impact: none. spaceId is unchanged and stored vectors were already document embeddings, so no reindex runs.

Validation

  • node scripts/validate-catalog.mjs passes locally
  • git diff --check passes locally
  • Rebuilt every affected manifest, payload, artifact, and catalog entry
  • Installed or updated the affected package through Marinara Engine
  • Checked supported modes, restart behavior, and uninstall cleanup
  • Read and followed CONTRIBUTING.md

Manual verification notes

Documentation impact

  • No documentation changes needed
  • Updated this README catalog and package guidance
  • Updated linked Marinara Engine documentation

UI evidence (if applicable)

Not applicable; no UI change.

Summary by CodeRabbit

  • New Features
    • Recall searches now identify search text as a query when requesting embeddings, supporting models that apply query-specific prefixes.
    • Existing stored memories do not need to be reindexed.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Agents/pull/1310 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 10/11/2026 **Status:** ✅ Merged **Merged:** 10/11/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `fix(long-term-memory)/1302-recall-query-input-type` --- ### 📝 Commits (2) - [`6224f42`](https://github.com/Pasta-Devs/Marinara-Agents/commit/6224f421c05bb29ab8fde22b0b32979661b7ae6a) fix(long-term-memory): 1.4.26 — embed recall queries as queries - [`b50490e`](https://github.com/Pasta-Devs/Marinara-Agents/commit/b50490e9c79ecff6e9c03d8b006030926ecd601a) Merge branch 'staging' into fix(long-term-memory)/1302-recall-query-input-type ### 📊 Changes **15 files changed** (+72 additions, -49 deletions) <details> <summary>View changed files</summary> ➕ `artifacts/long-term-memory-1.4.26.zip` (+0 -0) 📝 `catalog/catalog.json` (+6 -6) 📝 `catalog/notes.json` (+6 -6) 📝 `catalog/v2/catalog.json` (+6 -6) 📝 `catalog/v2/notes.json` (+6 -6) 📝 `catalog/v3/catalog.json` (+6 -6) 📝 `catalog/v3/notes.json` (+6 -6) 📝 `packages/long-term-memory/CHANGELOG.md` (+4 -0) 📝 `packages/long-term-memory/manifest.json` (+3 -3) 📝 `packages/long-term-memory/server.mjs` (+2 -2) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/embedding-adapter.ts` (+10 -3) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/package-runtime.ts` (+1 -1) 📝 `packages/long-term-memory/src/engine/packages/server/src/services/long-term-memory/retrieval.ts` (+3 -1) 📝 `scripts/build-feature-packages.mjs` (+1 -1) 📝 `tests/long-term-memory-runtime.regression.ts` (+12 -2) </details> ### 📄 Description # Pull request > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #1302 ## Why this change Long-Term Memory embedded the recall search text through the same path as indexed chunks and never marked it as a query. With E5, nomic-embed-text or Snowflake Arctic Embed v2 models, the search therefore received the document prefix instead of the query prefix, which weakens semantic recall. This is the package half of Pasta-Devs/Marinara-Engine#7429; the Engine half applies the input type, and this change is what makes LTM send it. ## What changed - Affected package: `long-term-memory` 1.4.25 → 1.4.26. - `package-runtime.ts`: `PackageEmbeddingAdapter.embed` takes an optional third positional `inputType` (`"query" | "document"`). - `embedding-adapter.ts`: the embedder passes `inputType` to both `adapter.embed` calls and defaults to `"document"`. The option is declared on the embedder only, not on the shared `MemoryRecallEmbeddingOptions`, so a rebuild or retrieval input cannot carry it. - `retrieval.ts`: the recall query embed passes `inputType: "query"`; `rebuild.ts` is unchanged and gets `"document"` through the default. - `tests/long-term-memory-runtime.regression.ts`: the fake adapter records the third argument. Rebuild must send only `"document"` (including both batches of a split batch), and the recall query must send `"query"`. - Rebuilt outputs from the builder only: `manifest.json`, `server.mjs` (2 changed spans), `artifacts/long-term-memory-1.4.26.zip`, the catalog lanes and release notes. `scripts/build-feature-packages.mjs` carries the version. ## Package and security impact - Affected package IDs: `long-term-memory` - Engine compatibility impact: none. `engine.min` 2.4.1 / `maxExclusive` 4.0.0 and `capabilityApi` 1.6 are unchanged. The argument is positional because older Engines hand the second argument to `AbortSignal.any`, which would throw on an options object; they ignore a third one. The change takes effect on Engines that include Pasta-Devs/Marinara-Engine#7429. - New or changed permissions/entrypoints: none. - Restart, storage, update, or uninstall impact: none. `spaceId` is unchanged and stored vectors were already document embeddings, so no reindex runs. ## Validation <!-- These are human tasks. Never tick a box for a check that was not actually performed. --> - [ ] `node scripts/validate-catalog.mjs` passes locally - [ ] `git diff --check` passes locally - [ ] Rebuilt every affected manifest, payload, artifact, and catalog entry - [ ] Installed or updated the affected package through Marinara Engine - [ ] Checked supported modes, restart behavior, and uninstall cleanup - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - ## Documentation impact - [ ] No documentation changes needed - [ ] Updated this README catalog and package guidance - [ ] Updated linked Marinara Engine documentation ## UI evidence (if applicable) Not applicable; no UI change. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Recall searches now identify search text as a query when requesting embeddings, supporting models that apply query-specific prefixes. * Existing stored memories do not need to be reindexed. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-21 05:10:22 +07:00
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-Agents#1395
No description provided.