[Bug]: Plain-text case memories from remember API always fail case embedding_template — Missing embedding template variables
Summary
Saving a case-category memory via the public viking_remember API (plain-text content) produces a memory file whose MEMORY_FIELDS contain only version, so the case schema's embedding_template variables are all missing. Vectorization then falls back to plain content with a WARNING. Data is not lost, but the case-type structured embedding contract is silently broken for any case memory that did not come from the compressor's CaseSpec path.
Environment
- OpenViking server: v0.4.15 (Docker deployment, single host, healthy)
- Models: local llama.cpp multi-model routing (8B LLM / 4B embedding / 0.6B reranker)
- Memory written via: MCP
remembertool,category=case, plain-text content (no structured fields)
Reproduction
viking_remember(content=<plain text conclusion note>, category=case)- The server writes
memories/cases/mem_<id>.mdwhoseMEMORY_FIELDSblock is:
{
"version": 1
}
- During vectorization of the written file,
memory_updater.py(~line 1413, v0.4.15) looks up thecaseschema'sembedding_templateand finds all template variables missing:
2026-08-18 23:42:27,592 - openviking.session.memory.memory_updater - WARNING - [] Missing embedding template variables for viking://user/hermes/peers/hermes/memories/cases/mem_e845325baa51.md, falling back to plain content: ['case_name', 'input', 'rubric', 'task_signature']
The case schema template (prompts/templates/memory/cases.yaml, v0.4.15)
embedding_template: |-
{{ case_name }}
{{ task_signature }}
{{ input }}
{{ rubric }}
The template (and the overview_template, which also references item.file_content.case_name / task_signature) is only satisfiable by memories produced by the compressor's structured CaseSpec path. The public remember API accepts category=case with arbitrary plain text and writes it as a bare case memory, so the template is guaranteed to fail for those files.
Expected behavior
One of:
- The remember API path fills the case schema fields (or at least
case_name/task_signature) whencategory=caseand content is plain text, so the template renders; or - Template variables in
embedding_templateare treated as optional (render as empty/omitted when missing), so plain-text case memories vectorize without the warning and the overview template degrades gracefully instead of rendering missing-field placeholders; or - The remember API rejects / warns on
category=casefor plain-text content that does not include the required case fields, so users get an immediate signal instead of a later WARNING.
Option 1 or 2 preferred — the current fallback works (embedding is produced from plain content) but the structured contract is silently bypassed, and overview_template for the cases folder will render undefined-style placeholders for these files.
Related
- No prior issue found covering this (searched "embedding template", "case_name rubric").
- Same area as #3598 (case/overview rendering) but distinct: that one is about
# Summaryheading regex; this one is about template variables for plain-text case memories written via the remember API.
Happy to test a fix build against the same deployment if useful.
Adding a second, independent reproduction of the same symptom on a different code path, in case it helps establish this is systematic rather than specific to the remember API.
Environment
- OpenViking v0.4.21 (uv tool install, macOS), server on
127.0.0.1:1933 - Path:
openviking.session.memory.memory_updater(memory file update, not therememberAPI) - Trigger: bulk link updates on existing memory files
Evidence
2026-09-15 21:13:55,596 - openviking.session.memory.memory_updater - WARNING -
Missing embedding template variables for
viking://user/default/memories/events/2026/09/15/OpenViking未修复清单盘点.md,
falling back to plain content
2026-09-15 21:13:55,598 - ... viking://user/default/memories/events/2026/09/15/link_enabled生效结论纠正.md
2026-09-15 21:14:06,249 - ... viking://user/default/memories/entities/软件项目/openviking.md,
falling back to plain content: ['category']
2026-09-16 09:11:05,804 - ... viking://user/default/memories/events/2026/09/16/openviking日志问题排查.md
Missing variable sets observed: ['event_name', 'goal'] and ['category'] — i.e. event-type and entity-type schemas, not only case.
How it differs from the original report
- Not the
rememberAPI; noCaseSpecinvolved. - The files already existed with valid metadata and had been embedded before. The variables go missing after a subsequent update, which is consistent with the metadata block being overwritten during batch link updates rather than never being set in the first place.
- Same terminal symptom:
embedding_templatecannot render → plain-content fallback + WARNING. Data is not lost, but the structured embedding contract for these memories is silently broken, which degrades retrieval quality for exactly the files that were just updated.
Happy to provide full log excerpts or the affected memory files if useful.