Skip to content

Comments

Add Graphiti memory handling brief with implementation review#22

Open
pformoso-deus-ai wants to merge 4 commits intomainfrom
claude/review-graphiti-memory-7l6mH
Open

Add Graphiti memory handling brief with implementation review#22
pformoso-deus-ai wants to merge 4 commits intomainfrom
claude/review-graphiti-memory-7l6mH

Conversation

@pformoso-deus-ai
Copy link
Collaborator

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

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
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