Skip to content

fix: add_episode creates the episode when a supplied uuid is not found#1648

Open
brentkearney wants to merge 1 commit into
getzep:mainfrom
brentkearney:fix/add-episode-create-with-uuid
Open

fix: add_episode creates the episode when a supplied uuid is not found#1648
brentkearney wants to merge 1 commit into
getzep:mainfrom
brentkearney:fix/add-episode-create-with-uuid

Conversation

@brentkearney

@brentkearney brentkearney commented Jul 13, 2026

Copy link
Copy Markdown

Summary

Fixes #1646: add_episode currently raises NodeNotFoundError when given a uuid that 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:

  • uuid exists in the graph → reprocess that episode (unchanged)
  • uuid supplied but not found → create the episode with the supplied uuid (was: crash)
  • uuid omitted → 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_uuids before their processing completes — just pre-assign the ids) and covers the user-provided-id part of #961.

Changes

  • graphiti_core/graphiti.pyadd_episode catches NodeNotFoundError on the uuid lookup and falls through to creating the episode with the supplied uuid; docstring updated
  • mcp_server/src/graphiti_mcp_server.pyadd_memory docstring updated to document the new uuid semantics
  • tests/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

@zep-cla-assistant

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. For privacy information, see our Privacy Notice. You can sign the CLA by just posting a Pull Request Comment same as the below format.


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.

@brentkearney

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA behalf on myself, e-mail: 02cirque_ladles@icloud.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

add_episode raises NodeNotFoundError for a new uuid instead of creating the episode — blocks pre-assigned episode ids

1 participant