Adding knowledge to agents
Adding knowledge to agents play a crucial role in enhancing their conversational capabilities by providing them with the necessary information to generate accurate and contextually relevant responses for specific use cases. You can directly upload files to the agent, or connect to a Milvus or Elasticsearch instance as a content repository.
A content repository is a centralized storage system where you can add files and documents to enhance your agent's knowledge. Whether you choose to upload files directly to the agent's knowledge base or connect to an external repository like Milvus or Elasticsearch depends on your specific needs and goals for your business use cases.
Before you begin
If you want to use Milvus or Elasticsearch as a content repository, contact your IT administrator for the connection details. For more information about how to set up the connection, see Connecting to external content repositories.
Providing context about the knowledge to the agent
Provide clear information about the content of the documents that you upload as knowledge. This description helps the agent understand and interpret the data, and decide whether to use the knowledge in its responses or rely on another method, such as calling a tool or by using the large language model (LLM).
Follow the steps to describe the knowledge:
- In the Knowledge section, click Description.
- Enter the information regarding to the knowledge to your agent. Use the following guideline to help you craft a description for the knowledge:
Be specific and detailed:
- Clearly outline the type of content the agent can retrieve.
- Include examples of the kinds of queries the agent can handle.
Use clear and concise language:
- Avoid jargon or overly complex language that might confuse the system.
- Use straightforward sentences to describe the knowledge.
Include keywords:
- Incorporate relevant keywords that are likely to be used in content queries.
- Think about the terms users might use when seeking information and include those in the description.
Update regularly:
- Ensure that the descriptions are kept up to date with any new skills or changes in retrieval capabilities.
Uploading files directly to the agent
Before you upload files and documents, you must acknowledge the requirements of using this mechanism:
- The maximum file size is 25 MB.
- The maximum files in one batch are 20, and the maximum file size of a batch is 50 MB.
- You can upload up to 50 files before moving to an external data source.
- Supported file types are
txt
,pdf
,csv
,docx
,xlsx
,pptx
andhtml
.
Follow the steps to upload documents as knowledge:
- In the Knowledge section, go to Documents.
- Select Files, and click Upload files.
- Upload the files.
Storing the data
When you upload files and documents directly to the agent, the data is stored in an IBM Cloud in a particular region. A few exceptions are:
- If you use watsonx Orchestrate in IBM Cloud, then your data is stored in the same data center.
- If you use watsonx Orchestrate in AWS, then your data is stored in IBM Cloud in a region closest to your AWS region.
The following table helps you to find the mapping of watsonx Orchestrate AWS data center to the IBM Cloud data center region.
watsonx Orchestrate on AWS | Your uploaded data on IBM Cloud |
---|---|
us-east-1 (North Virginia) | us-east (Washington D.C) |
eu-central-1 (Frankfurt) | eu-de (Frankfurt) |
ap-southeast-1 (Singapore) | jp-tok (Tokyo) |
Connecting to external content repositories
To connect your agent to a content repository, access the following procedures for Milvus and Elasticsearch:
- Connecting your agent to a content repository on Milvus.
- Connecting your agent to a content repository on Elasticsearch.
Editing the settings of the search results
Fine tune how your agent uses the search results to respond to user prompts:
- In the Knowledge section, click Edit knowledge settings.
- Use the information in the following sections to edit the settings available:
- Click Save.
Defining the confidence threshold for retrieval and responses
The confidence threshold defines the agent likelihood to use the results from the knowledge database for retrieving relevant information and generating responses.
These thresholds are scores that indicate the required level of certainty for the agent to deem the results reliable. The confidence threshold that you predefine specifies the minimum confidence score that must be surpassed for the agent to accept the results.
In the knowledge settings, you can edit the confidence threshold for the following options:
-
Retrieval confidence threshold
The confidence threshold for retrieval measures how certain the system is that it retrieved the most relevant information from its database to answer a user's query. It is the estimated probability that the retrieved data contains the necessary details to respond accurately to the user's request.
-
Response confidence threshold
The confidence threshold for responses is the estimated probability that the response generated is correct, relevant, and useful in addressing the user's query or request for the available content.
For both Retrieval confidence threshold and Response confidence threshold options, you can set the following confidence thresholds:
-
Lowest
The agent is very likely to use the results from the knowledge database. This means that the agent frequently rely on the knowledge database for decision-making, even with lower confidence scores.
-
Low
The agent is likely to use the results from the knowledge database. This means that the agent uses the results more often than with a high threshold but less often than with the lowest threshold.
-
High
The agent is unlikely to use the results from the knowledge database. This means that the agent uses the results less often than with a low threshold but more often than with the highest threshold.
-
Highest
The agent is very unlikely to use the results from the knowledge database. This means that the agent rarely rely on the knowledge database for decision-making, requiring high confidence scores to do so.
Adjusting the length of the generated response
Adjust the length of the responses that your agent gives to better fit your needs. The default setting is moderate, but you can change it as needed:
- In the Knowledge section, click Edit knowledge settings.
- In Generated response length, select a setting:
- Concise: Responses are shorter and to the point, which is ideal for straightforward queries.
- Moderate: Responses balance detail and conciseness, making them suitable for most general inquiries.
- Verbose: Responses provide more detailed and comprehensive information that is suitable for complex queries or when a thorough explanation is needed.
- Click Save.
Setting the number of citations your agent shows
When you upload documents as knowledge, users can review the citations in the chat to verify the accuracy of the information. Citations acknowledge the sources of data, models or algorithms that the agent uses to generate its outputs or make predictions.
Follow the steps to configure the number of citations to show in the chat. The number that you define doesn't impact the number of citations used in the response:
- In the Knowledge section, click Edit knowledge settings.
- From the Number of citations shown, select a number to determine how many citations or references the agent can provide in its response.
- Click Save.