Add Graphiti memory handling brief with implementation review#22
Open
pformoso-deus-ai wants to merge 4 commits intomainfrom
Open
Add Graphiti memory handling brief with implementation review#22pformoso-deus-ai wants to merge 4 commits intomainfrom
pformoso-deus-ai wants to merge 4 commits intomainfrom
Conversation
Comprehensive analysis of how Graphiti is used for episodic memory in SynapseFlow, covering the dual-graph architecture (FalkorDB for episodes, Neo4j for DIKW), the crystallization pipeline, conformance against Graphiti best practices, and a memory management sanity checklist. Identifies 9 implementation gaps with severity ratings and 7 actionable recommendations. https://claude.ai/code/session_01LKq1ffTu7S7xJcpn7HbuuN
Covers the 5 failing items from the Graphiti Memory Brief checklist: - SPEC-1: Community/summary layer (Tier 3 subgraph) - SPEC-2: Temporal conflict resolution (bi-temporal propagation) - SPEC-3: Bound search results (explicit num_results everywhere) - SPEC-4: Memory invalidation/expiration (TTL sweep + API) - SPEC-5: LLM rate limit management (SEMAPHORE_LIMIT + retry) https://claude.ai/code/session_01LKq1ffTu7S7xJcpn7HbuuN
SPEC-1: Community/summary layer - Add CommunitySummary dataclass and get_community_summaries() to EpisodicMemoryService - Extend get_conversation_context() with community_summaries field - Gracefully degrade when community nodes unavailable SPEC-2: Temporal conflict resolution - Add valid_from, valid_until, is_current fields to PERCEPTION entities - Add _resolve_temporal_conflicts() to CrystallizationService - Propagate bi-temporal metadata from Graphiti edges during crystallization - Update EntityResolver.merge_for_crystallization() for temporal fields SPEC-3: Bound search results - Pass num_results to all search() calls in episodic/crystallization services - Parameterize LIMIT in EntityResolver._get_existing_entities() - Replace hardcoded "medical entity" query with timestamp-based query SPEC-4: Memory invalidation/expiration - New MemoryInvalidationService with invalidate_entity(), invalidate_by_query(), sweep_stale_entities() - TTL-based staleness sweep targets PERCEPTION layer only - Wire into CrystallizationService periodic task and composition_root bootstrap - New env vars: MEMORY_STALE_THRESHOLD_DAYS, ENABLE_STALE_SWEEP SPEC-5: LLM rate limit management - Set SEMAPHORE_LIMIT at bootstrap (default 5) - Add _add_episode_with_retry() with exponential backoff on 429 errors - Add get_health() for rate limit monitoring - New env vars: GRAPHITI_SEMAPHORE_LIMIT, GRAPHITI_LLM_RETRY_ENABLED, GRAPHITI_LLM_MAX_RETRIES 78 tests passing (31 existing + 47 new) https://claude.ai/code/session_01LKq1ffTu7S7xJcpn7HbuuN
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.
Comprehensive analysis of how Graphiti is used for episodic memory in
SynapseFlow, covering the dual-graph architecture (FalkorDB for episodes,
Neo4j for DIKW), the crystallization pipeline, conformance against Graphiti
best practices, and a memory management sanity checklist. Identifies 9
implementation gaps with severity ratings and 7 actionable recommendations.
https://claude.ai/code/session_01LKq1ffTu7S7xJcpn7HbuuN