# Bind knowledge bases, workflows, and resources

View or update agent resource bindings, and create, query, and maintain agent knowledge bases and workflow bindings. This page does not create source resources such as knowledge bases or workflows themselves.

## Prerequisites

Prepare credentials that can access the target workspace, the target agent ID, and the IDs of knowledge bases, workflows, or resources to bind. For service endpoints, authentication, and general request formats, see [Prepare to call an API](../../api-call-basics.md).

First confirm that source resources exist. Binding operations on this page use only the input defined by the corresponding Reference action pages.

## Call sequence

1. First [get resource bindings](../../../../reference/api/ai-studio/agents/agents/get-resource-bindings.md) to confirm existing bindings for the target agent.
2. To adjust general resources, update resource bindings and query them to confirm the current result.
3. To manage agent knowledge bases or workflow bindings, query existing bindings first, then create or update the target binding.
4. Query the corresponding bindings again after a change to confirm that the target object appears in the result.

## API operations

### Manage agent resource bindings

| What you need to do | API operation | Use it when |
| --- | --- | --- |
| Query resource bindings | [Get resource bindings](../../../../reference/api/ai-studio/agents/agents/get-resource-bindings.md) | Confirm agent resource bindings before or after an update. |
| Update resource bindings | [Update resource bindings](../../../../reference/api/ai-studio/agents/agents/update-resource-bindings.md) | You identified target resources and need to adjust bindings. |

### Manage agent knowledge bases

| What you need to do | API operation | Use it when |
| --- | --- | --- |
| Create an agent knowledge base | [Create an agent knowledge base](../../../../reference/api/ai-studio/agents/agent-knowledge-bases/create-agent-knowledge-base.md) | Create an agent knowledge base. |
| Query agent knowledge bases | [List agent knowledge bases](../../../../reference/api/ai-studio/agents/agent-knowledge-bases/list-agent-knowledge-bases.md) | Select or confirm an agent knowledge base. |
| Query agent knowledge base details | [Get an agent knowledge base](../../../../reference/api/ai-studio/agents/agent-knowledge-bases/get-agent-knowledge-base.md) | Confirm a target agent knowledge base before updating. |
| Update an agent knowledge base | [Update an agent knowledge base](../../../../reference/api/ai-studio/agents/agent-knowledge-bases/update-agent-knowledge-base.md) | You have the target ID and need to modify it. |

### Manage agent workflow bindings

| What you need to do | API operation | Use it when |
| --- | --- | --- |
| Create an agent workflow binding | [Create an agent workflow binding](../../../../reference/api/ai-studio/agents/workflow-bindings/create-workflow-binding.md) | You identified an agent and workflow and need to create a binding. |
| Query agent workflow bindings | [List agent workflow bindings](../../../../reference/api/ai-studio/agents/workflow-bindings/list-workflow-bindings.md) | Select or confirm a workflow binding. |
| Query agent workflow binding details | [Get an agent workflow binding](../../../../reference/api/ai-studio/agents/workflow-bindings/get-workflow-binding.md) | Confirm a target binding before updating. |
| Update an agent workflow binding | [Update an agent workflow binding](../../../../reference/api/ai-studio/agents/workflow-bindings/update-workflow-binding.md) | You have the binding ID and need to modify it. |

## Confirm the result

After updating a resource, use [Get resource bindings](../../../../reference/api/ai-studio/agents/agents/get-resource-bindings.md) to confirm it. Confirm knowledge base and workflow bindings with their respective detail or list actions.

## Next steps

- [Create and maintain agents](agents.md)
- [Invoke agents and manage sessions](agent-invocation-sessions.md)
