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

# Update a memory

> Update a memory's content, classification, or metadata.



## OpenAPI

````yaml /openapi/em-runtime-utils-v2.yaml patch /utils/memories/{memory_id}
openapi: 3.1.0
info:
  title: em_runtime_utils
  version: 5.27.0
servers: []
security: []
paths:
  /utils/memories/{memory_id}:
    patch:
      tags:
        - memories
      summary: Update a memory
      description: Update a memory's content, classification, or metadata.
      operationId: update_memory
      parameters:
        - name: memory_id
          in: path
          required: true
          schema:
            type: string
            description: Memory ID
            title: Memory Id
          description: Memory ID
        - name: X-Project-ID
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Project-Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MemoryUpdateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MemoryResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Name already exists
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    MemoryUpdateRequest:
      properties:
        name:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
              pattern: ^[a-zA-Z0-9][a-zA-Z0-9_.:-]*$
            - type: 'null'
          title: Name
          description: Updated name
        asset_fqn:
          anyOf:
            - type: string
              maxLength: 512
              minLength: 1
            - type: 'null'
          title: Asset Fqn
          description: Updated asset FQN
        content:
          anyOf:
            - $ref: '#/components/schemas/TextContent'
            - $ref: '#/components/schemas/StructuredContent'
            - $ref: '#/components/schemas/JsonContent'
            - $ref: '#/components/schemas/CodeContent'
            - $ref: '#/components/schemas/ExperienceContent'
            - type: 'null'
          title: Content
          description: Updated content
        content_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Url
          description: Updated content URL
        search_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Search Text
          description: Updated search text
        classification:
          anyOf:
            - $ref: '#/components/schemas/MemoryClassificationInfo'
            - type: 'null'
          description: Updated classification
        meta_data:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta Data
          description: Updated metadata
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
          description: Updated expiration time
      type: object
      title: MemoryUpdateRequest
      description: Request to update a memory.
    MemoryResponse:
      properties:
        id:
          type: string
          title: Id
          description: Memory ID
        name:
          type: string
          title: Name
          description: Memory name
        organization_id:
          type: string
          title: Organization Id
          description: Organization ID
        project_id:
          type: string
          title: Project Id
          description: Project ID
        context_pack_id:
          type: string
          title: Context Pack Id
          description: Parent context pack ID
        asset_fqn:
          anyOf:
            - type: string
            - type: 'null'
          title: Asset Fqn
          description: Dot-separated catalog asset FQN
        version:
          type: integer
          title: Version
          description: Version number
        content:
          additionalProperties: true
          type: object
          title: Content
          description: Memory content
        content_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Url
          description: External content URL
        search_text:
          anyOf:
            - type: string
            - type: 'null'
          title: Search Text
          description: Search text
        memory_type:
          $ref: '#/components/schemas/MemoryType'
          description: Memory type
        source:
          $ref: '#/components/schemas/MemorySourceInfo'
          description: Source information
        classification:
          $ref: '#/components/schemas/MemoryClassificationInfo'
          description: Classification
        meta_data:
          additionalProperties: true
          type: object
          title: Meta Data
          description: User-defined metadata
        quality:
          $ref: '#/components/schemas/MemoryQualityInfo'
          description: Quality information
        access:
          $ref: '#/components/schemas/MemoryAccessInfo'
          description: Access tracking (PLACEHOLDER)
        status:
          $ref: '#/components/schemas/MemoryStatus'
          description: Current status
        superseded_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Superseded By
          description: ID of superseding memory
        pinned:
          type: boolean
          title: Pinned
          description: Whether pinned
        pinned_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Pinned At
          description: Pin timestamp
        unpinned_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Unpinned At
          description: Unpin timestamp
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Creation timestamp
        updated_at:
          type: string
          format: date-time
          title: Updated At
          description: Last update timestamp
        archived_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Archived At
          description: Archive timestamp
        deleted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Deleted At
          description: Deletion timestamp
        superseded_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Superseded At
          description: Supersede timestamp
        reactivated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Reactivated At
          description: Reactivation timestamp
        expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Expires At
          description: Expiration timestamp
      type: object
      required:
        - id
        - name
        - organization_id
        - project_id
        - context_pack_id
        - version
        - content
        - memory_type
        - source
        - classification
        - meta_data
        - quality
        - access
        - status
        - pinned
        - created_at
        - updated_at
      title: MemoryResponse
      description: Full response model for a memory.
    ErrorResponse:
      properties:
        error:
          $ref: '#/components/schemas/ErrorBody'
      type: object
      required:
        - error
      title: ErrorResponse
      description: Standard error response model.
    TextContent:
      properties:
        type:
          type: string
          const: text
          title: Type
          default: text
        text:
          type: string
          title: Text
          description: Text content
      type: object
      required:
        - text
      title: TextContent
      description: Plain text memory content.
    StructuredContent:
      properties:
        type:
          type: string
          const: structured
          title: Type
          default: structured
        key:
          type: string
          title: Key
          description: Key
        value:
          type: string
          title: Value
          description: Value
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description
      type: object
      required:
        - key
        - value
      title: StructuredContent
      description: Key-value structured content.
    JsonContent:
      properties:
        type:
          type: string
          const: json
          title: Type
          default: json
        data:
          additionalProperties: true
          type: object
          title: Data
          description: JSON data
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description
      type: object
      required:
        - data
      title: JsonContent
      description: JSON data content.
    CodeContent:
      properties:
        type:
          type: string
          const: code
          title: Type
          default: code
        language:
          type: string
          title: Language
          description: Programming language
        code:
          type: string
          title: Code
          description: Code content
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
          description: Optional description
      type: object
      required:
        - language
        - code
      title: CodeContent
      description: Code snippet content.
    ExperienceContent:
      properties:
        type:
          type: string
          const: experience
          title: Type
          default: experience
        text:
          type: string
          title: Text
          description: Experience description
        outcome:
          anyOf:
            - type: string
            - type: 'null'
          title: Outcome
          description: Outcome
        context:
          anyOf:
            - type: string
            - type: 'null'
          title: Context
          description: Context
      type: object
      required:
        - text
      title: ExperienceContent
      description: Experience/outcome content.
    MemoryClassificationInfo:
      properties:
        domain:
          anyOf:
            - type: string
            - type: 'null'
          title: Domain
          description: Domain/category
        priority:
          $ref: '#/components/schemas/Priority'
          description: Priority level
          default: normal
        tags:
          items:
            type: string
          type: array
          title: Tags
          description: Tags for categorization
        sensitivity:
          anyOf:
            - type: string
            - type: 'null'
          title: Sensitivity
          description: Sensitivity level
      type: object
      title: MemoryClassificationInfo
      description: Classification information for a memory.
    MemoryType:
      type: string
      enum:
        - fact
        - experience
        - observation
        - instruction
        - preference
        - summary
        - glossary
        - ontology
        - textual_pattern
        - kpi
        - exemplar
        - join
        - numeric_pattern
        - policy
      title: MemoryType
      description: Type of memory.
    MemorySourceInfo:
      properties:
        type:
          type: string
          title: Type
          description: 'Source type: conversation, user, extraction, manual, derived'
        conversation_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Conversation Id
          description: Conversation ID if from conversation
        turn_index:
          anyOf:
            - type: integer
            - type: 'null'
          title: Turn Index
          description: Turn index in conversation
        actor:
          anyOf:
            - type: string
            - type: 'null'
          title: Actor
          description: Actor who created the memory
        confidence:
          type: number
          maximum: 1
          minimum: 0
          title: Confidence
          description: Source confidence (0.0-1.0)
          default: 0.5
        document_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Document Url
          description: Source document URL
      type: object
      required:
        - type
      title: MemorySourceInfo
      description: Source information for a memory.
    MemoryQualityInfo:
      properties:
        validation_status:
          $ref: '#/components/schemas/MemoryValidationStatus'
          description: Validation status
          default: unvalidated
        confidence_score:
          anyOf:
            - type: number
              maximum: 1
              minimum: 0
            - type: 'null'
          title: Confidence Score
          description: Confidence score from validation
        validated_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Validated By
          description: User who validated
        validated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Validated At
          description: Validation timestamp
      type: object
      title: MemoryQualityInfo
      description: Quality information for a memory.
    MemoryAccessInfo:
      properties:
        count:
          type: integer
          title: Count
          description: 'PLACEHOLDER: Access count'
          default: 0
        last_accessed:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Last Accessed
          description: 'PLACEHOLDER: Last access time'
        success_count:
          type: integer
          title: Success Count
          description: 'PLACEHOLDER: Success count'
          default: 0
        failure_count:
          type: integer
          title: Failure Count
          description: 'PLACEHOLDER: Failure count'
          default: 0
        success_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Success Rate
          description: 'PLACEHOLDER: Success rate'
      type: object
      title: MemoryAccessInfo
      description: |-
        Access tracking information for a memory.

        NOTE: These fields are PLACEHOLDERS and are not currently updated.
        They are reserved for future memory usage analytics implementation.
    MemoryStatus:
      type: string
      enum:
        - active
        - superseded
        - archived
        - deleted
      title: MemoryStatus
      description: Status of a memory.
    ErrorBody:
      properties:
        code:
          $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          title: Message
        details:
          additionalProperties: true
          type: object
          title: Details
        request_id:
          type: string
          title: Request Id
        timestamp:
          type: string
          format: date-time
          title: Timestamp
      type: object
      required:
        - code
        - message
        - request_id
        - timestamp
      title: ErrorBody
      description: Error body with structured details.
    Priority:
      type: string
      enum:
        - low
        - normal
        - high
        - critical
      title: Priority
      description: Priority level for memory classification.
    MemoryValidationStatus:
      type: string
      enum:
        - unvalidated
        - validated
        - disputed
      title: MemoryValidationStatus
      description: Validation status of a memory.
    ErrorCode:
      type: string
      enum:
        - INVALID_REQUEST
        - INVALID_TOKEN
        - INSUFFICIENT_PERMISSIONS
        - RESOURCE_NOT_FOUND
        - RESOURCE_ALREADY_EXISTS
        - VALIDATION_ERROR
        - RATE_LIMIT_EXCEEDED
        - SERVICE_UNAVAILABLE
        - INTERNAL_ERROR
      title: ErrorCode
      description: Standard error codes for API responses.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````