> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Learning

> Update a learning record. Only `content` and `metadata` may be modified; identity fields (user_id, agent_id, team_id, etc.) are immutable. Provided fields fully replace the existing values. Records with no owner (`user_id IS NULL` — shared agent/team/session/entity learnings) are readable by any caller but may only be modified by an admin.



## OpenAPI

````yaml patch /learnings/{learning_id}
openapi: 3.1.0
info:
  title: Agno API Reference
  description: The all-in-one, private, secure agent platform that runs in your cloud.
  version: 3.0.4
servers: []
security: []
paths:
  /learnings/{learning_id}:
    patch:
      tags:
        - Learnings
      summary: Update Learning
      description: >-
        Update a learning record. Only `content` and `metadata` may be modified;
        identity fields (user_id, agent_id, team_id, etc.) are immutable.
        Provided fields fully replace the existing values. Records with no owner
        (`user_id IS NULL` — shared agent/team/session/entity learnings) are
        readable by any caller but may only be modified by an admin.
      operationId: update_learning
      parameters:
        - name: learning_id
          in: path
          required: true
          schema:
            type: string
            description: The learning ID
            title: Learning Id
          description: The learning ID
        - name: db_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: Database ID to use
            title: Db Id
          description: Database ID to use
        - name: table
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: The database table to use (requires db_id)
            title: Table
          description: The database table to use (requires db_id)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LearningUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LearningResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthenticatedResponse'
        '403':
          description: 'Insufficient permissions. Required scope(s): learnings:write'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerErrorResponse'
      security:
        - {}
        - HTTPBearer: []
components:
  schemas:
    LearningUpdate:
      properties:
        content:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Content
          description: Replacement content payload
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
          description: Replacement metadata
      type: object
      title: LearningUpdate
      description: >-
        Request body for updating a learning record. Identity fields are
        immutable.
    LearningResponse:
      properties:
        learning_id:
          type: string
          title: Learning Id
          description: Unique identifier for the learning record
        learning_type:
          type: string
          title: Learning Type
          description: Type of learning (e.g. 'user_profile', 'entity_memory')
        namespace:
          anyOf:
            - type: string
            - type: 'null'
          title: Namespace
          description: Namespace for scoping ('user', 'global', or custom)
        user_id:
          anyOf:
            - type: string
            - type: 'null'
          title: User Id
          description: Associated user ID
        agent_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Agent Id
          description: Associated agent ID
        team_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Team Id
          description: Associated team ID
        session_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Session Id
          description: Associated session ID
        entity_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Entity Id
          description: Associated entity ID (for entity-specific learnings)
        entity_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Entity Type
          description: Entity type (e.g. 'person', 'company')
        content:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Content
          description: The learning content payload
        metadata:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Metadata
          description: Optional metadata
        created_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Created At
          description: Creation timestamp (Unix epoch seconds)
        updated_at:
          anyOf:
            - type: integer
            - type: 'null'
          title: Updated At
          description: Last update timestamp (Unix epoch seconds)
      type: object
      required:
        - learning_id
        - learning_type
      title: LearningResponse
      description: A single learning record as returned by the API.
    BadRequestResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable error message
        error_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Id
          description: >-
            Stable identifier for the specific error, present only when the
            error carries one
        error_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Type
          description: Category of the error, present only when the error carries one
      type: object
      required:
        - detail
      title: BadRequestResponse
      example:
        detail: Bad request
    UnauthenticatedResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable error message
        error_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Id
          description: >-
            Stable identifier for the specific error, present only when the
            error carries one
        error_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Type
          description: Category of the error, present only when the error carries one
      type: object
      required:
        - detail
      title: UnauthenticatedResponse
      example:
        detail: Unauthenticated access
    NotFoundResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable error message
        error_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Id
          description: >-
            Stable identifier for the specific error, present only when the
            error carries one
        error_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Type
          description: Category of the error, present only when the error carries one
      type: object
      required:
        - detail
      title: NotFoundResponse
      example:
        detail: Not found
    ValidationErrorResponse:
      properties:
        detail:
          anyOf:
            - type: string
            - items:
                $ref: '#/components/schemas/ValidationErrorDetail'
              type: array
          title: Detail
          description: >-
            A single message for an explicitly raised 422, or a list of
            field-level errors for a request-validation failure
      type: object
      required:
        - detail
      title: ValidationErrorResponse
      description: >-
        422 body. Two runtime shapes share this status code, and the same
        endpoint can

        return either, so ``detail`` is typed as their union:


        - FastAPI's request-validation handler emits a **list** of field-level
        errors (built-in
          coercion errors and custom-validator ``ValueError``s alike).
        - A route that raises ``HTTPException(status_code=422, detail="...")``
        for a semantic
          check (e.g. an invalid cron expression) emits a **string** through the HTTPException
          handler.
      example:
        detail:
          - loc:
              - body
              - endpoint
            msg: Value error, Endpoint must be a path, not a full URL
            type: value_error
    InternalServerErrorResponse:
      properties:
        detail:
          type: string
          title: Detail
          description: Human-readable error message
        error_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Id
          description: >-
            Stable identifier for the specific error, present only when the
            error carries one
        error_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Type
          description: Category of the error, present only when the error carries one
      type: object
      required:
        - detail
      title: InternalServerErrorResponse
      example:
        detail: Internal server error
    ValidationErrorDetail:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Loc
          description: Path to the offending field, e.g. ['body', 'endpoint']
        msg:
          type: string
          title: Msg
          description: Human-readable error message
        type:
          type: string
          title: Type
          description: Error type identifier, e.g. 'value_error' or 'missing'
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationErrorDetail
      description: >-
        One field-level error inside a 422 body, matching FastAPI's default
        shape.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````

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