> For the complete documentation index, see [llms.txt](https://docs.tonic.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tonic.ai/fabricate/data-agent-chat/data-agent-db-configure.md).

# Data Agent chat prompts and messages

You use the Data Agent chat to provide instructions to the Agent to create and update database and database connections.

From the Data Agent, you can:

* Add, configure, and delete local databases and database connections.
* Use Data Agent tools such as plans, profiles, and workflows.

The Data Agent chat applies across the entire project.

## Prompting the Data Agent to perform an action <a href="#data-agent-prompt" id="data-agent-prompt"></a>

You provide Data Agent prompts to tell it the action that you want to perform. The Data Agent asks clarifying questions if needed, then completes the action. Type the prompt, then press Enter or click the send icon.

For example, you might prompt the Data Agent to create a new local database, then provide additional prompts to make adjustments to the database structure and the data values.

* `Create a database of consumer transactions. The database includes orders, customers, and products.`
* `Update the customer email address column to use real personal and commercial email domains.`
* `Add a table for available payment methods and an orders column that links to the payment method used.`

You can also use the Data Agent to work with Data Agent tools. For example:

* `Create a workflow that adds records to the customers table and then adds an order for each of those new customers to the orders table. Prompt for the number of customers to add.`
* `Create a profile of the transactions database.`

The Data Agent can also answer questions about data. For example:

* &#x20;`How many customers have more than 2 items in an order?`
* `How many customers are from each state?`

## Uploading files to the Data Agent

To provide information for the Data Agent to work from, you can upload files.

A file might, for example, contain the schema to use (`Add a table that uses the attached schema`). Examples of schema files include:

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

Or it might contain a set of example values (`Add a job title column that uses the attached list of values`).

Or it might be a CSV or .xlsx file that contains a list of records (`Use the attached Excel file to create a products table.`)

You can also upload .jpg and .png images. For example, you might upload an image to show the structure of an invoice form that the Data Agent populates from the data.

To upload files to the Data Agent, either:

* Drag and drop the files to the Data Agent.
* Click the attachment icon, then search for and select the files.

<figure><img src="https://4109733485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmoU4gTR9LxlzHeWmQCUZ%2Fuploads%2FqHJDSpPPo2qm2SwckwfF%2FDataAgent_AttachmentIcon.png?alt=media&amp;token=dbe08652-92bd-4b6a-86ff-8a7cb531973b" alt=""><figcaption><p>Data Agent chat prompt with the attachment icon highlighted</p></figcaption></figure>

Note that for a live connection database, you can only import data. You cannot import schema information or other files.

## Stopping processing of a request

While the request is in progress, the send icon changes to a stop icon.

<figure><img src="https://4109733485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmoU4gTR9LxlzHeWmQCUZ%2Fuploads%2FbHbHllpepKjyoVVxNVDG%2FDataAgent_StopProcessing.png?alt=media&amp;token=284c55fc-9f34-4b55-9e1d-bf9be073da44" alt=""><figcaption><p>Stop icon to stop the current action</p></figcaption></figure>

To stop the processing, click the stop icon.

If a workflow job is in progress, then Fabricate displays the **Stop Conversation** panel, to allow to you determine what to do with the workflow job:

1. Select the handling option:
   1. To separate the workflow from the chat conversation, and allow the workflow to continue to run, click **Detach the workflow from the conversation**.
   2. To cancel the workflow, click **Cancel the workflow**.
2. Click **Confirm**.

## Viewing the SQL or JavaScript for a Data Agent action

To complete an action to a database, the Data Agent generates either SQL or JavaScript.

In the chat window, the Data Agent uses icons to identify actions that generated SQL or JavaScript.

To view the content of the SQL or JavaScript, click the dropdown icon for the action. To copy the SQL or JavaScript, click the copy icon.

<figure><img src="https://4109733485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmoU4gTR9LxlzHeWmQCUZ%2Fuploads%2FPooIDqTTRFZPvpUSEwxr%2FDataAgent_SQLDetail.png?alt=media&amp;token=da49eff0-6838-42c0-adb2-fa48ac0d7a48" alt=""><figcaption><p>Displaying the generated SQL for a step</p></figcaption></figure>

<figure><img src="https://4109733485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmoU4gTR9LxlzHeWmQCUZ%2Fuploads%2FXKgyu3a5VpQsRxo9dziG%2FDataAgent_JavaScriptDetail.png?alt=media&amp;token=26e393e6-24de-4dfb-b19b-a3010977ef76" alt=""><figcaption><p>Displaying the generated JavaScript for a step</p></figcaption></figure>

## Reverting a change

If a change produces unexpected results, you can provide another prompt to fix the issue.

You can also revert a change and then try again.

You cannot revert changes to a live connection database.

To revert a change, in the Data Agent chat:

1. Hover over the prompt that initiated the change.

<figure><img src="https://4109733485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmoU4gTR9LxlzHeWmQCUZ%2Fuploads%2FmW2yrQlwpgRLeVoreF2O%2FDataAgent_RevertOption.png?alt=media&amp;token=0c0756d6-ca6c-474d-a036-48ec1be295d5" alt=""><figcaption><p>Revert option for an action to a Data Agent database</p></figcaption></figure>

2. Click the revert icon.
3. Confirm that you want to revert the change.\
   \
   The Data Agent reverts the change. It redisplays the prompt so that you can make adjustments to it.

## Removing a message from the chat

To streamline the chat, you can remove individual messages. Removing a message does not revert the associated change.

When you remove a message, you can optionally also remove all of the subsequent messages.

To remove a message:

1. Hover over the message.
2. Click the delete icon.

<figure><img src="https://4109733485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmoU4gTR9LxlzHeWmQCUZ%2Fuploads%2FdsV0gOWo2r6YGDBwy5ps%2FDataAgent_DeleteMessage.png?alt=media&amp;token=a66b045a-9d6e-4f5b-bd5a-5de85637eb29" alt=""><figcaption><p>Delete option to delete a message from the chat</p></figcaption></figure>

3. On the confirmation panel, to also delete subsequent messages, toggle **Delete all following messages** to the on position.

<figure><img src="https://4109733485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmoU4gTR9LxlzHeWmQCUZ%2Fuploads%2FHo319N9O9PAPSfMocWqF%2FDataAgent_DeleteMessageConfirmation.png?alt=media&amp;token=677a2be5-4ab6-471c-8ddd-bc4ebc74dc20" alt=""><figcaption><p>Confirmation panel to delete message from the chat</p></figcaption></figure>

4. Click **Delete Message(s)**.

## Displaying the timestamp for a chat message

To display the UTC timestamp for a chat message, hover the mouse over the message while you press the Shift key.

<figure><img src="https://4109733485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmoU4gTR9LxlzHeWmQCUZ%2Fuploads%2FeMUNrcJwAgsjh90ARiEj%2FDataAgent_MessageTimestamp.png?alt=media&amp;token=3b2d1119-390d-4a9a-970f-651f97a85883" alt=""><figcaption><p>Timestamp in UTC for a Data Agent chat message</p></figcaption></figure>

## Providing feedback on chat responses <a href="#chat-response-feedback" id="chat-response-feedback"></a>

For each chat response, to help guide the Data Agent, you can indicate whether the response was helpful.

<figure><img src="https://4109733485-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmoU4gTR9LxlzHeWmQCUZ%2Fuploads%2FWivsdcciSf5NeAgH7dfd%2FDataAgent_ResponseFeedbackIcons.png?alt=media&amp;token=8d52db61-40d5-44a0-9736-0acf80fbb552" alt=""><figcaption><p>Data Agent chat responses with feedback icons</p></figcaption></figure>

To indicate that a response was helpful, click the thumbs up icon.

To indicate that a response was not helpful, click the thumbs down icon. Fabricate prompts you to provide additional information.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.tonic.ai/fabricate/data-agent-chat/data-agent-db-configure.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
