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

# List agent knowledge sources

> Brain sources attached to the agent, with the scope each one is read through. The same list is inlined on `GET /agents/{agent_id}` as `knowledge_sources`.



## OpenAPI

````yaml get /agents/{agent_id}/knowledge-sources
openapi: 3.0.0
info:
  title: Public API
  version: 1.0.0
servers:
  - url: https://api.gumloop.com/api/v1
security: []
paths:
  /agents/{agent_id}/knowledge-sources:
    get:
      tags:
        - Agents
      summary: List agent knowledge sources
      description: >-
        Brain sources attached to the agent, with the scope each one is read
        through. The same list is inlined on `GET /agents/{agent_id}` as
        `knowledge_sources`.
      operationId: listAgentKnowledgeSources
      parameters:
        - in: path
          name: agent_id
          required: true
          schema:
            type: string
          description: ID of the agent.
      responses:
        '200':
          description: Attached sources.
          content:
            application/json:
              schema:
                type: object
                properties:
                  agent_id:
                    type: string
                  knowledge_sources:
                    type: array
                    items:
                      $ref: '#/components/schemas/AgentKnowledgeSource'
        '401':
          description: Unauthorized — missing or invalid API key.
        '403':
          description: >-
            Forbidden — the caller cannot view knowledge sources on this agent,
            or Brain is restricted for their role (`feature_access_restricted`).
        '404':
          description: Agent not found.
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: bash
          label: cURL
          source: >
            curl
            'https://api.gumloop.com/api/v1/agents/abc123DEFghiJKL/knowledge-sources'
            \
              -H 'Authorization: Bearer YOUR_ACCESS_TOKEN'
        - lang: python
          label: Python
          source: |
            from gumloop import Gumloop

            client = Gumloop(access_token="YOUR_ACCESS_TOKEN")

            response = client.agents.list_knowledge_sources("abc123DEFghiJKL")
            for source in response.knowledge_sources:
                print(source.connector_id, source.config)
components:
  schemas:
    AgentKnowledgeSource:
      type: object
      properties:
        connector_id:
          type: string
          description: Brain source ID, as returned by `GET /brain/sources`.
          example: PFqdAMir8PA2Xc6qcszSN9
        config:
          $ref: '#/components/schemas/KnowledgeSourceScope'
    KnowledgeSourceScope:
      type: object
      nullable: true
      description: >-
        Which part of a Brain source the agent reads. `null` is the whole
        source. Without `mode`, everything except `exclusions`; with
        `include_only`, only `inclusions`.
      properties:
        mode:
          type: string
          enum:
            - denylist
            - include_only
        inclusions:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgeScopeRule'
        exclusions:
          type: array
          items:
            $ref: '#/components/schemas/KnowledgeScopeRule'
    KnowledgeScopeRule:
      type: object
      required:
        - type
        - id
      properties:
        type:
          type: string
          enum:
            - container
            - document
          description: '`container` is a folder, channel or similar; `document` is one file.'
        id:
          type: string
          description: >-
            The item's ID in the source, as returned by `GET
            /brain/sources/{connector_id}/files`.
        name:
          type: string
          nullable: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A personal API key or an [OAuth 2.0](/api-reference/oauth) access token.
        Personal API keys also require the `x-auth-key` header with your user
        ID.

````