Data Sources
A data source is a predefined blob of text containing structured, semi-structured, or unstructured data. You can configure a data source to provide context to an agent that it can use when answering a user’s questions. This can have significant latency advantages over including this information in the agent’s prompt (more details below), as well as allows you to provide different agents with different knowledge bases even if they all use the same prompt.
Creating a data source
Go to the “Data Sources” tab on the side toolbar and click “New data source” on the top right.
-
Name: This is the name under which the data source will be stored. It must be unique within the suborg and cannot contain any whitespace.
-
Description (optional): User-readable description of the data source.
-
Content: The actual text content of the data source. (Note the sentence at the beginning of the content. It can significantly improve search performance if you include a statement like this providing context to the LLM for what the data represents.)
Linking a data source to an agent
To give an agent the ability to fetch information from a data source when answering questions, you have two options.
Option 1: Tool with static parameter
This is the recommended option. It allows you to use more than one data source if needed, and provides more user-friendly configuration at the agent level.
-
Create one or more data sources and note the names.
-
Create a tool with the following schema (specify whatever tool name you want).
Note that the static parameter must be named “doc” in order to successfully access the search API. Additionally, the strings in the default
list for “doc” must be the names of your existing data sources.
-
Create a prompt that has access to the tool you created.
-
Link an agent to that prompt.
Note that if you later create another agent that you want to have access to different data sources, you can link it to the same prompt but override the default “doc” values on that agent (see “Tool configuration”).
Option 2: general_information tool
This option is not recommended as it only allows you to use one data source and relies on the agent session “vars” syntax, which is less user-friendly than using static parameters.
-
Create a data source and note the name.
-
Create a prompt that has access to the general_information tool.
-
Link an agent to that prompt.
-
In the agent’s “Session Configuration” section, for the variable
vars.domain
, enter the valuedoc://yourdatasourcenamehere
.