[PR #545] [MERGED] Fix Memory Recall embeddings on Termux #4666

Closed
opened 2026-10-22 04:09:38 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/545
Author: @cha1latte
Created: 5/8/2026
Status: ✅ Merged
Merged: 5/8/2026
Merged by: @cha1latte

Base: main ← Head: fix/issue-435-memory-recall-termux


📝 Commits (3)

  • ed391ca Fix Memory Recall embeddings on Termux
  • d1fb3ce Merge main into Termux memory recall fix
  • b414495 Address Memory Recall embedding review feedback

📊 Changes

7 files changed (+312 additions, -15 deletions)

View changed files

📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+9 -3)
📝 packages/server/src/routes/chats.routes.ts (+14 -1)
📝 packages/server/src/routes/generate.routes.ts (+21 -5)
➕ packages/server/src/services/memory-recall-embedding.ts (+104 -0)
📝 packages/server/src/services/memory-recall.ts (+36 -5)
📝 packages/server/test/memory-recall.test.ts (+126 -1)
📝 packages/shared/src/types/chat.ts (+2 -0)

📄 Description

## Linked issue

Closes #435

Why this change

  • Memory Recall can create chunks on Android/Termux, but local MiniLM embeddings may be unavailable because onnxruntime-node does not provide an android/<arch> native binding path. Those chunks stay stuck without vectors and the UI only reports Waiting for vector.

What changed

  • Added a Memory Recall embedding resolver that uses local MiniLM when available and falls back to the configured embedding connection/model.
  • Wired the fallback into both recall queries and background chunk vectorization so chunk vectors and query vectors use the same embedding source.
  • Added memory chunk status reporting so unavailable vectorization is shown as unavailable instead of endless waiting.
  • Added a memory rebuild action for chat memories so users can re-vectorize existing chunks after configuring embeddings.
  • Invalidated stale memory chunks when messages are edited or deleted so refresh rebuilds from current message text.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Machine verification performed from clean issue worktree C:\tmp\Marinara-Engine-issue-435:
    • pnpm install --frozen-lockfile
    • pnpm build:shared
    • pnpm --filter @marinara-engine/server exec tsx --test test/memory-recall.test.ts
    • pnpm --filter @marinara-engine/server exec tsx D:\dev\Marinara-Engine\scratch\issue-435-memory-fallback-verify.ts
    • pnpm check
  • Manual Termux verification is still needed: on an Android/Termux install, configure an embedding-capable connection/model, rebuild Memory Recall memories from the modal, and confirm chunks become Vectorized.
  • Browser click-through was not performed in this worktree; UI changes are limited to Memory Recall copy/status and the rebuild button wiring.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

N/A. This is primarily a backend Memory Recall embedding fallback and status/reporting fix. No browser screenshot was captured because the core claim requires Android/Termux plus a configured embedding provider.

Summary by CodeRabbit

Release Notes

  • New Features

    • Memory Recall now displays detailed embedding status for each memory chunk: "Vectorized," "Waiting for vector," or "Embedding unavailable."
  • Improvements

    • Updated Memory Recall settings help text to indicate usage of local embedding models when available, with configured embedding connections as fallback.

🔄 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-Engine/pull/545 **Author:** [@cha1latte](https://github.com/cha1latte) **Created:** 5/8/2026 **Status:** ✅ Merged **Merged:** 5/8/2026 **Merged by:** [@cha1latte](https://github.com/cha1latte) **Base:** `main` ← **Head:** `fix/issue-435-memory-recall-termux` --- ### 📝 Commits (3) - [`ed391ca`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ed391ca98707bcc1469461161583bfe3b8183605) Fix Memory Recall embeddings on Termux - [`d1fb3ce`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d1fb3cec45b69be822e161f0e8b593d1837c632d) Merge main into Termux memory recall fix - [`b414495`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b414495830769caa57cd9ae2df8abfa0ee8a9056) Address Memory Recall embedding review feedback ### 📊 Changes **7 files changed** (+312 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+9 -3) 📝 `packages/server/src/routes/chats.routes.ts` (+14 -1) 📝 `packages/server/src/routes/generate.routes.ts` (+21 -5) ➕ `packages/server/src/services/memory-recall-embedding.ts` (+104 -0) 📝 `packages/server/src/services/memory-recall.ts` (+36 -5) 📝 `packages/server/test/memory-recall.test.ts` (+126 -1) 📝 `packages/shared/src/types/chat.ts` (+2 -0) </details> ### 📄 Description ## Linked issue <!-- Every PR should reference a feature request or issue report. If there isn't one yet, open one first to gather opinions: --> <!-- https://github.com/Pasta-Devs/Marinara-Engine/issues/new/choose --> Closes #435 ## Why this change <!-- What user problem, bug, or goal does this solve? --> - Memory Recall can create chunks on Android/Termux, but local MiniLM embeddings may be unavailable because `onnxruntime-node` does not provide an `android/<arch>` native binding path. Those chunks stay stuck without vectors and the UI only reports `Waiting for vector`. ## What changed <!-- List the key changes in this PR --> - Added a Memory Recall embedding resolver that uses local MiniLM when available and falls back to the configured embedding connection/model. - Wired the fallback into both recall queries and background chunk vectorization so chunk vectors and query vectors use the same embedding source. - Added memory chunk status reporting so unavailable vectorization is shown as unavailable instead of endless waiting. - Added a memory rebuild action for chat memories so users can re-vectorize existing chunks after configuring embeddings. - Invalidated stale memory chunks when messages are edited or deleted so refresh rebuilds from current message text. ## Validation <!-- Required: include commands run and/or manual checks performed --> - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes <!-- Describe exactly what you tested in a real browser/app, step by step. --> <!-- ⚠️ If an AI agent filled out or ticked these boxes for you, treat them --> <!-- as a TO-DO LIST, not as proof the work is done. Verify each item yourself --> <!-- before submitting. If you haven't verified it, untick the box. --> - Machine verification performed from clean issue worktree `C:\tmp\Marinara-Engine-issue-435`: - `pnpm install --frozen-lockfile` - `pnpm build:shared` - `pnpm --filter @marinara-engine/server exec tsx --test test/memory-recall.test.ts` - `pnpm --filter @marinara-engine/server exec tsx D:\dev\Marinara-Engine\scratch\issue-435-memory-fallback-verify.ts` - `pnpm check` - Manual Termux verification is still needed: on an Android/Termux install, configure an embedding-capable connection/model, rebuild Memory Recall memories from the modal, and confirm chunks become `Vectorized`. - Browser click-through was not performed in this worktree; UI changes are limited to Memory Recall copy/status and the rebuild button wiring. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) N/A. This is primarily a backend Memory Recall embedding fallback and status/reporting fix. No browser screenshot was captured because the core claim requires Android/Termux plus a configured embedding provider. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **New Features** * Memory Recall now displays detailed embedding status for each memory chunk: "Vectorized," "Waiting for vector," or "Embedding unavailable." * **Improvements** * Updated Memory Recall settings help text to indicate usage of local embedding models when available, with configured embedding connections as fallback. <!-- 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-22 04:09:38 +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-Engine#4666
No description provided.