Package com.tnsai.memory.advanced
Class SessionSerializer
java.lang.Object
com.tnsai.memory.advanced.SessionSerializer
Serializes
TieredMemoryStore state to JSON for session persistence.
Writes a JSON file named {agentId}-memory.json containing
all memory entries with their tier, strength, provenance, and versioning
metadata.
-
Constructor Summary
ConstructorsConstructorDescriptionSessionSerializer(Path directory) Creates a serializer that writes to the given directory. -
Method Summary
-
Constructor Details
-
SessionSerializer
Creates a serializer that writes to the given directory.- Parameters:
directory- the directory for session files- Throws:
IOException- if the directory cannot be created
-
-
Method Details
-
save
Serializes the store's state to a JSON file.- Parameters:
agentId- the agent ID (used for the filename)store- the tiered memory store to serialize- Throws:
IOException- if the file cannot be written
-
fileFor
Returns the file path for the given agent's session file.
-