> ## 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/agent-api-server.json PATCH /apps/{app_name}/users/{user_id}/memory
openapi: 3.1.0
info:
  title: Agent API Server
  version: google-adk 2.2.0
  description: >-
    Public HTTP endpoints for Google ADK 2.2.0; /dev routes require the
    development UI to be enabled
servers:
  - url: http://localhost:8000
    description: Local server
security: []
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
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: agentApiUpdateMemory
      parameters:
        - name: app_name
          in: path
          required: true
          schema:
            type: string
            title: App Name
          description: Application name
          example: travel_assistant
        - 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'
        '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
      required:
        - detail
      properties:
        detail:
          type: string
          description: Error details
    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

````