Skip to content

feat: Graphiti/Mem0 export dialects + per-memory forgetting-rate (v0.12.0)#6

Merged
wesleyscholl merged 1 commit into
mainfrom
claude/konjo-kohaku-Um32j
May 25, 2026
Merged

feat: Graphiti/Mem0 export dialects + per-memory forgetting-rate (v0.12.0)#6
wesleyscholl merged 1 commit into
mainfrom
claude/konjo-kohaku-Um32j

Conversation

@konjoinfinity
Copy link
Copy Markdown
Contributor

Summary

  • Graphiti/Mem0 export dialects β€” MemoryGraph.to_graphiti() / to_mem0() methods emit graph data in the shapes Graphiti and Mem0 expect, so external graph tools can ingest kohaku memories without translation. Two new API endpoints: GET /export/graph/graphiti and GET /export/graph/mem0.
  • Per-memory forgetting-rate override β€” MemoryMetadata.forgetting_rate: Optional[float] lets callers tune decay per-memory at store time. salience() uses effective_half_life = half_life_days / forgetting_rate; rates > 1 accelerate forgetting, < 1 slow it. Exposed via POST /memories/store.
  • Pre-sprint cleanup β€” 6 ruff lint violations fixed; stale PLAN.md version header corrected.

Test plan

  • python -m pytest python/tests/ api/ -q β†’ 445 passed, 0 failed
  • ruff check . β†’ clean
  • cargo test β†’ 9 Rust unit tests green
  • cargo clippy -- -D warnings β†’ clean
  • Spot-check GET /export/graph/graphiti returns format: "graphiti" with episodes and relations keys
  • Spot-check GET /export/graph/mem0 returns format: "mem0" with memories array and 16-char hash per entry
  • POST /memories/store with forgetting_rate: 0.5 accepted; forgetting_rate: 0.0 returns 422

https://claude.ai/code/session_01JDunGDgWBNwSHjHYvLppF6


Generated by Claude Code

…ting-rate (v0.12.0)

Phase 15 β€” two orthogonal features with pre-sprint lint cleanup.

**Graphiti/Mem0 export dialects** (P2 completion):
- `MemoryGraph.to_graphiti()` / `to_graphiti_json()` β€” nodes β†’ episodes,
  edges β†’ relations (similar_to, weight=cosine). Graphiti-compatible shape.
- `MemoryGraph.to_mem0()` / `to_mem0_json()` β€” nodes β†’ memory records
  with 16-char SHA-256 hash, score (decay_weight or 1.0). Mem0-compatible shape.
- `MemoryGraphExporter.save_graphiti()` / `save_mem0()` β€” atomic file writes.
- `GET /export/graph/graphiti` and `GET /export/graph/mem0` on the unified API.

**Per-memory forgetting-rate override** (P3):
- `MemoryMetadata.forgetting_rate: Optional[float]` β€” validated > 0.
- `salience()` uses `effective_half_life = half_life_days / forgetting_rate`
  when set; rates > 1 accelerate decay, < 1 slow it. Default path unchanged.
- `EnrichedMemoryStore.store(..., forgetting_rate=...)` + API `POST /memories/store`.

**Pre-sprint cleanup**: 6 ruff lint violations fixed; PLAN.md version
header corrected from stale v0.10.0 β†’ v0.11.0.

445 tests passing (35 new: 16 test_graphiti_mem0 + 10 test_forgetting_rate + 9 API).

https://claude.ai/code/session_01JDunGDgWBNwSHjHYvLppF6
@wesleyscholl wesleyscholl marked this pull request as ready for review May 25, 2026 02:59
@wesleyscholl wesleyscholl merged commit 65ff3d7 into main May 25, 2026
6 checks passed
@wesleyscholl wesleyscholl deleted the claude/konjo-kohaku-Um32j branch May 25, 2026 03:00
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.

3 participants