> ## Documentation Index
> Fetch the complete documentation index at: https://docs.evermind.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit one memory record [Cloud-only]

> Rewrite the editable fields of one memory. Only "episode" can be edited today.

- `patch` uses the episode's own field names — `episode`, `summary`, `subject` — and needs at least one of them. Fields left out keep their current value.
- A patch that changes only `episode` makes the server regenerate `summary` from the new text; `subject` is never regenerated.
- No `app_id` / `project_id`: the record already knows its scope.

There is no version check — the last write wins. Re-sending content equal to what is stored answers 200 with `unchanged: true` and writes nothing. Changing the narrative re-indexes the memory and re-extracts its facts in the background; the response is the edited record itself, with `edited_at` and `reflect_state` set.

A record that does not exist, is already deleted, or belongs to another tenant is rejected with 404.

Profile items are edited through /api/v2/memory/edit, not here.



## OpenAPI

````yaml /api-reference/openapi.json post /api/v2/memory/update
openapi: 3.1.0
info:
  title: EverOS Cloud Memory API
  version: 2.0.0
  license:
    name: Apache-2.0
    identifier: Apache-2.0
  contact:
    name: EverMind AI
    email: service@evermind.ai
    url: https://github.com/EverMind-AI/everos-cloud-sdk-python
  description: >-
    Official Python client for the EverOS Cloud Memory API. Add, search,
    retrieve, and manage long-term memory for your AI applications over a typed
    interface (pydantic v2, with full type hints). Install and usage guides:
    https://github.com/EverMind-AI/everos-cloud-sdk-python
servers:
  - url: https://api.evermind.ai
    description: Production
security:
  - BearerAuth: []
paths:
  /api/v2/memory/update:
    post:
      tags:
        - Memory
      summary: Edit one memory record [Cloud-only]
      description: >-
        Rewrite the editable fields of one memory. Only "episode" can be edited
        today.


        - `patch` uses the episode's own field names — `episode`, `summary`,
        `subject` — and needs at least one of them. Fields left out keep their
        current value.

        - A patch that changes only `episode` makes the server regenerate
        `summary` from the new text; `subject` is never regenerated.

        - No `app_id` / `project_id`: the record already knows its scope.


        There is no version check — the last write wins. Re-sending content
        equal to what is stored answers 200 with `unchanged: true` and writes
        nothing. Changing the narrative re-indexes the memory and re-extracts
        its facts in the background; the response is the edited record itself,
        with `edited_at` and `reflect_state` set.


        A record that does not exist, is already deleted, or belongs to another
        tenant is rejected with 404.


        Profile items are edited through /api/v2/memory/edit, not here.
      operationId: updateMemory
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateInput'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SuccessEnvelope_UpdateData_'
        '401':
          description: Missing or invalid bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
        '403':
          description: >-
            Authenticated but not permitted — either rejected by the auth
            service, or the account's memory API version does not match the
            interface version implied by the path (a v1 account calling an
            /api/v2 route).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '429':
          description: Rate limit or quota exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
        '503':
          description: >-
            The gateway could not reach the authentication service. Transient —
            retry with backoff.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GatewayError'
