You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
query_memory dropped entity names. Hits were built from e.description ?? e.name, and createGraphExtractor always writes a
description, so the name -- which is the actual fact -- never reached the model. Asked "which language do I prefer?" the agent replied that the memory didn't specify, and sometimes reconstructed a fragment of a name it had never been shown ("You're based in Ban."). Long-term hits now render as "name -- description". Dedup keys separately from display, so cross-source dedup is unchanged and two entities sharing a description both survive.
Extraction never ran on OpenAI. Strict structured-output mode requires every property to appear in required; both .optional() on entity.description and .default([]) on relationships dropped their keys. OpenAI reports only the first, so fixing description alone would have left the feature dead. storeMemory swallowed the rejection and fell back to a flat entity, which is why this survived a release. A test now asserts strict compliance against the schema actually sent.
Memory extracted its own output. Answering "what do you remember about me?" and storing that answer minted entities about remembering (profile details [Object]), which then outranked the real facts on the next such question -- every ask degraded the next. store_memory's description previously invited exactly this; it now tells the model never to store recall output. Backing that up, extraction skips common nouns and keeps the proper nouns it already asks for, which needs no vocabulary list and does not misfire on caseless scripts.
fix prompt mutation on retry, add ensureMemoryStored
transformParams edited params.prompt in place. The AI SDK rebuilds the
params object for each retry attempt of a step but passes the same prompt
array every time, and transformParams re-runs on every attempt — so a
retried call stacked a second memory block onto the prompt, then persisted
the memory-augmented text as the user's own message. That message is
itself retrievable, so each retry permanently poisoned short-term memory.
withMemoryBlock() now returns a copy and the clean-text snapshot is keyed
on the returned params object, so re-entry is idempotent by construction.
The existing multi-step test missed this: it passes a fresh prompt array
per call, which models the tool loop correctly (the SDK does rebuild
promptMessages per step) but not the retry path. Two regression tests
cover it now.
ensureMemoryStored(tools) is the store_memory counterpart to
enforceQueryMemory(). prepareStep cannot reach the write side — the loop
ends when the model emits final text, so there is no later step to force —
so the guarantee runs as an onFinish hook instead, persisting the turn when
the model never called store_memory. Defaults to type 'interaction' rather
than 'fact': storing an agent's own summary as a fact is the
self-referential input the graph extractor already rejects.
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
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.
Fixed these issues
query_memory dropped entity names. Hits were built from
e.description ?? e.name, and createGraphExtractor always writes adescription, so the name -- which is the actual fact -- never reached the model. Asked "which language do I prefer?" the agent replied that the memory didn't specify, and sometimes reconstructed a fragment of a name it had never been shown ("You're based in Ban."). Long-term hits now render as "name -- description". Dedup keys separately from display, so cross-source dedup is unchanged and two entities sharing a description both survive.
Extraction never ran on OpenAI. Strict structured-output mode requires every property to appear in
required; both.optional()on entity.description and.default([])on relationships dropped their keys. OpenAI reports only the first, so fixing description alone would have left the feature dead. storeMemory swallowed the rejection and fell back to a flat entity, which is why this survived a release. A test now asserts strict compliance against the schema actually sent.Memory extracted its own output. Answering "what do you remember about me?" and storing that answer minted entities about remembering (
profile details [Object]), which then outranked the real facts on the next such question -- every ask degraded the next. store_memory's description previously invited exactly this; it now tells the model never to store recall output. Backing that up, extraction skips common nouns and keeps the proper nouns it already asks for, which needs no vocabulary list and does not misfire on caseless scripts.