8000 [GH-943] Simplify Episode store add_episodes by o-love · Pull Request #989 · MemMachine/MemMachine · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@o-love
Copy link
Contributor
@o-love o-love commented Jan 27, 2026

Purpose of the change

Simplify Episode Store add_episode logic.

Remove multiple transactions and remapping Episodes. Fixing KeyError.

Fixes #943

@o-love o-love changed the title [GH-943] Simplify Episode store add_episode [GH-943] Simplify Episode store add_episodes Jan 27, 2026
Copy link
Contributor
Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR simplifies the add_episodes method in the Episode SQLAlchemy store by reducing database operations and removing unnecessary data transformations that were causing KeyError exceptions.

Changes:

  • Modified the insert statement to return complete Episode objects instead of just IDs
  • Eliminated the second database session and SELECT query that was previously used to retrieve full episode data
  • Removed the intermediate dictionary mapping step that was prone to KeyError issues

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@o-love o-love force-pushed the fix-key-error-episode-id branch from 46a249e to 12506a3 Compare January 27, 2026 22:56
@o-love o-love requested a review from malatewang January 27, 2026 23:09
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.

[Bug]: KeyError in SqlAlchemyEpisodeStore when retrieving persisted episode IDs

2 participants

0