Isolate revision#134
Open
Jasonya wants to merge 6 commits into
Open
Conversation
Introduces a deterministic conflict-resolution path for semantic memory
inserts, with source provenance (turn_id / chunk_id / serial / occurred_at)
flowing from /memory/add through to stored records. Enabled per meta-agent
via the new `enable_conflict_resolution` flag; legacy free-form inserts
remain the default.
Schema:
- `users.turn_counter`, `users.chunk_counter` — per-user monotonic counters
used by `/memory/add` to fill in fallback provenance when the client does
not provide source_meta.
- `episodic_memory.source_refs`, `semantic_memory.source_refs` —
provenance pointers from stored memories back to their source units.
- `semantic_memory.prior_values` — history of values that have been
superseded under the conflict-resolution path.
Services:
- `UserManager.reserve_source_ids` — atomic counter bump used by the
/memory/add fallback.
- New `semantic_memory_upsert_fact` tool gated by the agent flag.
- `MetaAgent` system prompt augmentation when the flag is on.
Docs: `docs/mab_conflict_resolution_and_provenance.md`,
`docs/mab_raw_chunk_side_channel.md`,
`docs/mab_user_id_isolation_fix.md`.
(cherry picked from commit 2a172e5)
1. episodic_memory_manager: pgvector embedding-search SELECT was missing
source_refs, causing to_pydantic() to receive None for a non-nullable
List field — every episodic search threw a Pydantic ValidationError
and silently returned no memories. Add source_refs to the explicit
select() column list.
2. semantic_memory_manager: same bug on the semantic side, plus
prior_values. Add both to the embedding-search SELECT.
3. memory_tools.semantic_memory_insert: indexed item['source'] directly,
so any LLM call that omitted the source field (which it commonly
does — source is the least essential field) crashed with KeyError
and lost the whole item. Switch to item.get('source', '').
Net effect on LoCoMo conv-26 with 0201c config: 20.4% -> 80.3% (the
SELECT fix alone). The source KeyError was masking real semantic
memory writes in graph-mode LongMemEval ingest.
Also ignores evals/snapshots/ — local-only memory dumps, large and
regenerable.
(cherry picked from commit 20c2b05)
MAB caller (memory_tools.episodic_memory_merge) passes additional_source_ref but update_event lacked the param on this base (it lived in the v4-graph commit ccb419f). Port the param + source_refs-append handling from main so the merge tool stops raising TypeError.
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.
No description provided.