How to Attach and Detach Knowledge Basespublic
Validated on 28 Apr 2025 • Last edited on 20 May 2025
DigitalOcean GenAI Platform lets you build GPU-powered AI agents with fully-managed deployment. Agents can use pre-built or custom foundation models, incorporate function and agent routes, and implement RAG pipelines with knowledge bases.
You can attach knowledge bases to give agents access to additional custom data, or detach them if the information is no longer needed. Attaching or detaching knowledge bases triggers an immediate redeployment of the agent.
Attach a Knowledge Base to an Agent Using the Control Panel
To attach a knowledge base using the DigitalOcean Control Panel, in the left-hand menu, select GenAI Platform, click the Agents tab, find and then select the agent you want to update, then open its Resources tab. Under the Knowledge Bases section, click Add Knowledge Bases.
In the Knowledge Bases field, type and then select the knowledge base you want to attach. A knowledge base must have vector embeddings to appear in the list. If it’s created but not yet indexed, you cannot attach it to an agent. After selecting the knowledge bases, click Add Knowledge Bases.
You can view attached knowledge bases in the agent’s Resources tab, along with the last indexing time and attachment date.
Attach a Knowledge Base to an Agent Using the API
To attach a knowledge base using the API, provide the agent’s ID and the knowledge base ID. Retrieve available knowledge bases using the List Knowledge Bases endpoint, and agents using the List Agents endpoint.
A knowledge base must have at least one indexed data source to appear in the list. To index a knowledge base, find its ID in the list, then index its data sources.
Once attached, the agent can access and retrieve content from the knowledge base during prompt processing.
Detach a Knowledge Base from an Agent Using the Control Panel
You can detach a knowledge base if it’s no longer needed. This stops the agent from referencing it but doesn’t delete or affect the knowledge base itself. Detaching a knowledge base triggers immediate agent redeployment, which may take a few minutes.
From the DigitalOcean Control Panel, in the left-hand menu, click GenAI Platform, click the Agents tab, find and then select the agent you need, click its Resources tab, then under the Knowledge Bases section, find the knowledge base to detech. To the right of the knowledge base, click …, select Detach Knowledge Base, then in the confirmation window, confirm detachment by typing the knowledge base name, then click Detach Knowledge Base.
Detach a Knowledge Base from an Agent Using the API
To detach a knowledge base using the API, provide the agent ID and knowledge base ID. Retrieve IDs using the List Agents and List Knowledge Bases endpoints.