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

# Attach a knowledge base

> Attach a knowledge base to an agent

<ParamField path="agent_id" type="integer" required>
  Agent ID.
</ParamField>

<ParamField body="knowledge_base_id" type="string" required>
  Knowledge base to attach.
</ParamField>

## SDK

<CodeGroup>
  ```typescript TypeScript theme={null}
  await client.knowledgeBases.attach(7, kbId);
  ```

  ```python Python theme={null}
  await client.knowledge_bases.attach(7, knowledge_base_id)
  ```
</CodeGroup>
