What are knowledge bases?
Griptape knowledge bases are collections of data sources that applications can query to retrieve information. They give you control over which data sources can be accessed, as well as how the data can be retrieved. Once you have created the data source(s) you need, simply add them to a knowledge base so that your application, such as a Griptape assistant or agent, can access it.
When you add data sources to a knowledge base, your data is upserted to a database that is optimized for LLMs to retrieve quickly and process efficiently. Typically, this requires maintaining a database to store your data, operating a data ingestion (ETL) pipeline to collect it, and vending a query endpoint to make it available. Griptape Cloud automates this process for you.
How to create a knowledge base
Follow these steps to create a knowledge base. For this example, we will use the fully-managed Griptape Cloud database. EDB customers can select the pgvector option.
Navigate to the Knowledge Bases screen.
Click
Create
knowledge base.Select the Griptape Cloud knowledge base type.
Give your knowledge base a name and a description (optional).
Select the data source(s) you want to include in the knowledge base.
Click
Create
to submit the form.
Pro Tip:
You can add a data source to as many knowledge bases (KBs) as you want. For example, you can include a Frequently Asked Questions data source in both a New Employee Onboarding KB and a Customer Support Playbook KB.
What's happening?
Once you have created the knowledge base, we will automatically begin the process of upserting your data to a database. This process is known as a knowledge base job. It typically takes just a few moments.
While the job is in progress, you will be directed to the knowledge base detail page where you can observe the job status as well as view and edit knowledge base details such as the name, description, and data sources to be included.
How to use a knowledge base
When your knowledge base is ready, the data it contains becomes available for applications to retrieve via Griptape assistants, or structures such as agents.
Pro Tip:
You can perform a test query by selecting the Query
tab and entering some information that you know is in your data. The result will be a 'raw' response that contains the embedded text and other query parameters. This feature is useful for quick testing and debugging.
The next step of using your knowledge base is connecting it to an application, such as a chat assistant, that can retrieve your data and use it to generate useful responses.
Follow these steps to create and use a simple chat assistant.
Navigate to the Assistants page.
Click
Create
assistant.Give your assistant a name and description (optional).
Select your knowledge base from the
Knowledge bases
dropdown menu.Click
Create
to submit the form.
You will be directed to the assistant chat screen. Type a message to start a conversation thread with your new assistant. Try asking it something about your data!
Pro Tip:
Add a ruleset to provide your assistant with instructions and guidance for how it should behave.
Types of knowledge base engines
Knowledge bases are stored and accessed in various ways, according to the data types they contain and where the data sources are located. For example, unstructured text data is typically stored in a vector database. Griptape Cloud provides a fully-managed vector database, so that you don't need to deploy and operate it yourself. However, some customers have existing database installations where they would like their knowledge bases to reside.
Griptape Cloud
Upsert your data to a fully-managed Griptape Cloud database.
Pgvector
Upsert your data to your own pgvector database by providing the connection string and password for authorization.