Skip to content

v0.8.0 — Graph API 확장 (list/update/maintain/add_turn + 커스텀 NodeKind)

Choose a tag to compare

@SonAIengine SonAIengine released this 22 Mar 15:48
· 109 commits to main since this release

Summary

Graph API expansion release addressing 5 user feedback items: full node listing, partial updates, unified maintenance, conversation session management, and custom NodeKind support.

New Features

graph.list() — List all nodes

nodes = await graph.list()                          # all
lessons = await graph.list(kind=NodeKind.LESSON)     # filter by kind
recent = await graph.list(limit=10)                  # with limit

graph.update() — Partial node update

await graph.update(node_id, title="New Title", tags=["updated"])
  • No need to call backend.update_node() directly
  • Cache auto-invalidation

graph.maintain() — Unified consolidate + decay + prune

result = await graph.maintain()
print(result.total_affected)  # consolidated + decayed + pruned combined
  • MaintenanceResult dataclass for consistent return type
  • Existing consolidate(), decay(), prune() still available individually

graph.add_turn() — Conversation session/turn helper

session, user_node, asst_node = await graph.add_turn(
    "Hello",
    "Hi! How can I help you?",
    session_id="my_session",
)
  • Auto-creates/reuses SESSION nodes
  • user → assistant FOLLOWED_BY linking
  • Auto-chaining between turns

Custom NodeKind

await graph.add("Korean Culture", "Greeting etiquette", kind="culture")
await graph.add("Dark Mode", "Preferred", kind="preference")
await graph.list(kind="culture")  # filter by custom kind
  • Node.kind type widened to str (fully backward-compatible with NodeKind enum)
  • Safe DB serialization/deserialization across all backends (_safe_node_kind())

Breaking Changes

None. All existing APIs remain backward-compatible.

Install

pip install synaptic-memory==0.8.0

Full Changelog: v0.7.0...v0.8.0