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

# Prompt, knowledge and tools

> Write the system prompt that shapes an agent, attach a knowledge base of your own documents, and give the agent tools it can call.

Three things decide what an agent can say: the **system prompt** (who it is), the **knowledge
base** (what it knows about your business), and its **tools** (what it can do). They all live on
the **Prompt & Tools** tab of the agent editor.

<Frame caption="The Prompt & Tools tab">
  <img src="https://mintcdn.com/haconsultancy/8jQZZfLAZM_xjJe7/images/ai-agents/prompt-tools.png?fit=max&auto=format&n=8jQZZfLAZM_xjJe7&q=85&s=2d0ab9408f3e496e105fcb5f99240308" alt="The Prompt and Tools tab with the tools picker, knowledge base selector and system prompt editor" width="2880" height="1800" data-path="images/ai-agents/prompt-tools.png" />
</Frame>

## The system prompt

The system prompt is the agent's standing brief. Callivox describes it as:

> The agent's standing instructions — its role, tone, and rules. Supports Markdown (headings,
> bold, lists). This is sent with every message before the conversation.

A new Prompting Agent starts with `You are a helpful assistant.` — replace it.

### Writing one that works

* **Say who the agent is and who it's talking to.** "You are the support assistant for Northwind
  Bikes. You talk to customers who have already bought a bike."
* **Set the tone in concrete terms.** "Two or three sentences. No emoji. Never use exclamation
  marks." is more useful than "be professional".
* **List what it must not do.** Refunds it can't approve, prices it must not quote, promises it
  must not make. Rules stated as prohibitions hold better than rules stated as preferences.
* **Tell it what to do when it doesn't know.** For example, "If the answer isn't in the knowledge
  base, say you'll check with a colleague and hand off." Pair this with the handoff rules on the
  [Behavior tab](/ai-agents/behavior-and-handoff).
* **Use headings and bullets.** The editor supports Markdown, and structure makes long prompts
  easier for both you and the agent to follow.
* **Don't paste your policies in.** Long reference material belongs in a knowledge base, not the
  prompt — the prompt is re-sent with every single message.

<Tip>
  After every prompt change, run the **Test** button in the editor header. It shows you the reply
  before a customer sees it. See [Creating an agent](/ai-agents/creating-an-agent).
</Tip>

## Knowledge bases

A knowledge base is a collection of your own documents that agents can search when they answer.
Instead of putting your help centre in the prompt, you add it once as a knowledge base and point
agents at it — the agent then pulls in only the passages relevant to the question in front of it.

Knowledge bases live under **AI → Knowledge Bases**, and need a plan that includes the knowledge
base feature.

<Frame caption="A knowledge base and its documents">
  <img src="https://mintcdn.com/haconsultancy/8RjuZKhX-P1FqHZb/images/ai-agents/knowledge-bases.png?fit=max&auto=format&n=8RjuZKhX-P1FqHZb&q=85&s=cb25bc43aa0e3a28dc8227107e8589f0" alt="A knowledge base detail page showing documents and the three ways to add a source" width="2880" height="1800" data-path="images/ai-agents/knowledge-bases.png" />
</Frame>

### Create a knowledge base

<Steps>
  <Step title="Click + New KB">
    Type a name and confirm. Callivox drops you straight into the new knowledge base.
  </Step>

  <Step title="Add a description">
    Optional, but it helps when you have several. Click **Save** when the **Unsaved changes**
    indicator appears.
  </Step>

  <Step title="Add your first document">
    Three cards on the page take sources — see below.
  </Step>
</Steps>

### Adding documents

| Card                   | What you provide                                                   | Limits                      |
| ---------------------- | ------------------------------------------------------------------ | --------------------------- |
| **Add Website Source** | A **Name** and a **URL**. Callivox fetches the page.               | URL up to 2,048 characters  |
| **Text Source**        | A **Name** and a **Body** you paste in.                            | Body up to 2,048 characters |
| **File Source**        | A file you upload. The help text reads "PDF or DOCX, up to 20 MB." | PDF or DOCX, 20 MB          |