components:
  schemas:
    UpdateInput:
      properties:
        memory_type:
          type: string
          minLength: 1
          title: Memory Type
          description: Kind of the memory being edited. Only "episode" is accepted today.
        memory_id:
          type: string
          minLength: 1
          title: Memory Id
          description: The memory's `id` as returned by /api/v2/memory/get or /search.
        patch:
          $ref: '#/components/schemas/EpisodePatch'
          description: >-
            The fields to rewrite — at least one. Fields left out keep their
            current value.
        reason:
          anyOf:
            - $ref: '#/components/schemas/Reason'
            - type: 'null'
          description: >-
            Why the change is made. Optional; recorded for quality analysis and
            never changes what is written.
      additionalProperties: false
      type: object
      required:
        - memory_type
        - memory_id
        - patch
      title: UpdateInput
      description: >-
        Edit ONE memory record's editable fields [Cloud-only].


        No ``expected_*`` / version: the API does no conflict detection (last
        write wins).

        Resend idempotency comes from the no-change short circuit, and
        Reflection guards

        itself with a content CAS.
      example:
        memory_type: episode
        memory_id: 665f0c8e1a2b3c4d5e6f7a8b
        patch:
          episode: The user moved to Hangzhou last month and now lives near West Lake.
          summary: Moved to Hangzhou; lives near West Lake.
          subject: Relocation to Hangzhou
        reason:
          code: wrong_subject
          note: The narrative attributed the move to the wrong person
    SuccessEnvelope_UpdateData_:
      properties:
        request_id:
          type: string
          title: Request Id
          description: Request trace id (peer to data)
        data:
          $ref: '#/components/schemas/UpdateData'
          description: Endpoint-defined business result
      type: object
      required:
        - request_id
        - data
      title: SuccessEnvelope[UpdateData]
    GatewayError:
      type: object
      additionalProperties: true
      description: >-
        Gateway error body. NOTE: shape is not yet uniform across auth/quota/
        rate-limit paths — treat fields as best-effort. Commonly includes a
        `code`/`message` (flat) or an `error` object/string with a `message`.
      title: GatewayError
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
          description: One entry per field that failed validation.
      type: object
      title: HTTPValidationError
    EpisodePatch:
      properties:
        episode:
          anyOf:
            - type: string
              maxLength: 8000
              minLength: 1
            - type: 'null'
          title: Episode
          description: >-
            New narrative body, 1–8000 characters. Changing it re-indexes the
            memory and regenerates `summary` unless one is supplied in the same
            patch.
        summary:
          anyOf:
            - type: string
              maxLength: 1000
              minLength: 1
            - type: 'null'
          title: Summary
          description: New short summary, 1–1000 characters.
        subject:
          anyOf:
            - type: string
              maxLength: 200
              minLength: 1
            - type: 'null'
          title: Subject
          description: New title, 1–200 characters.
      additionalProperties: false
      type: object
      title: EpisodePatch
      description: >-
        The editable surface of an episode.


        NATIVE field names, not generic ones: a generic mapping is a stretch for
        other

        types (agent_case has three parallel content fields), and it would make
        the audit

        event's before/after unreadable. Generality lives in the envelope + the

        ``EDITABLE_FIELDS`` registry.


        Partial, and ``None`` means "leave it alone" rather than "clear it". A
        body-only

        patch is accepted: the server regenerates ``summary`` from the new text
        (the same

        way a freshly extracted episode gets one) so the preview never describes
        text that

        no longer exists; ``subject`` has no generator and is kept unless
        supplied.
    Reason:
      properties:
        code:
          type: string
          enum:
            - hallucination
            - wrong_subject
            - wrong_time
            - redundant
            - missing
            - privacy
            - style
            - other
          title: Code
          description: >-
            What was wrong, from the fixed list — hallucination, wrong_subject,
            wrong_time, redundant, missing, privacy, style, other. Required
            whenever a reason is given. Same base list as `FeedbackInput.reason`
            plus `missing`, which only an edit can express (an operator fixes a
            record that left something out; a rating always names a memory that
            exists). On the contract this SDK is generated from (engine
            release-20260901_v15) `outdated` is not yet accepted here — the
            engine adds it in its next release; until then record an
            outdated-type fix as `wrong_time` or `other`.
        note:
          anyOf:
            - type: string
              maxLength: 256
            - type: 'null'
          title: Note
          description: Optional free text, up to 256 characters.
      additionalProperties: false
      type: object
      required:
        - code
      title: Reason
      description: >-
        Why the operator made the change. OPTIONAL on both ops: it is recorded
        on the

        audit event for quality analysis, never used to gate anything. When
        given, ``code``

        is required and ``note`` is free text.
    UpdateData:
      properties:
        id:
          type: string
          title: Id
          description: Episode id. Use it to bind tags or to fetch this episode again.
        app_id:
          type: string
          title: App Id
          description: The business-semantic scope this memory was written under.
        project_id:
          type: string
          title: Project Id
          description: Second half of that scope.
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
          description: >-
            The user this episode belongs to. Null on an episode merged from
            several owners.
        session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Id
          description: >-
            The session it was extracted from. Null when the episode merges more
            than one session.
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: >-
            When the remembered exchange happened (ISO 8601), not when it was
            extracted.
        sender_ids:
          items:
            type: string
          type: array
          title: Sender Ids
          description: The senders that appear in the source exchange.
        summary:
          type: string
          title: Summary
          description: Short summary of the episode — what a result list should show.
        subject:
          type: string
          title: Subject
          description: What the episode is about, in a few words.
        episode:
          type: string
          title: Episode
          description: >-
            The episode's stored narrative body. This is the indexed, searchable
            text.
        readable_episode:
          anyOf:
            - type: string
            - type: 'null'
          title: Readable Episode
          description: >-
            Human-readable rendering of `episode`, for display only — never
            indexed, filtered or scored. Present as a key but null unless the
            request asked for it (and the tenant is enabled for it); fall back
            to `episode` when it is null.
        type:
          type: string
          title: Type
          description: >-
            How the episode was produced — "Conversation" or
            "AgentConversation".
        atomic_facts:
          items:
            $ref: '#/components/schemas/AtomicFactItem'
          type: array
          title: Atomic Facts
          description: >-
            The individual facts extracted from this episode, nested rather than
            returned separately.
        tags:
          items:
            type: string
          type: array
          title: Tags
          description: Tags attached through /api/v2/memory/tag/*.
        edited_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Edited At
          description: >-
            When the memory was last edited by hand through
            /api/v2/memory/update. Absent on a memory that was never edited.
        reflect_state:
          anyOf:
            - type: string
              enum:
                - pending
                - done
            - type: 'null'
          title: Reflect State
          description: >-
            Set once the narrative has been edited by hand: "pending" until
            background consolidation has absorbed the new text (a search may
            briefly return both it and a merged narrative close to it), "done"
            afterwards. Absent on a memory whose narrative was never edited.
        unchanged:
          type: boolean
          title: Unchanged
          default: false
          description: >-
            True when the patch equalled what was already stored — nothing was
            written and nothing downstream was triggered.
      type: object
      required:
        - id
        - app_id
        - project_id
        - timestamp
        - summary
        - subject
        - episode
        - type
      title: UpdateData
      description: >-
        The edited record itself — the same shape ``SearchEpisodeItem`` uses for

        ``score``, not a wrapper around a nested ``item`` that would restate its
        ids.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
          description: Path to the offending field, from the body root.
        msg:
          type: string
          title: Message
          description: What is wrong with it.
        type:
          type: string
          title: Error Type
          description: Machine-readable validation-error kind.
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    AtomicFactItem:
      properties:
        id:
          type: string
          title: Id
          description: Atomic-fact id.
        content:
          type: string
          title: Content
          description: The fact itself, as a single statement.
      type: object
      required:
        - id
        - content
      title: AtomicFactItem
      description: |-
        Atomic fact nested in an episode. Spec appendix E references it but does
        not enumerate its fields — minimal shape until the contract is detailed.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 'API key issued by EverOS, sent as `Authorization: Bearer <api_key>`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.