# Knowledge base AI template

## Template overview

This template uses our latest [Knowledge base AI](https://docs.chatlayer.ai/navigation/knowledge-base-ai) feature to generate answers based on your own documentation.

{% hint style="warning" %}
You can use the Knowledge base AI for free if you ask it under 50 questions per month. If you would like to use more than that, please [contact us](https://forms.office.com/pages/responsepage.aspx?id=ropROyGJe0qEl2GddWziDpBKj7if3UFHrttkAY_OzkZURUM1Wk4yRFZHM1pJRlJXWjFBWDg1VE0wSS4u).
{% endhint %}

## How to customize this template

To customize this template:

1. [Add your content ](https://docs.chatlayer.ai/bot-answers/knowledge-base-ai/set-up-your-faq-flow-using-a-generative-knowledge-base-ai#add-content)under the **Knowledge Base AI** tab.
2. Test your bot by asking anything.
3. You're good to go! Every time you'll ask a question, the bot will trigger the **Not Understood** block which will then scrape your knowledge base to generate an answer.

<figure><img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FQ2W7Ekf9YGuLyEBraYqg%2FScreenshot%202023-10-17%20at%2010.57.32.png?alt=media&#x26;token=6ea64ba8-844c-45a4-89cf-1e5d2216bba6" alt=""><figcaption><p>Example of use of the knowledge base AI feature.</p></figcaption></figure>

## Block: Source router

The Source router is a Condition block that checks if the source of the answer was a document or a URL. If the source was a URL, the response will be given together with a link to the source. If the source was a document, the response wouldn't give a link with it.&#x20;

<figure><img src="https://2786867680-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LLTwFwbOqJj4dDhg8Ju%2Fuploads%2FeFNOJO9YLmlL7elyoyr2%2FScreenshot%202024-04-03%20at%2017.35.32.png?alt=media&#x26;token=8c919d7c-da79-4f00-8f72-9322af2868aa" alt=""><figcaption><p>The Source router blocks checks the source of the generated answer before displaying it.</p></figcaption></figure>

## Learn more

Learn all about how the Knowledge Base AI feature works under this documentation page:

{% content-ref url="../../navigation/knowledge-base-ai" %}
[knowledge-base-ai](https://docs.chatlayer.ai/navigation/knowledge-base-ai)
{% endcontent-ref %}


---

# 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://docs.chatlayer.ai/start-quickly/bot-templates/knowledge-base-ai-template.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.
