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.
- Memory
Decision - A single memory decision from the LLM’s response.
- Memory
Update Response - 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.