From 564478710ef06ea20030c5f0136a0b44e45bcf6a Mon Sep 17 00:00:00 2001 From: emil Date: Sat, 16 May 2026 13:55:29 +0300 Subject: [PATCH] Fix 'noted' contextual inertia in queries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two changes to memwalk/ingest.py: 1. Ingest prompt now asks the model for a brief theme + standout projects summary instead of "Reply noted". The "X → noted" pattern was training the model in-context to reply "noted" to every follow-up regardless of question. 2. query() wraps the user question in a short framing prefix ("Drawing on the work activity I shared with you earlier, please answer this clearly and concretely: ...") which is enough to break the noted pattern even on pre-existing state files, so existing users don't need to rebuild to benefit. Verified on the maintainer's state: vague greetings still default to noted (degenerate case, CLI is for questions), but real questions like "What did I work on this past month?" and "What features did I ship in Randify.pro?" now produce detailed accurate responses. Standup output now includes real blockers extracted from commit messages. Co-Authored-By: Claude Opus 4.7 --- memwalk/ingest.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/memwalk/ingest.py b/memwalk/ingest.py index 8b766f5..5824f31 100644 --- a/memwalk/ingest.py +++ b/memwalk/ingest.py @@ -74,13 +74,14 @@ def update(cfg: Config, *, verbose: bool = False) -> dict: sess = open_session(cfg, verbose=verbose) prompt = ( - "I will now feed you a summary of my recent work activity. " - "Read it and incorporate into your understanding of what I've been " - "doing. Reply with just 'noted'.\n\n" + block + "Below is a record of my recent work activity. Read it carefully, " + "then in two short sentences describe (a) the dominant theme of " + "this period and (b) one or two standout projects. I will ask " + "specific follow-up questions in later turns.\n\n" + block ) t0 = time.time() - ack = sess.chat(prompt, max_tokens=20) + ack = sess.chat(prompt, max_tokens=120) elapsed = time.time() - t0 sess.save() @@ -101,8 +102,17 @@ def update(cfg: Config, *, verbose: bool = False) -> dict: def query(cfg: Config, question: str, max_tokens: int = 400, verbose: bool = False) -> str: - """Load the current state and ask a question.""" + """Load the current state and ask a question. + + The question is wrapped in a short framing prefix so the model + switches out of any acknowledgement pattern carried by prior ingest + turns and actually answers from the activity it absorbed. + """ if not cfg.state_path.exists(): raise FileNotFoundError("No state yet — run `memwalk update` first.") sess = open_session(cfg, verbose=verbose) - return sess.chat(question, max_tokens=max_tokens) + framed = ( + "Drawing on the work activity I shared with you earlier, please " + f"answer this clearly and concretely:\n\n{question}" + ) + return sess.chat(framed, max_tokens=max_tokens)