Build An Assistant with Retrieval

This tutorial will show you how to build a Copilot Assistant with the knowledge of your internal documentation.


Adding Context

Context is a vital part of your Action's design process. It's the knowledge base your Action uses to respond to queries. In this case, we'll use the Klu documentation as our Context.

Select Context from the sidebar navigation. Once there, click on the Add Context button, give it a name, and you'll be taken to the Sources for this Context library.

Add your documentation site and Klu will automatically crawl and index the pages.


Create the Copilot Action

Head over to Klu Studio and begin building out your prompt.

In this example, I've added the Klu Docs context, and the following System Message instruction:

answer the question for the user using the klu documentation. 
only reference material from the context you have.

if appropriate, be friendly and ask for more information. 
always first confirm which language example the user prefers.

if appropriate, create specific step by step instructions list.

reference any context used with a link to the URL the user can read more. 
keep the MD for these simple. like this at the end with the specific page name and url:

[Page Name](https://docs.klu.ai/page/url)

and lastly, if the question is unrelated to Klu or you don't have the answer, 
politely bring the conversation back to Klu. 

This sets the guidelines for the assistant, clarifies its expected behavior, and outlines how to format the external references in its responses. Klu seamlessly maintains state and sessions across all model providers. You can manage and track sessions via the SDK.


Deploy your Copilot

To deploy your Copilot, select 'Deploy' from the top right of the Studio, choose the 'Production' environment, and click 'Deploy' to see the available options. Klu provides four deployment options:

  • Shareable Public URL
  • Python SDK
  • TypeScript SDK
  • API (with a cURL example)

You'll be able to integrate this Copilot into your product effortlessly.