Documentation / Add Tools and Knowledge Base
Add Tools and Knowledge Base
Connect your prompt agent to live data and company documents.
Tools let the agent query systems and perform actions during a conversation. The knowledge base lets it answer questions from your company documents.
For example, an agent can retrieve a customer's cart in real time and use a document to explain your return policy.
Step 1: Configure a tool
In the agent settings, add an External HTTP API tool. Give it a clear name such as get_cart_details and configure the endpoint providing the cart data.
To test with a public example API, use:```text GET https://dummyjson.com/carts/1
## Step 2: Attach the tool to the agent
Select the tool in the agent settings and save. Creating a tool does not make it available to an agent until you attach it.
## Step 3: Upload and attach a document
Open **Knowledge base** in the dashboard and click **Upload document**. Click **Choose file** or drag and drop a document. Click **Upload and process** and wait for the **Completed** status.
In the agent editor, open the **Knowledge** tab and select the document in **Knowledge base**, in the **Agent sources** section. Save the changes.
Uploading a document to the workspace and attaching it to an agent are separate actions. See [Knowledge Base](/voice-agent/knowledge-base).
## Step 4: Guide the agent in the prompt
Explain when to query the tool and when to use the document:```text
When the user asks about cart items or the total, call get_cart_details before responding.
When the user asks about returns, consult the return policy document before responding.
```Save the instructions.
## Step 5: Test
Start a test conversation and ask about the cart and return policy. Verify that the agent queries the appropriate tool or document before answering.
