This document describes how to create context sets in Firestore Studio using a context set file. Context set names must be unique within a database.
To learn about context sets, see Context sets overview.Before you begin
Complete the following prerequisites before creating an agent.
Enable required services
Enable the following services for your project:Prepare a Firestore database
Make sure that you have a Firestore Enterprise edition database with MongoDB compatibility.
If you're trying the examples on this page, we recommend that you create a new database for this purpose. For more information, see Create and manage databases.
Required roles and permissions
- Grant the
roles/datastore.viewerandroles/geminidataanalytics.queryDataUserroles to the IAM user at the project level. For more information, see Add IAM policy binding for a project.
Create a context set
To create a context set, perform the following steps:
In the Google Cloud console, go to the Firestore page.
Select a database from the list. The database must be of the type Firestore with MongoDB compatibility.
In the navigation menu, click Firestore Studio.
In the Explorer pane, next to Context sets, click View actions.
Click Create context set.
In Context set name, provide a unique context set name. The context set name is case-sensitive and can contain letters, numbers, hyphens, and underscores.
Optional. In Context set description, add a description for your context set.
Click Create.
Build context sets
After creating a context set, follow the steps in Build context sets using the context engineering agent to create a context set file. You can then edit your context set to upload the context set file.
Edit a context set
To edit a context set, perform the following steps:
In the Google Cloud console, go to the Firestore page.
Select the database from the list.
In the navigation menu, click Firestore Studio.
In the Explorer pane, next to Context sets, click View actions.
Click Edit context set.
Optional. Edit Context set description.
Click Browse in the Upload context set file section, and select the context set file.
Click Save.
Delete a context set
To delete a context set, perform the following steps:
In the Google Cloud console, go to the Firestore page.
Select the database from the list.
In the navigation menu, click Firestore Studio.
In the Explorer pane, next to Context sets, click View actions.
Click Delete context set.
In the Delete context set confirmation dialog, enter the name of the context set.
Click Confirm to delete the context set.
What's next
- Learn more about context sets.
- Learn how to test a context set.
- Learn how to build contexts using Gemini CLI.