Managing Databases in the RAI Console
A short guide to managing RelationalAI databases in the RAI Console.
RelationalAI’s RKGS databases contain Rel code and data. Rel code includes everything you use to build Rel applications that reason about your data, including definitions, reasoning, integrity constraints, and logic models.
In the RAI Console, RKGS databases are associated with your RAI account. When you log into the Console, it displays all the databases previously created in your account. You can create, overwrite, and clone databases through the Console.
You can use a database with any available engine. Engines are virtual machines of various sizes that process database transactions.
In the Console, you access RelationalAI notebooks by opening the database that contains your notebook. The database stores all data and definitions associated with the notebook, including the notebook itself.
Using an Existing Database
To use an existing database:
- Make sure an engine has been previously created, and choose an engine from the Engine pull-down menu at the top of the Console. If no engine has been previously created, you can create one by clicking Create Engine in the Engine pull-down menu.
- Click the Databases icon on the left-hand side of the Console. A list of previously created databases displays.
- Click the database that you want to use.
- Begin working with the database.

Your current database appears in the breadcrumb bar at the top of the Console.
Creating a New Database
You do not need to have an engine running in order to create or delete databases.
To create a new database:
- Click the Databases icon on the left-hand side of the Console.
- Click Create on the right-hand side of the Console.
- In the page that opens, enter a name for the database. Unless you want to overwrite an existing database, make sure that this name has not already been used.
- Click Create.

Cloning an Existing Database
You can also clone an existing database, which branches all of a database’s data and notebooks into a new database.
To clone an existing database:
- Click the Databases icon on the left-hand side of the Console.
- Click Create on the right-hand side of the Console.
- In the page that opens, enter a name for the database, and select the name of the database to be cloned from the Clone Database pull-down menu.
- Click Create.

Once you clone a database, the new database functions separately from the original database: Any subsequent changes to either database will not affect the other.
You cannot clone from a database until an engine has executed at least one transaction on that database.
Deleting a Database
You do not need to have an engine running in order to create or delete databases.
To delete a database:
- Click the Databases icon on the left-hand side of the Console.
- On the right-hand side of the database you want to delete, click Delete.
- In the confirmation message that appears, click Delete.
Before deleting a database, it’s best practice to:
- Check with other team members to be sure the database can be safely deleted.
- Export any notebooks from the database that you want to have available later, saving them as local
.json
files. For more details, see Exporting Notebooks in RAI Notebooks. - Export any base relations from the database that you want to preserve. See the CSV Export guide or Exporting JSON Data in the Data I/O: JSON Export and Import guide.
Data and definitions (sources) from the deleted database will be unrecoverable.
Working With Notebooks in a Database
All notebooks in the same database load the Rel code that has been installed in that database. This means that if two notebooks share a database, definitions in one will be visible to the other.
When you open a database, a list of installed Rel source files appears to the right of the Notebooks list. Sources are code blocks that are persisted in the database.
For more information, see Working With RAI Notebooks.