fix: mark entityContext few-shots so extractors do not store them as facts - #113
Open
Divyansh151005 wants to merge 1 commit into
Open
Conversation
…facts Local extractors were lifting the turborepo/Drizzle examples out of AGENT_ENTITY_CONTEXT because the server splices that field into space context with no delimiter. Wrap the examples in XML tags matching the server's chunk idiom and close with a short guidance delimiter, staying under the 1500-char entityContext limit. Fixes supermemoryai#111
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
AGENT_ENTITY_CONTEXTis sent asentityContexton every capture. Against self-hosted servers with a local extractor, the few-shot Architecture/Conventions/… quotes were periodically stored as atomic facts about the user's own repo (similarity 0.90–1.00), outranking real content — e.g. inventing "uses monorepo with turborepo" for a Bash/Python toolkit.The server splices
entityContextintospace context:with no delimiter while the document is wrapped in<chunk position="N">, so bare quoted examples look like facts to extract.Fix
Text-only change in
plugin/hooks/lib/api.js:<examples note="another project, never extract">…</examples>(same XML idiom the server already uses for chunks)</guidance> The document follows. Extract only from it.entityContextlimit (marked string is 1315)No logic or dependency changes. Matches the approach validated in #111 (9 consecutive clean runs after marking).
Testing
Includes a new unit assertion that the markers are present, the turborepo/Drizzle quotes sit inside the examples block, and length stays ≤1500.
Fixes #111