feat(plugins): optional yantrik_memory — semantic memory + supersession (opt-in)#465
Open
spranab wants to merge 2 commits into
Open
feat(plugins): optional yantrik_memory — semantic memory + supersession (opt-in)#465spranab wants to merge 2 commits into
spranab wants to merge 2 commits into
Conversation
A new opt-in, off-by-default plugin that adds a YantrikDB-backed memory layer alongside puppy_kennel: - distills durable facts/preferences from natural conversation - supersedes outdated facts (correct()) instead of accumulating them - surfaces query-relevant memories passively each turn Mirrors the puppy_kennel plugin contract (load_prompt / user_prompt_submit / agent_run_end / register_tools / custom_command). Fail-soft: inert if yantrikdb is not installed or when disabled. Zero changes to existing code.
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.
What this adds
An optional, off-by-default plugin (
code_puppy/plugins/yantrik_memory/) thatadds a YantrikDB-backed semantic/learning memory layer alongside
puppy_kennel— not a replacement. Heads-up discussion: #464.
It mirrors the kennel's plugin contract (
load_prompt,user_prompt_submit,agent_run_end,register_tools,/yantrikcommand), and:correct()instead of accumulating them,Why (honest framing)
The kennel's P0 prefs band already handles basic fact recall well — so on "is the
fact recalled," a prefs-band baseline ties this; I'm not claiming better
recall. What an append-only prefs store can't do, and this adds:
(it's append-only), so the agent gets contradictory context; this drops the stale
value. Verified stable from 1k→10k memories (the append-only band still carries
both at 10k; this carries only green).
finding the right past artifact otherwise relies on recency or the agent calling
the BM25 search tool.
Safety / footprint
/yantrik enable.yantrikdbisn't installed (or it's disabled), the plugin isinert — registers no callbacks, never crashes boot or a turn.
yantrikdb); embedder is configurable down to a bundledno-ONNX option.
Testing
test_integration.py): distills facts, supersession works(recall's current band = green, stale blue gone), chatter adds nothing.
kennel); via the real callback bus,
on_user_prompt_submitdistills andon_load_promptinjects the correct (superseded) recall block.Known limitations (full disclosure)
not free; worth making async. Optional and model-configurable.
callback dispatchers).
attribute-value updates, so supersession uses an explicit
correct()at the applayer (the distiller detects the update). The engine side is being addressed
separately.
Happy to adjust to your plugin/dependency conventions — flagging this as a starting
point for discussion as much as a merge candidate.