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

# Patch Memory

> Adds all events from a given session to the memory service.

Args:
    app_name: The name of the application.
    user_id: The ID of the user.
    update_memory_request: The memory request for the update

Raises:
    HTTPException: If the memory service is not configured or the request
    is invalid.



## OpenAPI

````yaml /api-reference/openapi.json patch /apps/{app_name}/users/{user_id}/memory
openapi: 3.1.0
info:
  title: apowerb API
  description: REST API of the apowerb agentic framework (open-source edition).
  version: 0.1.2
  license:
    name: MIT
    url: https://github.com/apowerb/apowerb/blob/main/LICENSE
servers:
  - url: https://api.example.com
    description: Your apowerb instance
  - url: http://localhost:8000
    description: Local stack
security: []
paths:
  /apps/{app_name}/users/{user_id}/memory:
    patch:
      summary: Patch Memory
      description: |-
        Adds all events from a given session to the memory service.

        Args:
            app_name: The name of the application.
            user_id: The ID of the user.
            update_memory_request: The memory request for the update

        Raises:
            HTTPException: If the memory service is not configured or the request
            is invalid.
      operationId: patch_memory_apps__app_name__users__user_id__memory_patch
      parameters:
        - name: app_name
          in: path
          required: true
          schema:
            type: string
            title: App Name
        - name: user_id
          in: path
          required: true
          schema:
            type: string
            title: User Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateMemoryRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UpdateMemoryRequest:
      properties:
        sessionId:
          type: string
          title: Sessionid
      type: object
      required:
        - sessionId
      title: UpdateMemoryRequest
      description: Request to add a session to the memory service.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````

## Related topics

- [Tools](/concepts/tools.md)
- [Agents](/concepts/agents.md)
- [Resync Template](/api-reference/agents/resync-template.md)
- [Google Callback](/api-reference/integrations/google-callback.md)
- [Update Session](/api-reference/update-session.md)
