fix: add_episode creates the episode when a supplied uuid is not found#1648
fix: add_episode creates the episode when a supplied uuid is not found#1648brentkearney wants to merge 1 commit into
Conversation
|
I have read the CLA Document and I hereby sign the CLA behalf on myself, e-mail: example@example.com or I have read the CLA Document and I hereby sign the CLA behalf of my company, e-mail: example@example.com Signature is valid for 6 months. This bot will be retriggered when the Contributor License Agreement comment has been provided. Posted by the CLA Assistant Lite bot. |
|
I have read the CLA Document and I hereby sign the CLA behalf on myself, e-mail: 02cirque_ladles@icloud.com |
Summary
Fixes #1646:
add_episodecurrently raisesNodeNotFoundErrorwhen given auuidthat isn't in the graph yet. This change makes it create the episode under the supplied uuid instead, so callers can pre-assign episode ids.Behavior after the change:
uuidexists in the graph → reprocess that episode (unchanged)uuidsupplied but not found → create the episode with the supplied uuid (was: crash)uuidomitted → generate one (unchanged)The only code path that changes is the one that currently raises, so no existing caller is affected. Creating under a supplied uuid matches the MERGE-on-uuid semantics the save path already uses.
This also gives callers the primitive requested in #1283 (reference episodes in
previous_episode_uuidsbefore their processing completes — just pre-assign the ids) and covers the user-provided-id part of #961.Changes
graphiti_core/graphiti.py—add_episodecatchesNodeNotFoundErroron the uuid lookup and falls through to creating the episode with the supplied uuid; docstring updatedmcp_server/src/graphiti_mcp_server.py—add_memorydocstring updated to document the new uuid semanticstests/test_add_episode_uuid.py— tests for all three uuid paths (existing uuid reprocesses, new uuid creates with that uuid, omitted uuid generates)Closes #1646