[GH-ISSUE #1424] [Feature]: Bulk "unvectorize" lorebook entries (clear stored embeddings for selected/all entries) #706

Closed
opened 2026-10-20 17:32:08 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @GetBeholder on GitHub (May 27, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1424

Originally assigned to: @SpicyMarinara on GitHub.

What problem does this solve?

When lorebook entries get vectorized — e.g. accidentally, when the entries were
actually meant to trigger via regex/keywords rather than semantic matching — there
is no way to unvectorize them in bulk. The only known workaround is to go entry by
entry, make a tiny edit and undo it so autosave clears the vectorized state, which
is tedious for large lorebooks.

Proposed behavior

Add a bulk action to "unvectorize" selected or all lorebook entries — clearing
their stored embeddings (and/or marking them excluded from vectorization) — as the
inverse of the existing bulk vectorization.

Expected owner or impact area

  • App shell, navigation, startup, or providers
  • Catalog resources: chats, characters, personas, lorebooks, presets, connections, agents, gallery, or knowledge
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Refactor branch considerations

From a quick scan (triage pointer, not from the reporter): a lorebook entry's
vectorized state is the embedding: number[] | null field on the entry
(src/engine/contracts/types/lorebook.ts L191-194), with
excludeFromVectorization: boolean controlling whether bulk vectorization skips it
and whether semantic matching ignores any stored vector. An entry is shown as
"Vectorized" when embedding is a non-empty array
(src/features/catalog/lorebooks/components/LorebookEntryRow.tsx ~L313-315). The
per-entry workaround works because editing the content makes autosave clear/refresh
the stale embedding. Bulk vectorization already exists (referenced by the
excludeFromVectorization doc comment); this feature is the inverse — a bulk action
that sets embedding to null (unvectorize) for selected/all entries, e.g. a new
bulk hook alongside useBulkCreateEntries
(src/features/catalog/lorebooks/hooks/use-lorebooks.ts ~L285) plus a button in the
lorebook editor. Keep the embedding field/contract in the engine and the bulk
action in the lorebooks catalog.

Alternatives considered

The current per-entry workaround (edit an entry slightly, let autosave mark it
changed, then undo the edit), confirmed by community member Wozza and by the in-app
assistant; usable but tedious for many entries. Editing the database manually is
discouraged.

Additional context

Source: forum thread started by m;aemoifmpfmmafe (2-Star), 12:27 AM. The human
maintainer Sunny | Beyond asked whether bulk unvectorize is possible; the in-app
assistant "Professor Mari" confirmed there is no bulk "unvectorize selected/all"
action today and suggested the per-entry workaround. (Professor Mari is Marinara's
in-app AI assistant, not a human maintainer; its own repo search did not locate the
vectorization symbols — the grounding above identifies them.)

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 @GetBeholder on GitHub (May 27, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1424 Originally assigned to: @SpicyMarinara on GitHub. ## What problem does this solve? When lorebook entries get vectorized — e.g. accidentally, when the entries were actually meant to trigger via regex/keywords rather than semantic matching — there is no way to unvectorize them in bulk. The only known workaround is to go entry by entry, make a tiny edit and undo it so autosave clears the vectorized state, which is tedious for large lorebooks. ## Proposed behavior Add a bulk action to "unvectorize" selected or all lorebook entries — clearing their stored embeddings (and/or marking them excluded from vectorization) — as the inverse of the existing bulk vectorization. ## Expected owner or impact area - [ ] App shell, navigation, startup, or providers - [x] Catalog resources: chats, characters, personas, lorebooks, presets, connections, agents, gallery, or knowledge - [ ] Chat mode - [ ] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [ ] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [ ] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Refactor branch considerations From a quick scan (triage pointer, not from the reporter): a lorebook entry's vectorized state is the `embedding: number[] | null` field on the entry (`src/engine/contracts/types/lorebook.ts` L191-194), with `excludeFromVectorization: boolean` controlling whether bulk vectorization skips it and whether semantic matching ignores any stored vector. An entry is shown as "Vectorized" when `embedding` is a non-empty array (`src/features/catalog/lorebooks/components/LorebookEntryRow.tsx` ~L313-315). The per-entry workaround works because editing the content makes autosave clear/refresh the stale embedding. Bulk vectorization already exists (referenced by the `excludeFromVectorization` doc comment); this feature is the inverse — a bulk action that sets `embedding` to null (unvectorize) for selected/all entries, e.g. a new bulk hook alongside `useBulkCreateEntries` (`src/features/catalog/lorebooks/hooks/use-lorebooks.ts` ~L285) plus a button in the lorebook editor. Keep the embedding field/contract in the engine and the bulk action in the lorebooks catalog. ## Alternatives considered The current per-entry workaround (edit an entry slightly, let autosave mark it changed, then undo the edit), confirmed by community member Wozza and by the in-app assistant; usable but tedious for many entries. Editing the database manually is discouraged. ## Additional context Source: forum thread started by m;aemoifmpfmmafe (2-Star), 12:27 AM. The human maintainer Sunny | Beyond asked whether bulk unvectorize is possible; the in-app assistant "Professor Mari" confirmed there is no bulk "unvectorize selected/all" action today and suggested the per-entry workaround. (Professor Mari is Marinara's in-app AI assistant, not a human maintainer; its own repo search did not locate the vectorization symbols — the grounding above identifies them.) ## 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-20 17:32:08 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (May 27, 2026):

Agreed.

<!-- gh-comment-id:4557430068 --> @SpicyMarinara commented on GitHub (May 27, 2026): Agreed.
Author
Owner

@SpicyMarinara commented on GitHub (May 27, 2026):

Implemented on refactor.

What changed:

  • Added bulk unvectorize support for lorebook entries.
  • Added selected-entry and all-vectorized-entry UI actions that clear stored embeddings.
  • Invalidates lorebook entry and active-lorebook queries after the bulk clear.

Verification:

  • git diff --check
  • pnpm typecheck
  • pnpm lint
  • pnpm check:architecture
  • pnpm build
  • graphify update .
<!-- gh-comment-id:4557653705 --> @SpicyMarinara commented on GitHub (May 27, 2026): Implemented on `refactor`. What changed: - Added bulk unvectorize support for lorebook entries. - Added selected-entry and all-vectorized-entry UI actions that clear stored embeddings. - Invalidates lorebook entry and active-lorebook queries after the bulk clear. Verification: - `git diff --check` - `pnpm typecheck` - `pnpm lint` - `pnpm check:architecture` - `pnpm build` - `graphify update .`
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#706
No description provided.