Skip to content

Handoff call Serialization Improvement #27

Description

@sortedcord

There is no distinction between dialogues from cognition in buffer serialization and tier 2 memory serialization:

Input

ID: alpha-wake | Timestamp: 2026-07-09T07:58:00.000Z | Location: white-room
Content: I didn't have a choice. I would have been sent to jail if I hadn't agreed to do this experiement.
---
ID: ba1822f6-ef5b-4699-8742-4416628d4ce1 | Timestamp: 2026-07-09T08:00:00.000Z | Location: white-room
Content: You did not have a choice.
---
ID: dedf938d-e4ee-4228-b19c-43995812e553 | Timestamp: 2026-07-09T08:00:00.000Z | Location: white-room
Content: The thought grates at you again, an old wound reopened by the sterile white walls and the low hum of something.
---
ID: 619609eb-f8c6-442b-93f9-c0356a47c7be | Timestamp: 2026-07-09T08:01:00.000Z | Location: white-room
Content: You glance over at the blonde man, still sitting against the wall. (Outcome: Succeeded)
---
ID: 71d5cd27-d630-4b80-93b6-f8f52615f48e | Timestamp: 2026-07-09T08:02:00.000Z | Location: white-room
Content: Beta.

Output

{
  "chunks": [
    {
      "sourceEntryIds": [
        "alpha-wake",
        "ba1822f6-ef5b-4699-8742-4416628d4ce1",
        "dedf938d-e4ee-4228-b19c-43995812e553"
      ],
      "content": "I didn't have a choice. I would have been sent to jail if I hadn't agreed to do this experiment. The thought grates at me again, an old wound reopened by the sterile white walls and the low hum of something.",
      "quotes": [
        "I didn't have a choice. I would have been sent to jail if I hadn't agreed to do this experiement.",
        "You did not have a choice."
      ],
      "importance": 7,
      "involvedEntityIds": [
        "7c9b83b3-8cfb-4e89-8d77-626a5757d591"
      ],
      "retainInBuffer": false
    },
    {
      "sourceEntryIds": [
        "619609eb-f8c6-442b-93f9-c0356a47c7be",
        "71d5cd27-d630-4b80-93b6-f8f52615f48e",
        "8280f36d-8fdb-4008-9dcf-f6e5a234bec7",
        "9c9b96a8-558a-47b5-b4f7-17a857a8cce9",
        "ba6e7577-fd96-496f-89ea-5a756f088b21",
        "50b33a66-ff3c-475f-bc7a-677deb290703",
        "b63c9d4f-1141-45bc-8cc7-55b9dc59f827",
        "ec6ca0d5-143c-4a0a-ad8e-82c7decf5880"
      ],
      "content": "I glance over at the blonde man, still sitting against the wall. His name is Beta. I remember the name on his pocket. He has not moved. I wonder what he did to end up here, but I think that it does not matter. I realize that we are both stuck.",
      "quotes": [
        "Beta."
      ],
      "importance": 6,
      "involvedEntityIds": [
        "7c9b83b3-8cfb-4e89-8d77-626a5757d591",
        "unknown-entity-id"
      ],
      "retainInBuffer": false
    },
    {
      "sourceEntryIds": [
        "60f9d3aa-55b5-4c95-8daf-58d4f5b470be",
        "932077ab-00c8-42af-9a61-ff7af682052c"
      ],
      "content": "I decide I should try to figure out where I am. I think that this can't be all there is.",
      "quotes": [],
      "importance": 5,
      "involvedEntityIds": [
        "7c9b83b3-8cfb-4e89-8d77-626a5757d591"
      ],
      "retainInBuffer": false
    }
  ]
}

A bunch of things to improve here:

  1. Time naturalization. We can safely assume that the actual handoff call that is being run is mostly for salience determination and memory clustering and filtering. So, technically we don't have to put in a timestamp here. We can have some sort of deterministic mapping that maps out the time of the buffer entry to the generated (and even clustered) memory ledger.
  2. Intent type specification. We need to also categorize these events by their type. Is this a monologue, something the entity said to someone else, or vice versa.
  3. Mention other involved entities.
  4. Always resist keeping volatile thoughts from entering long term memory unless they are very important.
  5. Quotes do not mention who is speaking what. Just quotes. So change quotes from a simple array to a dictionary type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingmemory

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions