v0.3.0
Added
-
Graph Database:
get_all_user_memoriesis now sorted by most recent first and supports pagination withskip (default: 0)and/orlimit (default: 1000)parameters.
... await memora.graph.get_all_user_memories(ORG_ID, USER_ID, skip=0, limit=30) # get the 30 most recent memories.
Changed
-
⚠️ Breaking Changes:-
Graph Database:
-
Migration Required: Users must call
graph.migrate_to_schema_for_memora_v0_3_x()to migrate their graph schema to the version that works with Memora v0.3.x. Migration will do the following:- Drop
:Interaction (updated_at) -> interaction_updated_timestamp_indexindex because Neo4j does not utilize it for index-backed sorting when retrieving interactions. - Link every
Memorynodes to their respectiveDatenodes via:DATE_OBTAINEDrelationship.
await graph.migrate_to_schema_for_memora_v0_3_x() # Migrate the graph schema to the version that works with Memora v0.3.x
- Drop
-
-
Improvements
- Optimized Graph Retrieval:
-
Introduced an efficient method to traverse from
Datenodes toInteractionnodes duringget_all_user_interactions, enabling sorted retrieval without sorting all user interactions in the graph unless needed. -
Similarly,
get_all_user_memoriesnow uses the newDATE_OBTAINEDlink created during migration to traverse fromDatenodes toMemorynodes, enabling sorted retrieval without sorting all user memories in the graph unless needed.
-