Skip to content

Commit 32bd6e8

Browse files
authored
feat: Add AI agent for natural language interaction with Parse Server (#2954)
1 parent 4717ae6 commit 32bd6e8

File tree

16 files changed

+2274
-47
lines changed

16 files changed

+2274
-47
lines changed

Parse-Dashboard/app.js

Lines changed: 865 additions & 4 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 90 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,14 @@ Parse Dashboard is a standalone dashboard for managing your [Parse Server](https
7474
- [Panel Item](#panel-item)
7575
- [Prefetching](#prefetching)
7676
- [Freeze Columns](#freeze-columns)
77-
- [Browse as User](#browse-as-user)
78-
- [Change Pointer Key](#change-pointer-key)
79-
- [Limitations](#limitations)
80-
- [CSV Export](#csv-export)
77+
- [Browse as User](#browse-as-user)
78+
- [Change Pointer Key](#change-pointer-key)
79+
- [Limitations](#limitations)
80+
- [CSV Export](#csv-export)
81+
- [AI Agent](#ai-agent)
82+
- [Configuration](#configuration)
83+
- [Providers](#providers)
84+
- [OpenAI](#openai)
8185
- [Views](#views)
8286
- [Data Sources](#data-sources)
8387
- [Aggregation Pipeline](#aggregation-pipeline)
@@ -1231,35 +1235,113 @@ Prefetching is particularly useful when navigating through lists of objects. To
12311235

12321236
Right-click on a table column header to freeze columns from the left up to the clicked column in the data browser. When scrolling horizontally, the frozen columns remain visible while the other columns scroll underneath.
12331237

1234-
## Browse as User
1238+
### Browse as User
12351239

12361240
▶️ *Core > Browser > Browse*
12371241

12381242
This feature allows you to use the data browser as another user, respecting that user's data permissions. For example, you will only see records and fields the user has permission to see.
12391243

12401244
> ⚠️ Logging in as another user will trigger the same Cloud Triggers as if the user logged in themselves using any other login method. Logging in as another user requires to enter that user's password.
12411245
1242-
## Change Pointer Key
1246+
### Change Pointer Key
12431247

12441248
▶️ *Core > Browser > Edit > Change pointer key*
12451249

12461250
This feature allows you to change how a pointer is represented in the browser. By default, a pointer is represented by the `objectId` of the linked object. You can change this to any other column of the object class. For example, if class `Installation` has a field that contains a pointer to class `User`, the pointer will show the `objectId` of the user by default. You can change this to display the field `email` of the user, so that a pointer displays the user's email address instead.
12471251

1248-
### Limitations
1252+
#### Limitations
12491253

12501254
- This does not work for an array of pointers; the pointer will always display the `objectId`.
12511255
- System columns like `createdAt`, `updatedAt`, `ACL` cannot be set as pointer key.
12521256
- This feature uses browser storage; switching to a different browser resets the pointer key to `objectId`.
12531257

12541258
> ⚠️ For each custom pointer key in each row, a server request is triggered to resolve the custom pointer key. For example, if the browser shows a class with 50 rows and each row contains 3 custom pointer keys, a total of 150 separate server requests are triggered.
1255-
## CSV Export
1259+
1260+
### CSV Export
12561261

12571262
▶️ *Core > Browser > Export*
12581263

12591264
This feature will take either selected rows or all rows of an individual class and saves them to a CSV file, which is then downloaded. CSV headers are added to the top of the file matching the column names.
12601265

12611266
> ⚠️ There is currently a 10,000 row limit when exporting all data. If more than 10,000 rows are present in the class, the CSV file will only contain 10,000 rows.
12621267
1268+
## AI Agent
1269+
1270+
The Parse Dashboard includes an AI agent that can help manage your Parse Server data through natural language commands. The agent can perform operations like creating classes, adding data, querying records, and more.
1271+
1272+
> [!Caution]
1273+
> The AI agent has full access to your database using the master key. It can read, modify, and delete any data. This feature is highly recommended for development environments only. Always back up important data before using the AI agent.
1274+
1275+
### Configuration
1276+
1277+
To configure the AI agent for your dashboard, you need to add the `agent` configuration to your Parse Dashboard config:
1278+
1279+
```json
1280+
{
1281+
"apps": [
1282+
// ...
1283+
],
1284+
"agent": {
1285+
"models": [
1286+
{
1287+
"name": "ChatGPT 4.1",
1288+
"provider": "openai",
1289+
"model": "gpt-4.1",
1290+
"apiKey": "YOUR_OPENAI_API_KEY"
1291+
},
1292+
]
1293+
}
1294+
}
1295+
```
1296+
1297+
| Parameter | Type | Required | Description |
1298+
|-----------------------------|--------|----------|--------------------------------------------------------------------------------|
1299+
| `agent` | Object | Yes | The AI agent configuration object. |
1300+
| `agent.models` | Array | Yes | Array of AI model configurations available to the agent. |
1301+
| `agent.models[*].name` | String | Yes | The display name for the model (e.g., `ChatGPT 4.1`). |
1302+
| `agent.models[*].provider` | String | Yes | The AI provider identifier (e.g., "openai"). |
1303+
| `agent.models[*].model` | String | Yes | The specific model name from the provider (e.g., `gpt-4.1`). |
1304+
| `agent.models[*].apiKey` | String | Yes | The API key for authenticating with the AI provider. |
1305+
1306+
The agent will use the configured models to process natural language commands and perform database operations using the master key from your app configuration.
1307+
1308+
### Providers
1309+
1310+
> [!Note]
1311+
> Currently, only OpenAI models are supported. Support for additional providers may be added in future releases.
1312+
1313+
#### OpenAI
1314+
1315+
To get an OpenAI API key for use with the AI agent:
1316+
1317+
1. **Create an OpenAI account**: Visit [platform.openai.com](https://platform.openai.com) and sign up for an account if you don't already have one.
1318+
1319+
2. **Access the API section**: Once logged in, navigate to the API section of your OpenAI dashboard.
1320+
1321+
3. **Create a new project**:
1322+
- Go to the "Projects" section
1323+
- Click "Create project"
1324+
- Name your project "Parse-Dashboard" (or any descriptive name)
1325+
- Complete the project setup
1326+
1327+
4. **Configure model access**:
1328+
- In your project, navigate to "Limits > Model Usage"
1329+
- Select the AI models you want to use (e.g., `gpt-4`, `gpt-3.5-turbo`)
1330+
- These model names will be used as the `agent.models[*].model` parameter in your dashboard configuration
1331+
1332+
5. **Generate an API key**:
1333+
- Go to the "API Keys" page in your project settings
1334+
- Click "Create new secret key"
1335+
- Give your key a descriptive name (e.g., "Parse Dashboard Agent")
1336+
- Copy the generated API key immediately (you won't be able to see it again)
1337+
1338+
6. **Set up billing**: Make sure you have a valid payment method added to your OpenAI account, as API usage incurs charges.
1339+
1340+
7. **Configure the dashboard**: Add the API key to your Parse Dashboard configuration as shown in the example above.
1341+
1342+
> [!Important]
1343+
> Keep your API key secure and never commit it to version control. Consider using environment variables or secure configuration management for production deployments.
1344+
12631345
## Views
12641346

12651347
▶️ *Core > Views*

package-lock.json

Lines changed: 101 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
"immutable-devtools": "0.1.5",
5454
"inquirer": "12.6.3",
5555
"js-beautify": "1.15.4",
56+
"node-fetch": "3.3.2",
5657
"otpauth": "8.0.3",
5758
"package-json": "7.0.0",
5859
"parse": "3.5.1",

src/components/EmptyState/EmptyState.react.js

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,18 +41,27 @@ const EmptyState = ({
4141
action = () => {},
4242
secondaryCta = '',
4343
secondaryAction = () => {},
44-
}) => (
45-
<div className={baseStyles.center}>
46-
<div className={styles.icon}>
47-
<Icon width={80} height={80} fill="#343445" name={icon} />
44+
customContent = null,
45+
useFlexLayout = false,
46+
}) => {
47+
const containerClass = useFlexLayout ? styles.flexContainer : baseStyles.center;
48+
49+
return (
50+
<div className={containerClass}>
51+
<div className={styles.content}>
52+
<div className={styles.icon}>
53+
<Icon width={80} height={80} fill="#343445" name={icon} />
54+
</div>
55+
<div className={styles.title}>{title}</div>
56+
<div className={styles.description}>{description}</div>
57+
{ctaButton(cta, action)}
58+
{secondaryCta && ' '}
59+
{ctaButton(secondaryCta, secondaryAction)}
60+
</div>
61+
{customContent && <div className={styles.customContent}>{customContent}</div>}
4862
</div>
49-
<div className={styles.title}>{title}</div>
50-
<div className={styles.description}>{description}</div>
51-
{ctaButton(cta, action)}
52-
{secondaryCta && ' '}
53-
{ctaButton(secondaryCta, secondaryAction)}
54-
</div>
55-
);
63+
);
64+
};
5665

5766
EmptyState.propTypes = {
5867
icon: PropTypes.string.describe('The name of the large icon that appears in the empty state.'),
@@ -72,6 +81,8 @@ EmptyState.propTypes = {
7281
secondaryAction: PropTypes.oneOfType([PropTypes.string, PropTypes.func]).describe(
7382
'An href link or a click handler that is forwarded to the secondary CTA button.'
7483
),
84+
customContent: PropTypes.node.describe('Custom content to render below the empty state.'),
85+
useFlexLayout: PropTypes.bool.describe('Whether to use flex layout instead of absolute positioning.'),
7586
};
7687

7788
export default EmptyState;

0 commit comments

Comments
 (0)