Skip to content

Conversation

@ZLBillShaw
Copy link

Summary

Fixed ValueError when update_communities=True is passed to add_episode(). The bug was caused by incorrect unpacking of semaphore_gather results, which returns a list of tuples rather than a single tuple.

Type of Change

  • Bug fix
  • New feature
  • Performance improvement
  • Documentation/Tests

Objective

Fix the ValueError: not enough values to unpack (expected 2, got 1) error that occurs when calling add_episode() with update_communities=True.

Root Cause:
In graphiti.py lines 781-787, the code attempts to directly unpack semaphore_gather results:

communities, community_edges = await semaphore_gather(
    *[update_community(self.driver, self.llm_client, self.embedder, node) for node in nodes],
    max_coroutines=self.max_coroutines,
)

However, semaphore_gather returns a list of tuples, not a single tuple:
[(communities, edges), (communities, edges), ...]

- Fixed ValueError when update_communities=True
- semaphore_gather returns a list of tuples, not a single tuple
- Added proper unpacking and flattening logic
- Bug was introduced in commit dcc9da3

Resolves issue where update_communities parameter would fail with:
'ValueError: not enough values to unpack (expected 2, got 1)'
@danielchalef
Copy link
Member

danielchalef commented Nov 27, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@ZLBillShaw
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

danielchalef added a commit that referenced this pull request Nov 27, 2025
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.

2 participants