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

# List the caller's knowledge bases

> Return all knowledge bases owned by the authenticated user.

Args:
    user_id (`str`):
        Injected authenticated user ID.
    service (`KnowledgeBaseService`):
        Injected knowledge base service.

Returns:
    `ListKnowledgeBasesResponse`:
        The user's knowledge bases.



## OpenAPI

````yaml /versions/2.0.4dev/en/deploy/openapi.json get /knowledge_bases/
openapi: 3.1.0
info:
  title: AgentScope
  version: 2.0.3
servers: []
security: []
paths:
  /knowledge_bases/:
    get:
      tags:
        - knowledge_bases
      summary: List the caller's knowledge bases
      description: |-
        Return all knowledge bases owned by the authenticated user.

        Args:
            user_id (`str`):
                Injected authenticated user ID.
            service (`KnowledgeBaseService`):
                Injected knowledge base service.

        Returns:
            `ListKnowledgeBasesResponse`:
                The user's knowledge bases.
      operationId: list_knowledge_bases_knowledge_bases__get
      parameters:
        - name: x-user-id
          in: header
          required: true
          schema:
            type: string
            description: >-
              Caller's user ID. Temporary header-based identity; will be
              replaced by JWT auth.
            title: X-User-Id
          description: >-
            Caller's user ID. Temporary header-based identity; will be replaced
            by JWT auth.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ListKnowledgeBasesResponse'
        '404':
          description: Not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    ListKnowledgeBasesResponse:
      properties:
        knowledge_bases:
          items:
            $ref: '#/components/schemas/KnowledgeBaseView'
          type: array
          title: Knowledge Bases
          description: All knowledge bases owned by the caller.
        total:
          type: integer
          title: Total
          description: Total number of returned items.
      type: object
      required:
        - knowledge_bases
        - total
      title: ListKnowledgeBasesResponse
      description: Response body for listing the caller's knowledge bases.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    KnowledgeBaseView:
      properties:
        id:
          type: string
          title: Id
          description: The knowledge base identifier.
        name:
          type: string
          title: Name
          description: Display name of the knowledge base.
        description:
          type: string
          title: Description
          description: Free-form description.
        embedding_model_config:
          $ref: '#/components/schemas/EmbeddingModelConfig'
          description: Embedding model configuration pinned at creation.
        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.
      type: object
      required:
        - id
        - name
        - description
        - embedding_model_config
        - created_at
        - updated_at
      title: KnowledgeBaseView
      description: |-
        A knowledge base record as exposed to API clients.

        Mirrors :class:`KnowledgeBaseRecord` with the internal
        ``user_id`` / ``collection_name`` fields stripped — clients have
        no business introspecting either.
    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
    EmbeddingModelConfig:
      properties:
        type:
          type: string
          title: Type
        credential_id:
          type: string
          title: Credential Id
        model:
          type: string
          title: Model
        dimensions:
          type: integer
          exclusiveMinimum: 0
          title: Dimensions
        parameters:
          additionalProperties: true
          type: object
          title: Parameters
      type: object
      required:
        - type
        - credential_id
        - model
        - dimensions
      title: EmbeddingModelConfig
      description: |-
        Configuration for constructing an embedding model from a credential.

        Mirrors :class:`ChatModelConfig` but targets
        :class:`~agentscope.embedding.EmbeddingModelBase` subclasses.
        Used by :class:`KnowledgeBaseRecord` to persist the user's
        embedding model selection.

````