Building upon the foundation established in Part 1, you should now possess an operational generative AI agent within the Vertex AI Agent Builder.
Attempt to inquire with your agent about directions to Wakanda (for example, "What is the most efficient route to Wakanda?"), and you might receive a reply such as:
While the answer is factually correct, it doesn't offer much assistance if the agent merely responds with, "I am unable to provide that information," and closes the dialogue. Users would find it more helpful if the agent could suggest alternative destinations, which might even prompt them to arrange a trip through the agent.
To empower the agent to suggest alternative locations, you can augment its knowledge by utilizing data storage. When the agent's inherent knowledge is insufficient to answer a user's query, data storage acts as an additional repository of information. This method is also referred to as "foundation."
In the subsequent parts of this guide, you will explore the steps to create and link a data storage repository that includes Wakanda alternative locations to your current agent.
Setting up a data storage is easy—just click the "+ Data Storage" button located at the bottom of the "Agent Foundation" page.
On the following screen, provide the details below:
- Tool Name: Alternative Locations
- Type: Data Storage
- Description: Use this tool if the user's request includes a non-existent location
After filling in the details, click Save. This will establish a data storage tool that interacts with the data storage for the agent. Nevertheless, you still need to set up the actual data storage with the relevant information. To proceed, click "Create Data Storage."
Upon clicking, a popup might appear asking for your permission to store your search and conversation data in the United States region. If you agree, click the "Agree" button.
Proceed with data storage setup by entering the "Company Name" (for example, Travel Wise), and then click "Continue."
Click on "Create Data Storage" and choose "Cloud Storage."
Upon finishing the prior step,
- Select "Unstructured Documents (PDF, HTML, TXT, etc.)"
- Click on "File"
- Enter "ai-workshops/agents/data/wakanda.txt" in the cell
- Click the "Continue" button
On the subsequent page, assign a name to your data storage (e.g., Wakanda Alternative Locations) and click Create.
Finally, choose the data source you have just established and click Create.
If all steps were successful, the newly created data storage should appear on the "Available Data Storages" page.
By clicking on the data storage (here, "Wakanda Alternative"), you will view more detailed information, such as the documents included in the data storage:
Depending on the size of the imported document, full indexing might take some time. Indexing the wakanda.txt file usually takes approximately 5-10 minutes.
Once a green checkmark appears in the "Last Document Imported" field, go back to the "Agent Foundation" page and click "Manage All Tools."
Click on the data storage you have just created.
Within the "Data Storage" section, new settings will emerge. If these settings are not visible right away, it indicates that the data storage is still receiving data from Google Cloud Storage. This should finalize within roughly 5-10 minutes.
If the new settings are visible, proceed with the following steps:
- Select the data storage you wish to link (e.g., Wakanda Alternative)
- To prevent the agent from hallucinating, set the configuration to "Very Low," which imposes stricter limitations on the agent's generation of fictional content.
- After completing the edits, click the "Save" button at the top of the page.
Go back to the "Agent Foundation" page, verify the data storage (such as "Alternative Locations"), and then click the "Save" button located at the top of the page.
You're nearly finished! The last step involves adding the "Alternative Locations" tool to the agent's instructions. Insert the following line into the agent's directives: "- If the user's request includes a non-existent location, utilize ${TOOL: Alternative Locations}".
The instruction box may display a red border, but this is acceptable. Proceed by clicking the Save button at the top of the page to save the agent.
After saving the agent's configuration, try asking your agent again about how to reach Wakanda (e.g., "What is the best way to get to Wakanda?"), and you should receive a different response, like the following:
Congratulations! Your agent is now suggesting locations based on the information outlined in the text file.