Using a Knowledge Base

Use your Knowledge Bases within Playgrounds, Experiments and Deployments.

Adding a Knowledge Base

To add a Knowledge base in a Playground, Experiment or Deployment, open the Knowledge Base tab in the Configuration screen and select Add a Knowledge Base.

Here you can select which Knowledge Base to include by clicking on the key. Press **Save** when done selection.

Here you can select which Knowledge Base to include by clicking on the key. Press Save when done selection.

Knowledge Base Type

Here you can decide whether the Knowledge Base type is last user message or query. This defines how the Knowledge Base will be queried. This will be seen in the following section.

Using a Knowledge Base in prompts

To use a Knowledge Base within prompts, use the {{key}} syntax where key is the key of your Knowledge Base.

You will see your knowledge base being correctly referenced if its key appears in blue.

You will see your Knowledge Base being correctly referenced if its key appears in blue.

Depending on the Type of the Knowledge base configured, you have two ways to use it.

Last User Message

By using the Last User Message type, the user message will be used as a query to retrieve the relevant chunks.

Query

By using the Query type, your predefined query will be used to retrieve the relevant chunks.

Note: You can also use a {{variable}} within the query type, which can be especially helpful in a deployment.

Example

An example of using a knowledge base in Orq.ai

An example of using a Knowledge Base in Orq.ai