All three cards stay on the page — there's no separate "add document" dialog. Each new document
appears in the **Documents** list with its type and a status:

| Status                | What it means                                                                  |
| --------------------- | ------------------------------------------------------------------------------ |
| **Processing**        | Callivox is still reading the document. It isn't searchable yet.               |
| **Ready**             | The document is indexed and agents can answer from it.                         |
| **Error**             | Processing failed. The row shows "This document failed to process."            |
| **RejectedNoCredits** | You ran out of credits mid-way: "Not enough credits to process this document." |

Fix the underlying problem — a bad file, or a [top-up](/billing/top-ups-and-auto-recharge) — then
use the **↻** button on the row, or **Re-evaluate failed** above the list to retry every stuck
document at once.

<Warning>
  Adding a document costs credits. The charge is based on the length of the document, so a large
  PDF costs more than a short page, and re-processing a document charges again. See
  [How credits are spent](/billing/how-credits-are-spent).
</Warning>

Each knowledge base has a **Used by** panel showing which agents reference it. Check that panel
before you delete one — the confirmation warns that it "can't be undone" and that "any agents
using it will lose access to these documents."

### Attaching a knowledge base to an agent

On the agent's **Prompt & Tools** tab, pick one from the **Knowledge base** dropdown. `(none)` is
the default. One agent uses one knowledge base at a time.

If the selected knowledge base has since been deleted, the picker shows a red **Unknown knowledge
base** warning with a **Clear** button.

<Note>
  Attaching a knowledge base doesn't guarantee the agent uses it. Say so in the prompt — for
  example, "Answer product questions from the knowledge base. If it isn't in there, don't guess."
</Note>

## Tools and functions

A tool lets an agent do something instead of only saying something: check an order, book a slot,
look up a subscription. Behind the scenes a tool is a call to one of your own systems, which the
agent decides to make when it needs the answer.

Tools live under **AI → Tools / Functions**. You attach them to an agent from the **Tools** picker
at the top of the **Prompt & Tools** tab — pick as many as the agent should be able to call. If
you have none yet, the picker shows "No tools yet. **Create a tool →**".

### Building a tool

<Steps>
  <Step title="Name it">
    Lowercase letters, digits and underscores only — for example `get_order_status`. A handful of
    names are reserved because Callivox already provides them: `search_kb`, `transfer_to_human`,
    `now`, `get_company_name` and `submit_objective_data`.
  </Step>

  <Step title="Describe it under Basics">
    "Explain what this tool does so the AI knows when to call it." This description is the only
    thing the agent reads when deciding whether the tool is relevant, so be specific: "Look up the
    delivery status of an order by its order number" beats "order tool".
  </Step>

  <Step title="Fill in the Request section">
    The **Endpoint** to call, the **Method**, and a **Timeout (seconds)** between 1 and 60
    (10 by default).
  </Step>

  <Step title="Define the Parameters">
    Each parameter has a name, a type, and where it goes in the request. A parameter sourced from
    the model is one the agent works out from the conversation — such as an order number the
    customer just gave you. A parameter sourced from context is filled in automatically from the
    conversation itself, so the agent can't get it wrong.

    Mark a parameter **required** when the tool can't run without it, and describe it — the agent
    reads those descriptions too.
  </Step>

  <Step title="Add Headers">
    Key/value pairs for anything the endpoint needs, such as an API key. Values can point at a
    stored secret rather than being typed in as plain text.
  </Step>
</Steps>

Each tool's sidebar shows which agents currently use it, and a switch to turn the tool off without
deleting it.

<Note>
  Assist agents don't get the tools picker. Their tab is called **Prompt & Knowledge** — prompt
  and knowledge base only. See [Assist agents](/ai-agents/assist-agents).
</Note>

## Next steps

<CardGroup cols={2}>
  <Card title="Behavior and handoff" icon="user-check" href="/ai-agents/behavior-and-handoff">
    Memory, escalation rules, and objectives.
  </Card>

  <Card title="Flows" icon="diagram-project" href="/ai-agents/flows">
    Script the conversation step by step instead.
  </Card>
</CardGroup>
