Repository navigation
Priors: the user's standing instructions in every prompt; download retries - #7
Merged
Merged
Conversation
…ger crashes The PR's Linux smoke test died on an unhandled ESocketError: DNS for Hugging Face's CDN host failed once during first-run provisioning, and ProvisionRetrieval let the exception escape instead of falling back to the lexical embedder. HttpsGetToFile now retries socket errors (DNS, reset) after 2 s and 4 s; ProvisionRetrieval reports a download that still fails and returns False. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NPVFJHeBeotAKkU7EPbTgn
Mem.Priors finds standing instructions in the user's words (from now on, always/never, don't + an answering verb, I prefer + an answer word, you can ...), and matches each against stored priors as a confirmation or a contradiction (content-word Jaccard, polarity from negators). TMemStore keeps priors with alpha:beta evidence counts and a prior_evidence log in which each message counts once; confidence = alpha / (alpha + beta), a remark starts at 1:1, /prior at 3:1. Contradicted down to deprecate_under a prior is deprecated, never deleted, and confirmed back it returns. The most confident active priors go into the system prompt, at most max_in_prompt, and of two opposite ones only the more confident (or newer). /priors, /prior <text>|drop <id>|restore <id>, /prompt <text> (the system prompt a message would get), /status line. [priors] in memagent.ini. Tests: memagent/tests/priors_test.lpr (make test-pascal), scripts/e2e_priors.sh. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NPVFJHeBeotAKkU7EPbTgn
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NPVFJHeBeotAKkU7EPbTgn
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.
Priors
Facts say what is true about the user; priors say how to answer them.
Mem.Priors): "from now on keep your answers to one sentence", "never use emojis", "I prefer short answers" or/prior <text>become priors.alpha / (alpha + beta).prior_evidencecounts each user message once per prior, so the same remark is never re-weighed on later turns./priorat 3:1.delta × volatilityis applied: there the same evidence is reread each turn and the value drifts to whatever the observer asks.deprecate_underis deprecated, never deleted, and comes back if confirmed again.max_in_promptpriors at or abovemin_confidence, under "The user's standing instructions"./priors(each prior with its evidence, and why it is in or out of the prompt),/prior <text>|drop <id>|restore <id>,/prompt <text>(the exact system prompt a message would get), and a/statusline.[priors]inmemagent.ini.Downloads (carried over from #6, merged before it)
The #6 Linux smoke test died with an unhandled
ESocketError: a single DNS failure for Hugging Face's CDN during first-run provisioning, andProvisionRetrievallet the exception escape instead of falling back to the lexical embedder.HttpsGetToFilenow retries socket errors after 2 s and 4 s.Tests
make test: pass. Includes the newmemagent/tests/priors_test.lpr, 30 checks covering detection, matching, evidence once per message, deprecation and restoring.scripts/e2e_priors.sh, on the real binary with no training: pass./priorsets one and/prior dropdrops one./promptshows the right priors, with the losing one of an opposite pair left out.Generated by Claude Code