Class BetaManagedAgentsMemoryVersion

  • All Implemented Interfaces:

    
    public final class BetaManagedAgentsMemoryVersion
    
                        

    One entry in a memory's history, recording a single change and who made it.

    Every change to a memory adds one version. Only redaction can change a version after that. Versions belong to the memory store and stay after the memory is deleted. Each version is retained for at least the version retention period after it was written, unless the store itself is deleted.

    Retrieving a redacted version succeeds, with content, path, content_size_bytes, and content_sha256 set to null. Check redacted_at to find out whether a version was redacted.

    See the memory guide to learn more about memory versions.

    • Constructor Detail

    • Method Detail

      • id

         final String id()

        Unique identifier for this version (a memver_... value).

      • memoryId

         final String memoryId()

        The ID of the memory that this version belongs to (mem_...).

        The ID stays valid after the memory is deleted. Pass it as memory_id to List Memory Versions to get the memory's retained versions, including its deleted version while the lineage is retained.

      • memoryStoreId

         final String memoryStoreId()

        ID of the memory store this version belongs to (a memstore_... value).

      • content

         final Optional<String> content()

        The memory's UTF-8 text content as of this version. null when view=basic, when operation is deleted, or when redacted_at is set.

      • contentSha256

         final Optional<String> contentSha256()

        Lowercase hex SHA-256 digest of content as of this version (64 characters). null when redacted_at is set or operation is deleted. Populated regardless of view otherwise.

      • contentSizeBytes

         final Optional<Integer> contentSizeBytes()

        Size of content in bytes as of this version. null when redacted_at is set or operation is deleted. Populated regardless of view otherwise.

      • createdBy

         final Optional<BetaManagedAgentsActor> createdBy()

        Who made this change to the memory, or null if the author wasn't recorded.

        Redacting the version doesn't change this field. A session_actor here is an agent that wrote through the store's mounted filesystem at /mnt/memory/. The version doesn't record the API key that created that session. So the author in created_by is who made the change, not who is ultimately responsible for it.

        You can retrieve the session to learn more about where the change came from.

      • path

         final Optional<String> path()

        The memory's path at the time of this write. null if and only if redacted_at is set.

      • redactedAt

         final Optional<OffsetDateTime> redactedAt()

        When the version was redacted, in RFC 3339, or null if it hasn't been.

        When set, content, path, content_size_bytes, and content_sha256 are null.

        See the memory guide to learn more about redaction.

      • redactedBy

         final Optional<BetaManagedAgentsActor> redactedBy()

        Who redacted this version, or null if it has not been redacted. In practice always an api_actor, user_actor, or service_account_actor (agents do not have a redact capability).

      • _type

         final JsonValue _type()

        Expected to always return the following:

        JsonValue.from("memory_version")

        However, this method can be useful for debugging and logging (e.g. if the server responded with an unexpected value).

      • _id

         final JsonField<String> _id()

        Returns the raw JSON value of id.

        Unlike id, this method doesn't throw if the JSON field has an unexpected type.

      • _createdAt

         final JsonField<OffsetDateTime> _createdAt()

        Returns the raw JSON value of createdAt.

        Unlike createdAt, this method doesn't throw if the JSON field has an unexpected type.

      • _memoryId

         final JsonField<String> _memoryId()

        Returns the raw JSON value of memoryId.

        Unlike memoryId, this method doesn't throw if the JSON field has an unexpected type.

      • _memoryStoreId

         final JsonField<String> _memoryStoreId()

        Returns the raw JSON value of memoryStoreId.

        Unlike memoryStoreId, this method doesn't throw if the JSON field has an unexpected type.

      • _content

         final JsonField<String> _content()

        Returns the raw JSON value of content.

        Unlike content, this method doesn't throw if the JSON field has an unexpected type.

      • _contentSha256

         final JsonField<String> _contentSha256()

        Returns the raw JSON value of contentSha256.

        Unlike contentSha256, this method doesn't throw if the JSON field has an unexpected type.

      • _contentSizeBytes

         final JsonField<Integer> _contentSizeBytes()

        Returns the raw JSON value of contentSizeBytes.

        Unlike contentSizeBytes, this method doesn't throw if the JSON field has an unexpected type.

      • _path

         final JsonField<String> _path()

        Returns the raw JSON value of path.

        Unlike path, this method doesn't throw if the JSON field has an unexpected type.

      • _redactedAt

         final JsonField<OffsetDateTime> _redactedAt()

        Returns the raw JSON value of redactedAt.

        Unlike redactedAt, this method doesn't throw if the JSON field has an unexpected type.

      • validate

         final BetaManagedAgentsMemoryVersion validate()

        Validates that the types of all values in this object match their expected types recursively.

        This method is not forwards compatible with new types from the API for existing fields.