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

# Add a session to memory

> Add the session identified by sessionId to the configured memory service; success returns JSON null

Configure a memory backend first and provide a valid `sessionId` under the same application and user. An unconfigured memory service returns `400`; a missing session returns `404`

<Warning>
  This operation sends session events to the configured memory service for storage or processing. Future retrieval can use that content. Confirm that the session data is appropriate for the selected backend before submitting it
</Warning>

A successful response is JSON `null`, indicating that the ingestion call completed. It does not return extracted memories or guarantee a match in subsequent retrieval


## OpenAPI

````yaml productions/api-reference/openapi/en/harness-runtime.json PATCH /apps/{app_name}/users/{user_id}/memory
openapi: 3.1.0
info:
  title: Harness Runtime
  version: agentkit-cli 0.54.0 / SDK 0.8.0 / ADK 2.2.0
  description: >-
    Harness Runtime deployed by AgentKit CLI 0.54.0, verified with VeADK 1.0.8,
    AgentKit SDK 0.8.0, and Google ADK 2.2.0; scheduled tasks require separate
    enablement
servers:
  - url: http://localhost:8000
    description: Local server
security:
  - {}
  - RuntimeBearer: []
tags:
  - name: Service and applications
  - name: Sessions
  - name: Agent execution
  - name: Artifacts
  - name: Memory
  - name: Evaluation · development server
  - name: Debugging · development server
  - name: Compatibility endpoints
  - name: Harness cronjobs
paths:
  /apps/{app_name}/users/{user_id}/memory:
    patch:
      tags:
        - Memory
      summary: Add a session to memory
      description: >-
        Add the session identified by sessionId to the configured memory
        service; success returns JSON null
      operationId: harnessRuntimeUpdateMemory
      parameters:
        - name: app_name
          in: path
          required: true
          schema:
            type: string
            title: App Name
          description: Application name; harness_agent for the CLI deployment
          example: harness_agent
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            title: User Id
          description: User ID
          example: user-001
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateMemoryRequest'
            example:
              sessionId: session-001
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: 'null'
              example: null
        '400':
          description: Invalid request or a required service/dependency is unavailable
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '404':
          description: Requested resource was not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
        '411':
          description: 'Shared OAuth only: a valid Content-Length is required'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: CONTENT_LENGTH_REQUIRED
        '413':
          description: 'Shared OAuth only: request body exceeds 128 KiB'
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
              example:
                error: REQUEST_TOO_LARGE
        '422':
          description: Request validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UpdateMemoryRequest:
      properties:
        sessionId:
          type: string
          title: Sessionid
          description: Session ID
      type: object
      required:
        - sessionId
      title: UpdateMemoryRequest
    ApiError:
      type: object
      properties:
        detail:
          type: string
          description: Error details
      required:
        - detail
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
          description: Error details
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
          description: Location of the invalid field
        msg:
          type: string
          title: Message
          description: Validation error message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    RuntimeBearer:
      type: http
      scheme: bearer
      description: >-
        Optional locally without a gateway; cloud deployments use the Runtime
        API key or user-pool JWT required by that deployment, never the model
        API key

````