mavend: centralize action validation boundary (slice 4)

This commit is contained in:
2026-09-06 12:53:54 +04:00
parent 6a402bf556
commit 356766bce1
32 changed files with 2061 additions and 178 deletions
+43 -1
View File
@@ -986,6 +986,48 @@ ends with `make test` green (gofmt + vet + `-race`), no exceptions.
---
## Prior art — external memory systems
Read before proposing a change to how memory is extracted or read back. Nothing
here is adopted. Each entry says what does not transfer and what a cheap
experiment against it would be.
### VoiceMem (github.com/xzf-thu/VoiceMem, Apache 2.0)
A streaming memory system for voice assistants, surveyed 2026-08-30. Python,
Chinese-first. A "left brain" of keyed structured facts and a "right brain" of
affect and relationship nodes, both extracted and queried while the user is
still speaking.
**What does not transfer.** Its speech stack is Paraformer-zh streaming STT with
Qwen-Omni or Step-Audio2-Mini as the conversational model. Maven runs
whisper.cpp, piper and Qwen3-1.7B. It is a Python library, so adopting the code
means a Python service on homesrv behind a new daemon seam (`docs/offload.md`),
which is a large cost for a Chinese-tuned pipeline. The licence is not the
barrier.
**What is worth taking.**
- **Streaming extraction.** Extraction and retrieval start on partial
transcripts, not on a final one. Maven's `runTurn` waits for mavsttd to
finish. This is the larger win and the larger change, because it touches both
the STT seam and the turn ladder.
- **A hard retrieval token budget.** They report roughly 430 memory tokens per
query. At `n_ctx` 4096 the constraint binds directly on what memory may put in
front of the resident model. This is the cheapest experiment: measure Maven's
existing recall evals against a capped budget.
- **The fact/affect split.** The factual half is what Maven already has. Affect
and relationship nodes have no equivalent here, and they bear on § save-where.
- **A shared embedder.** They also use multilingual-E5, so their retrieval
scoring ports without a model change.
**Read their numbers carefully.** 91.2% on LoCoMo against 61.68% for Mem0 is
self-reported by the authors with no independent replication found. The 134ms
figure is memory-system latency, not a turn including STT and the resident
model. Both LoCoMo and PersonaMem are English and Chinese, so no claim there
holds for Russian recall until a translated fixture exists. Any number taken
from this section into Maven's prose needs a `docs/evals/` file behind it.
## Open questions
Router+invocation, two-memory routing, presence, and auth were once listed
@@ -1019,7 +1061,7 @@ here and are resolved by the sections above.
- **compound captures** — "slept 6h, fan noise wrecked it" = one fact + one
note in one utterance. Needs a second pass or it loses half.
- **query read-path** — semantic RAG vs a structured read, depending on the
ask.
ask. Prior art in § Prior art — external memory systems (VoiceMem).
- **presence — away tap override** — an explicit `away` tap as a hard
override. Clean extension, deferred; scoring stands without it.
- **presence — weights/τ hand-tuning** — first-guess numbers; expect tuning