# Adding a local database to a project

## Adding the database

To add a local database to a project:

1. In the navigation panel, click **New database**.

<figure><img src="/files/WAYZyWbvOy2T3JkPbqSY" alt=""><figcaption><p>Option to add a database to a project</p></figcaption></figure>

2. On the new database panel, in the **Database name** field, provide a name for the new database.
3. Click **Create database**.

You can also use the Data Agent chat to add a database to the project. For example:

`Add a new database called Health records to the project.`

## Defining the initial data

1. You next provide a prompt to define the data to create.\
   \
   The prompt might be a simple instruction. For example: `Create a database of consumer transactions. The database includes transactions, customers, and products.`\
   \
   You might paste in a specific schema for the Data Agent to use. For example:  `Create a database of consumer transactions that uses the following schema.`\
   \
   You can also upload files to provide information for the Data Agent to use. For example, instead of pasting in the schema, you can upload a file, drag and drop the file to the Data Agent, or click the attachment icon.  Examples of schema files include:

   * QL DDL scripts
   * prisma.schema scripts
   * Swagger YAML API definitions

   If you [exported a profile](/fabricate/data-agent-tools/data-agent-profile.md#exporting-a-profile) from another database, you can attach the profile and use that as the basis for the database. For example: `Create a database from the attached profile.`
2. The Data Agent analyzes the request, and if needed asks clarifying questions about the data values, the volume of data, and the relationships between the tables.\
   \
   If you provided a schema that contains more than 10 tables, then the Data Agent automatically switches to [Plan mode](/fabricate/data-agent-tools/data-agent-modes-and-models/data-agent-plan-mode.md). It creates a plan to create the database, which you can then review and execute.
3. You can provide answers to further shape the data, and optionally tell the Data Agent to use its own judgment for some elements of the data.\
   \
   For example: `Create 70 customers. Each customer has 1-3 orders. Each order has 1-5 products. You can choose the distribution of the customers throughout the United States.`
4. When it has enough information to work from, the Data Agent creates the database structure, populates the database, and provides a summary of the results.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tonic.ai/fabricate/project-and-database-management/data-agent-db-create-manage/database-add-local.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
