feat(memory): v2 conversation history store and its context in the reply prompt
- src/jarvis/memory/history.py keeps voice transcripts, Jarvis's answers, registered chat channel messages (with edits and deletes) and voice channel presence in one SQLite file. Every read is scoped to the asker: own records always, chat channels and others' words (only while the asker was in the same voice channel) behind settings, plus an optional since and off. - Search is language-agnostic: Unicode words, prefixes keeping 60% of the word, rarer words weigh more, newer wins ties. 100k records search in 24-61 ms here. context() returns the recent window and the matches cut to a token budget, matches at most half so chatter cannot push out the record the question is about. - run_reply_engine(history=...) puts that context into the system prompt under "Information shared in previous conversations", fenced as data. evals/test_history_context_recall.py: with the block qwen2.5:7b answers the stored day in Korean and English (3 of 3 runs), without it the day is unknown. - Spec history.spec.md, registry entry in CLAUDE.md, reply.spec.md, docs/llm_contexts.md, docs/v2/memory.md and roadmap updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -26,6 +26,7 @@ Any code change must either adhere to our spec files perfectly or you should ask
|
||||
| `src/jarvis/tools/builtin/nutrition/log_meal.spec.md` | logMeal tool: single-property schema for planner fast-path, internal nutrition extraction, untrusted-data fence, follow-ups | Public schema is a single optional `meal` string; nutrition fields are internal; user text is fenced as data |
|
||||
| `src/jarvis/utils/location.spec.md` | GeoIP location detection | Privacy-first; local GeoLite2 DB only |
|
||||
| `src/jarvis/memory/graph.spec.md` | Node graph memory (v2), self-organising tree, UI explorer | Dynamic structure; access-aware; auto-split/merge (future) |
|
||||
| `src/jarvis/memory/history.spec.md` | v2 conversation history store: voice transcripts, answers and registered chat channel messages; per-asker scope (own, chat channels, others only while co-present); language-agnostic prefix search; size-budgeted context for the reply engine | Only what the asker may see; logs carry no record text; whole history searched, little sent |
|
||||
| `src/jarvis/memory/summariser.spec.md` | Diary summariser prompt contract, hygiene rules (deflection, attribution, topic separation), post-process scrub, and bulk-sweep clean button | Two-layer defence: prompt + deterministic scrub; corrupted summaries poison every downstream consumer |
|
||||
| `src/jarvis/memory/recall_gate.spec.md` | Deterministic skip-enrichment heuristic when the hot window covers a follow-up | Fail-open; language-agnostic via `\w{3,}` + `re.UNICODE`; planner intent always wins |
|
||||
| `src/voice_worker/voice_worker.spec.md` | v2 voice worker: multi-speaker streaming STT (shared Whisper, batched) and sentence TTS over a local WebSocket | Loopback only with an app token; no transcript text in logs; finals before partials; language-agnostic |
|
||||
|
||||
Reference in New Issue
Block a user