---
title: "PUT /agents/{agentId}/agentversions/{agentVersion}/knowledgebases/"
method: PUT
path: "/agents/{agentId}/agentversions/{agentVersion}/knowledgebases/"
---

# PUT /agents/{agentId}/agentversions/{agentVersion}/knowledgebases/

`PUT /agents/{agentId}/agentversions/{agentVersion}/knowledgebases/`

Associates a knowledge base with an agent. If a knowledge base is associated and its <code>indexState</code> is set to <code>Enabled</code>, the agent queries the knowledge base for information to augment its response to the user.

## Path parameters

- `agentId` string, required
- `agentVersion` string, required

## Request body

- object
  - `knowledgeBaseId` string, required — The unique identifier of the knowledge base to associate with the agent.
  - `description` string, required — A description of what the agent should use the knowledge base for.
  - `knowledgeBaseState` 'ENABLED' | 'DISABLED' — Specifies whether to use the knowledge base or not when sending an <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html">InvokeAgent</a> request.

## Response `200`

Success

- AssociateAgentKnowledgeBaseResponse
  - `agentKnowledgeBase` object, required — Contains details about the knowledge base that has been associated with the agent.
    - `agentId` string, required — The unique identifier of the agent with which the knowledge base is associated.
    - `agentVersion` string, required — The version of the agent with which the knowledge base is associated.
    - `knowledgeBaseId` string, required — The unique identifier of the association between the agent and the knowledge base.
    - `description` string, required — The description of the association between the agent and the knowledge base.
    - `createdAt` string, date-time, required — The time at which the association between the agent and the knowledge base was created.
    - `updatedAt` string, date-time, required — The time at which the association between the agent and the knowledge base was last updated.
    - `knowledgeBaseState` 'ENABLED' | 'DISABLED', required — Specifies whether to use the knowledge base or not when sending an <a href="https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent-runtime_InvokeAgent.html">InvokeAgent</a> request.

## Other responses

- `480` — ThrottlingException
- `481` — AccessDeniedException
- `482` — ValidationException
- `483` — InternalServerException
- `484` — ResourceNotFoundException
- `485` — ConflictException
- `486` — ServiceQuotaExceededException

---

[API](https://skmtc.net/aws/apis/bedrock-agent.md) · [All operations](https://skmtc.net/aws/apis/bedrock-agent/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/bedrock-agent/versions/a3b2356f17da/schema)
