# Custom Knowledge Base

{% embed url="<https://youtu.be/NmRCMkHVLPU>" %}
Custom Knowledge Base Tutorial
{% endembed %}

After you’ve configured your AI Agent’s opening statement, the next step is to set up a custom knowledge base. This feature is crucial as it defines how your AI Agent manages two key aspects: the data attached to it and its handling capabilities.

<figure><img src="/files/9cVEz8Bvg6YjPnvOAu1C" alt=""><figcaption><p>Add Custom Knowledge Base to your Interworky AI Agent</p></figcaption></figure>

### 1. Data Handling

* The data attached to your AI Agent primarily consists of the information from your synced website. In this section, you can specify exactly how the agent should use this data by providing custom instructions, such as:

#### Directing Inquiries:

* Pricing Questions:

For example, you can add an instruction like:

`“If someone asks about prices, please refer them to`[ `this link`](https://yourdomain.com/pricing)`.”`

#### Providing Support Information:

You can instruct the agent to display the support number or explain how users can report an issue if the Agent is not working as expected.

#### Highlighting Offers:

For instance, if there’s a new offer (e.g., offer “50% Discount deal”), include a note such as:

`“Please make sure to tell the user about our new offer: 50% Discount deal.”`

#### Linking to Relevant Pages:

Specify that questions related to payments should direct users to a specific page (e.g., /payment) or that support-related inquiries should link to a designated support page.

### 2. Handling Capabilities

* The capabilities section is where you instruct your AI Agent on how to perform specific functions or requests. Here, you should explain in plain language what you expect the agent to do, much like providing instructions to a human:

#### Defining Functions:

Describe the functionality of various commands. For example:

`“If a user asks for their account details, fetch the profile information getAccountDetails Capability”`

#### Triggering Actions:

* Outline how the agent should handle certain requests, such as:

`“When a user inquires about shipping status, execute the shipping lookup capability and return the current status.”`

#### Custom Response Instructions:

Clearly specify any additional actions or responses. This can include guidance on handling complex queries or referring users to specific resources based on the context of their questions.

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://interworky.gitbook.io/interworky-docs/features-overview/ai-chat-bot-customization/custom-knowledge-base.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
