Add long-term memory retrieval powered by qmd (BM25 and VSearch).#34
Open
mczabca-boop wants to merge 6 commits intomainfrom
Open
Add long-term memory retrieval powered by qmd (BM25 and VSearch).#34mczabca-boop wants to merge 6 commits intomainfrom
mczabca-boop wants to merge 6 commits intomainfrom
Conversation
a9ae0ca to
5b0f7ce
Compare
* fix(whatsapp): fail fast when Puppeteer Chrome is missing * fix(whatsapp): validate Puppeteer executable path exists
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Title
Improve QMD Memory Retrieval Reliability, Observability, and Claude Injection Safety
Summary
This PR hardens TinyClaw’s memory pipeline end-to-end and removes several reliability pitfalls found during real Telegram regression testing.
It keeps memory retrieval QMD-centric (BM25 + VSearch), improves retrieval quality and debug visibility, and fixes the critical issue where memory snippets were retrieved but not reliably consumed by Claude.
Why
Memory behavior was inconsistent in production-like tests due to:
CLAUDE.mdThis PR addresses those issues while preserving optional memory and safe defaults.
Key Changes
1. QMD retrieval flow hardening
qmd search)qmd vsearch)2. Reranking and snippet quality improvements
src/lib/memory-rerank.tsmemory.rerank.3. Turn hydration bug fixes
_vs-)User/Assistantturn content instead of raw patch-like snippets.4. Claude memory injection redesign
.claude/MEMORY.md.claude/CLAUDE.mdruntime sectionMEMORY.md.5. Embed/update behavior and latency improvements
embed_interval_seconds:6006. Logging and observability
qmd-bm25/qmd-vsearch7. Configuration/setup/docs updates
Use semantic search (vector, experimental)? [y/N]Validation Performed
npm run build:mainpassed after changes.bash -n lib/setup-wizard.shpassed.qmd-vsearch,qmd-bm25where applicable).claude/CLAUDE.md (runtime section)Who likes rock?) now correctly answers from retrieved memory after injection fixresetdoes not wipe persisted QMD memory (session reset behavior preserved).Backward Compatibility
Notes / Reviewer Focus
Please focus review on:
src/lib/memory.tsretrieval flow + fallback + hydration/reranksrc/lib/memory-rerank.tsconfiguration-driven heuristicssrc/lib/invoke.tsmarker-based CLAUDE.md runtime injection/cleanup safety