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

# Knowledge Bases

> Give your AI agents the product, pricing, and policy knowledge they need to answer questions accurately during calls.

## What Are Knowledge Bases?

Knowledge bases are collections of information your AI agents can draw on during conversations. Instead of packing everything into instructions, you add text entries once and attach them to campaigns.

<CardGroup cols={2}>
  <Card title="Automatic Context" icon="brain">
    Attached knowledge is provided to the agent as context for the call. No extra API plumbing needed.
  </Card>

  <Card title="Text Entries" icon="database">
    Add text entries directly — FAQs, product details, pricing, policies — organized by category.
  </Card>

  <Card title="Always Up-to-Date" icon="arrow-rotate-right">
    Update entries anytime. The next call uses the current content.
  </Card>

  <Card title="Reusable" icon="recycle">
    Maintain one knowledge base and attach it to as many campaigns as you need.
  </Card>
</CardGroup>

## How Knowledge Bases Work

<Steps>
  <Step title="1. Create Knowledge Entries">
    In the TopCalls dashboard, open **Knowledge Base** and add text entries (FAQs, product info, policies), each with a name and category so entries stay organized.
  </Step>

  <Step title="2. Attach to a Campaign">
    In the campaign editor, attach the knowledge base entries the campaign's agent should know.
  </Step>

  <Step title="3. Context at Call Time">
    Every call the campaign makes includes the attached knowledge as context for the agent. API calls get the same knowledge when you pass the campaign's `campaign_id`.
  </Step>

  <Step title="4. Accurate Answers">
    The agent answers from the attached content instead of guessing.
  </Step>
</Steps>

## Using Knowledge Bases via the API

You define and attach knowledge in the dashboard, then reference the campaign when placing a call. Add `campaign_id` to a normal call and the agent picks up that campaign's attached knowledge base — no other campaign-execution fields are needed:

```json theme={null}
{
  "phone_number": "+14155551234",
  "task": "Answer customer questions about our products and services.",
  "campaign_id": "0c4f4b9e-8b0a-4f57-9d3e-2f1a7c9d1234"
}
```

The gateway loads the campaign's attached knowledge base and includes it in the call's runtime context.

You can also create and manage entries programmatically instead of in the dashboard. See the **Knowledge Bases** section of the [API reference](/api-reference/introduction) for the list, get, create, update, and delete endpoints.

## Example: Customer Support Agent

### Step 1: Create Knowledge Entries

Through the dashboard, add your support documentation:

```
Product Features:
- AI Voice Agents
- Campaign Management
- Custom Voices
- Function Calling

Common Issues:
- Call not connecting: Check phone number format (E.164)
- No audio: Verify microphone permissions
- Poor quality: Check internet connection
```

### Step 2: Attach and Call

Attach the entries to your support campaign, then reference it on calls:

```json theme={null}
{
  "phone_number": "+14155551234",
  "instructions": "You are a customer support agent. Answer questions about our products and help troubleshoot issues. Use the knowledge base to provide accurate information.",
  "campaign_id": "0c4f4b9e-8b0a-4f57-9d3e-2f1a7c9d1234"
}
```

## Best Practices

### Do This

* **Organize by topic**: Create separate entries for different topics (products, pricing, support)
* **Keep it updated**: Regularly update entries with new information
* **Use clear structure**: Organize content with clear headers and sections
* **Test thoroughly**: Run test calls and check the agent answers from your content
* **Keep it focused**: Everything attached to the campaign is given to the agent, so lean content keeps calls fast

### Avoid This

* **Too much information**: Oversized knowledge bases slow the agent down and dilute answers
* **Outdated content**: Regularly review and update
* **Vague content**: Use clear, specific information
* **Duplicate content**: Avoid overlapping information across entries

## Next Steps

<CardGroup cols={2}>
  <Card title="Making Calls" icon="phone" href="/guides/making-calls">
    Learn how calls pick up campaign knowledge.
  </Card>

  <Card title="API Reference" icon="book" href="/api-reference/introduction">
    See the complete API documentation.
  </Card>
</CardGroup>
