Skip to main content

Module dedup

Module dedup 

Source
Expand description

Memory deduplication utilities.

Structs§

IdMapping
Maps integer IDs (used by LLM) back to real UUIDs. The LLM receives integer IDs to avoid hallucinating UUIDs.
MemoryDecision
A single memory decision from the LLM’s response.
MemoryUpdateResponse
Parsed LLM memory-update response.

Functions§

build_existing_memory_dict
Build the “existing memory” dict that gets sent to the LLM for comparison. Maps each existing memory to an integer ID for stability.
deduplicate_memories
Deduplicate a list of existing memories retrieved for multiple facts. Returns a deduplicated list of (uuid, text) pairs.
parse_memory_update_response
Parse the LLM’s JSON response for memory update decisions.