dexto 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/agents/agent-registry.json +53 -0
- package/agents/database-agent/README.md +35 -0
- package/agents/database-agent/data/example.db +0 -0
- package/agents/database-agent/database-agent-example.sql +98 -0
- package/agents/database-agent/database-agent.yml +116 -0
- package/agents/database-agent/setup-database.sh +64 -0
- package/agents/{agent.yml → default-agent.yml} +1 -1
- package/agents/image-editor-agent/Lenna.webp +0 -0
- package/agents/image-editor-agent/README.md +435 -0
- package/agents/image-editor-agent/image-editor-agent.yml +45 -0
- package/agents/music-agent/README.md +294 -0
- package/agents/music-agent/music-agent.yml +43 -0
- package/agents/product-name-researcher/README.md +98 -0
- package/agents/product-name-researcher/product-name-researcher.yml +161 -0
- package/agents/talk2pdf-agent/README.md +166 -0
- package/agents/talk2pdf-agent/talk2pdf-agent.yml +42 -0
- package/agents/triage-demo/README.md +337 -0
- package/agents/triage-demo/billing-agent.yml +76 -0
- package/agents/triage-demo/docs/billing-policies.md +246 -0
- package/agents/triage-demo/docs/company-overview.md +94 -0
- package/agents/triage-demo/docs/escalation-policies.md +301 -0
- package/agents/triage-demo/docs/product-features.md +253 -0
- package/agents/triage-demo/docs/technical-documentation.md +226 -0
- package/agents/triage-demo/escalation-agent.yml +82 -0
- package/agents/triage-demo/product-info-agent.yml +86 -0
- package/agents/triage-demo/technical-support-agent.yml +71 -0
- package/agents/triage-demo/test-scenarios.md +209 -0
- package/agents/triage-demo/triage-agent.yml +172 -0
- package/dist/src/app/chunk-CLDYRNV6.js +10139 -0
- package/dist/src/app/chunk-DYNVXGAH.js +137 -0
- package/dist/src/app/chunk-PW2PHCHR.js +83 -0
- package/dist/src/app/chunk-R4Q522DR.js +205 -0
- package/dist/src/app/chunk-UXCBS3TR.js +281 -0
- package/dist/src/app/chunk-X6LEX724.js +108 -0
- package/dist/src/app/chunk-Y33BS5SA.js +39 -0
- package/dist/src/app/{cli-confirmation-handler-EZF6AMUS.js → cli-confirmation-handler-GJHPLGOL.js} +4 -1
- package/dist/src/app/errors-5MNETGOV.js +8 -0
- package/dist/src/app/index.js +1604 -8978
- package/dist/src/app/loader-EFMKWNNQ.js +20 -0
- package/dist/src/app/path-7FT4SZMO.js +23 -0
- package/dist/src/app/{postgres-backend-7HVVW3RL.js → postgres-backend-U5MIIMUY.js} +12 -1
- package/dist/src/app/{redis-backend-2YBZSSSV.js → redis-backend-NGI67ILT.js} +38 -9
- package/dist/src/app/registry-RALMVM3P.js +14 -0
- package/dist/src/app/sqlite-backend-752UUBD4.js +245 -0
- package/dist/src/app/webui/.next/standalone/.next/BUILD_ID +1 -1
- package/dist/src/app/webui/.next/standalone/.next/app-build-manifest.json +20 -21
- package/dist/src/app/webui/.next/standalone/.next/app-path-routes-manifest.json +0 -1
- package/dist/src/app/webui/.next/standalone/.next/build-manifest.json +4 -4
- package/dist/src/app/webui/.next/standalone/.next/prerender-manifest.json +4 -82
- package/dist/src/app/webui/.next/standalone/.next/required-server-files.json +2 -3
- package/dist/src/app/webui/.next/standalone/.next/routes-manifest.json +0 -6
- package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found/page.js +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/page.js +7 -3
- package/dist/src/app/webui/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/playground/page.js +8 -8
- package/dist/src/app/webui/.next/standalone/.next/server/app/playground/page.js.nft.json +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/playground/page_client-reference-manifest.js +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app-paths-manifest.json +0 -1
- package/dist/src/app/webui/.next/standalone/.next/server/chunks/176.js +1 -0
- package/dist/src/app/webui/.next/standalone/.next/server/chunks/195.js +24 -0
- package/dist/src/app/webui/.next/standalone/.next/server/chunks/620.js +1 -0
- package/dist/src/app/webui/.next/standalone/.next/server/chunks/80.js +5 -0
- package/dist/src/app/webui/.next/standalone/.next/server/middleware-build-manifest.js +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/pages/500.html +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/pages-manifest.json +1 -2
- package/dist/src/app/webui/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/dist/src/app/webui/.next/standalone/.next/server/webpack-runtime.js +1 -1
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/190-b897ef36fde616bf.js +1 -0
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/487-a77054bd2c64c79c.js +1 -0
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/588-dbe47a44489742dd.js +1 -0
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/62-35030b5cb176bd7b.js +1 -0
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/app/layout-91c0cb9eb1ee327a.js +1 -0
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/app/page-3279aaf14db87f45.js +1 -0
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/app/playground/page-200aad53af9ca53f.js +1 -0
- package/dist/src/app/webui/.next/standalone/.next/static/css/af71306827be150e.css +3 -0
- package/dist/src/app/webui/.next/standalone/.next/static/tpCURR82LyyGfdALJ4Qvl/_buildManifest.js +1 -0
- package/dist/src/app/webui/.next/standalone/package.json +4 -3
- package/dist/src/app/webui/.next/standalone/public/favicon2.ico +0 -0
- package/dist/src/app/webui/.next/standalone/public/logo.svg +1 -0
- package/dist/src/app/webui/.next/standalone/public/logo_no_text.png +0 -0
- package/dist/src/app/webui/.next/standalone/server.js +1 -1
- package/dist/src/app/webui/.next/static/chunks/190-b897ef36fde616bf.js +1 -0
- package/dist/src/app/webui/.next/static/chunks/487-a77054bd2c64c79c.js +1 -0
- package/dist/src/app/webui/.next/static/chunks/588-dbe47a44489742dd.js +1 -0
- package/dist/src/app/webui/.next/static/chunks/62-35030b5cb176bd7b.js +1 -0
- package/dist/src/app/webui/.next/static/chunks/app/layout-91c0cb9eb1ee327a.js +1 -0
- package/dist/src/app/webui/.next/static/chunks/app/page-3279aaf14db87f45.js +1 -0
- package/dist/src/app/webui/.next/static/chunks/app/playground/page-200aad53af9ca53f.js +1 -0
- package/dist/src/app/webui/.next/static/css/af71306827be150e.css +3 -0
- package/dist/src/app/webui/.next/static/tpCURR82LyyGfdALJ4Qvl/_buildManifest.js +1 -0
- package/dist/src/app/webui/package.json +4 -3
- package/dist/src/app/webui/public/favicon2.ico +0 -0
- package/dist/src/app/webui/public/logo.svg +1 -0
- package/dist/src/app/webui/public/logo_no_text.png +0 -0
- package/dist/src/core/chunk-7A6NQKQ3.js +193 -0
- package/dist/src/core/chunk-CZIXQNMZ.js +12191 -0
- package/dist/src/core/index.cjs +10605 -8030
- package/dist/src/core/index.d.cts +4339 -3927
- package/dist/src/core/index.d.ts +4339 -3927
- package/dist/src/core/index.js +113 -8381
- package/dist/src/core/{postgres-backend-ERZ6DP76.js → postgres-backend-LOLKTD2T.js} +9 -2
- package/dist/src/core/{redis-backend-46O7Y44C.js → redis-backend-APZ576PJ.js} +35 -10
- package/dist/src/core/sqlite-backend-KQ75DPR7.js +245 -0
- package/package.json +18 -11
- package/dist/src/app/chunk-W7G44EAE.js +0 -463
- package/dist/src/app/sqlite-backend-VRXGIKHQ.js +0 -180
- package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found.html +0 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found.meta +0 -8
- package/dist/src/app/webui/.next/standalone/.next/server/app/_not-found.rsc +0 -21
- package/dist/src/app/webui/.next/standalone/.next/server/app/favicon.ico/route.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/favicon.ico/route.js.nft.json +0 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/favicon.ico.body +0 -0
- package/dist/src/app/webui/.next/standalone/.next/server/app/favicon.ico.meta +0 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/index.html +0 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/index.meta +0 -7
- package/dist/src/app/webui/.next/standalone/.next/server/app/index.rsc +0 -22
- package/dist/src/app/webui/.next/standalone/.next/server/app/playground.html +0 -1
- package/dist/src/app/webui/.next/standalone/.next/server/app/playground.meta +0 -7
- package/dist/src/app/webui/.next/standalone/.next/server/app/playground.rsc +0 -25
- package/dist/src/app/webui/.next/standalone/.next/server/chunks/447.js +0 -20
- package/dist/src/app/webui/.next/standalone/.next/server/chunks/504.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/server/chunks/54.js +0 -5
- package/dist/src/app/webui/.next/standalone/.next/server/chunks/624.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/server/chunks/985.js +0 -5
- package/dist/src/app/webui/.next/standalone/.next/server/pages/404.html +0 -1
- package/dist/src/app/webui/.next/standalone/.next/static/L4341-2-iEIknMYuTWeoz/_buildManifest.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/125-9b34ec01f112cdb2.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/487-c6ea8b63ca68db1c.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/588-20dc7f3a8664c387.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/687-3e614f30982093f6.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/879-cf875984faa0b72f.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/app/layout-ed56660b7ecaf47b.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/app/page-b05580de36ce0e36.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/static/chunks/app/playground/page-ac5443cddbe824aa.js +0 -1
- package/dist/src/app/webui/.next/standalone/.next/static/css/d44f09bc2605dc76.css +0 -3
- package/dist/src/app/webui/.next/standalone/node_modules/next/dist/compiled/next-server/app-route.runtime.prod.js +0 -19
- package/dist/src/app/webui/.next/standalone/public/favicon.svg +0 -26
- package/dist/src/app/webui/.next/standalone/public/logo.png +0 -0
- package/dist/src/app/webui/.next/static/L4341-2-iEIknMYuTWeoz/_buildManifest.js +0 -1
- package/dist/src/app/webui/.next/static/chunks/125-9b34ec01f112cdb2.js +0 -1
- package/dist/src/app/webui/.next/static/chunks/487-c6ea8b63ca68db1c.js +0 -1
- package/dist/src/app/webui/.next/static/chunks/588-20dc7f3a8664c387.js +0 -1
- package/dist/src/app/webui/.next/static/chunks/687-3e614f30982093f6.js +0 -1
- package/dist/src/app/webui/.next/static/chunks/879-cf875984faa0b72f.js +0 -1
- package/dist/src/app/webui/.next/static/chunks/app/layout-ed56660b7ecaf47b.js +0 -1
- package/dist/src/app/webui/.next/static/chunks/app/page-b05580de36ce0e36.js +0 -1
- package/dist/src/app/webui/.next/static/chunks/app/playground/page-ac5443cddbe824aa.js +0 -1
- package/dist/src/app/webui/.next/static/css/d44f09bc2605dc76.css +0 -3
- package/dist/src/app/webui/public/favicon.svg +0 -26
- package/dist/src/app/webui/public/logo.png +0 -0
- package/dist/src/core/chunk-6VYPSHEV.js +0 -2153
- package/dist/src/core/chunk-BYHW25EA.js +0 -41
- package/dist/src/core/sqlite-backend-M2ZPSSIZ.js +0 -184
- /package/dist/src/app/webui/.next/standalone/.next/static/chunks/{4bd1b696-2df85d4b3b58aed5.js → 4bd1b696-c95fa02060335229.js} +0 -0
- /package/dist/src/app/webui/.next/standalone/.next/static/chunks/{684-058c08971e023037.js → 684-2e7175657246b549.js} +0 -0
- /package/dist/src/app/webui/.next/standalone/.next/static/chunks/app/_not-found/{page-7b137d85f9de4771.js → page-b63df5a8d3225455.js} +0 -0
- /package/dist/src/app/webui/.next/standalone/.next/static/{L4341-2-iEIknMYuTWeoz → tpCURR82LyyGfdALJ4Qvl}/_ssgManifest.js +0 -0
- /package/dist/src/app/webui/.next/static/chunks/{4bd1b696-2df85d4b3b58aed5.js → 4bd1b696-c95fa02060335229.js} +0 -0
- /package/dist/src/app/webui/.next/static/chunks/{684-058c08971e023037.js → 684-2e7175657246b549.js} +0 -0
- /package/dist/src/app/webui/.next/static/chunks/app/_not-found/{page-7b137d85f9de4771.js → page-b63df5a8d3225455.js} +0 -0
- /package/dist/src/app/webui/.next/static/{L4341-2-iEIknMYuTWeoz → tpCURR82LyyGfdALJ4Qvl}/_ssgManifest.js +0 -0
package/README.md
CHANGED
|
@@ -115,7 +115,7 @@ The `DextoAgent` class is the core of the runtime. The following example shows i
|
|
|
115
115
|
import 'dotenv/config';
|
|
116
116
|
import { DextoAgent, loadConfigFile } from 'dexto';
|
|
117
117
|
|
|
118
|
-
const cfg = await loadConfigFile('./agents/agent.yml');
|
|
118
|
+
const cfg = await loadConfigFile('./agents/default-agent.yml');
|
|
119
119
|
const agent = new DextoAgent(cfg);
|
|
120
120
|
|
|
121
121
|
await agent.start();
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.0.0",
|
|
3
|
+
"agents": {
|
|
4
|
+
"database-agent": {
|
|
5
|
+
"description": "AI agent for database operations and SQL queries",
|
|
6
|
+
"author": "Truffle AI",
|
|
7
|
+
"tags": ["database", "sql", "data", "queries"],
|
|
8
|
+
"source": "database-agent/",
|
|
9
|
+
"main": "database-agent.yml"
|
|
10
|
+
},
|
|
11
|
+
"talk2pdf-agent": {
|
|
12
|
+
"description": "PDF document analysis and conversation",
|
|
13
|
+
"author": "Truffle AI",
|
|
14
|
+
"tags": ["pdf", "documents", "analysis", "conversation"],
|
|
15
|
+
"source": "talk2pdf-agent/",
|
|
16
|
+
"main": "talk2pdf-agent.yml"
|
|
17
|
+
},
|
|
18
|
+
"image-editor-agent": {
|
|
19
|
+
"description": "AI agent for image editing and manipulation",
|
|
20
|
+
"author": "Truffle AI",
|
|
21
|
+
"tags": ["images", "editing", "graphics", "visual"],
|
|
22
|
+
"source": "image-editor-agent/",
|
|
23
|
+
"main": "image-editor-agent.yml"
|
|
24
|
+
},
|
|
25
|
+
"music-agent": {
|
|
26
|
+
"description": "AI agent for music creation and audio processing",
|
|
27
|
+
"author": "Truffle AI",
|
|
28
|
+
"tags": ["music", "audio", "creation", "sound"],
|
|
29
|
+
"source": "music-agent/",
|
|
30
|
+
"main": "music-agent.yml"
|
|
31
|
+
},
|
|
32
|
+
"product-researcher": {
|
|
33
|
+
"description": "AI agent for product name research and branding",
|
|
34
|
+
"author": "Truffle AI",
|
|
35
|
+
"tags": ["product", "research", "branding", "naming"],
|
|
36
|
+
"source": "product-name-researcher/",
|
|
37
|
+
"main": "product-name-researcher.yml"
|
|
38
|
+
},
|
|
39
|
+
"triage-agent": {
|
|
40
|
+
"description": "Customer support triage system",
|
|
41
|
+
"author": "Truffle AI",
|
|
42
|
+
"tags": ["support", "triage", "routing", "multi-agent"],
|
|
43
|
+
"source": "triage-demo/",
|
|
44
|
+
"main": "triage-agent.yml"
|
|
45
|
+
},
|
|
46
|
+
"default-agent": {
|
|
47
|
+
"description": "Default Dexto agent with filesystem and puppeteer tools",
|
|
48
|
+
"author": "Truffle AI",
|
|
49
|
+
"tags": ["default", "filesystem", "puppeteer"],
|
|
50
|
+
"source": "default-agent.yml"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Database Agent
|
|
2
|
+
|
|
3
|
+
An AI agent that provides natural language access to database operations and analytics. This approach changes how we interact with data - instead of learning SQL syntax, building query interfaces, or designing complex dashboards, users can simply ask for what they need in natural language.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
cd database-agent
|
|
9
|
+
./setup-database.sh
|
|
10
|
+
npm start -- --agent database-agent.yml
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Example Interactions
|
|
14
|
+
|
|
15
|
+
- "Show me all users"
|
|
16
|
+
- "Create a new user named John Doe with email john@example.com"
|
|
17
|
+
- "Find products under $100"
|
|
18
|
+
- "Generate a sales report by category"
|
|
19
|
+
|
|
20
|
+
## Capabilities
|
|
21
|
+
|
|
22
|
+
- **Data Queries**: Natural language database queries and reporting
|
|
23
|
+
- **Data Management**: Create, update, and delete records
|
|
24
|
+
- **Analytics**: Generate insights and business intelligence
|
|
25
|
+
- **Schema Operations**: Table creation and database structure management
|
|
26
|
+
|
|
27
|
+
## How It Works
|
|
28
|
+
|
|
29
|
+
The agent connects to a SQLite database via MCP server and:
|
|
30
|
+
- Interprets natural language requests into SQL queries
|
|
31
|
+
- Validates data before operations
|
|
32
|
+
- Provides formatted results and insights
|
|
33
|
+
- Handles errors gracefully with helpful suggestions
|
|
34
|
+
|
|
35
|
+
This agent demonstrates intelligent database interaction through conversation.
|
|
Binary file
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
-- Sample database schema and data for the Database Interaction Agent
|
|
2
|
+
-- This demonstrates the types of operations the agent can perform
|
|
3
|
+
|
|
4
|
+
-- Create users table
|
|
5
|
+
CREATE TABLE IF NOT EXISTS users (
|
|
6
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
7
|
+
name TEXT NOT NULL,
|
|
8
|
+
email TEXT UNIQUE NOT NULL,
|
|
9
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
10
|
+
last_login DATETIME,
|
|
11
|
+
is_active BOOLEAN DEFAULT 1
|
|
12
|
+
);
|
|
13
|
+
|
|
14
|
+
-- Create products table
|
|
15
|
+
CREATE TABLE IF NOT EXISTS products (
|
|
16
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
17
|
+
name TEXT NOT NULL,
|
|
18
|
+
description TEXT,
|
|
19
|
+
price DECIMAL(10,2) NOT NULL,
|
|
20
|
+
category TEXT NOT NULL,
|
|
21
|
+
stock_quantity INTEGER DEFAULT 0,
|
|
22
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
-- Create orders table
|
|
26
|
+
CREATE TABLE IF NOT EXISTS orders (
|
|
27
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
28
|
+
user_id INTEGER NOT NULL,
|
|
29
|
+
total_amount DECIMAL(10,2) NOT NULL,
|
|
30
|
+
status TEXT DEFAULT 'pending',
|
|
31
|
+
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
|
|
32
|
+
FOREIGN KEY (user_id) REFERENCES users(id)
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
-- Create order_items table
|
|
36
|
+
CREATE TABLE IF NOT EXISTS order_items (
|
|
37
|
+
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
|
38
|
+
order_id INTEGER NOT NULL,
|
|
39
|
+
product_id INTEGER NOT NULL,
|
|
40
|
+
quantity INTEGER NOT NULL,
|
|
41
|
+
unit_price DECIMAL(10,2) NOT NULL,
|
|
42
|
+
FOREIGN KEY (order_id) REFERENCES orders(id),
|
|
43
|
+
FOREIGN KEY (product_id) REFERENCES products(id)
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
-- Insert sample users
|
|
47
|
+
INSERT INTO users (name, email) VALUES
|
|
48
|
+
('John Doe', 'john@example.com'),
|
|
49
|
+
('Jane Smith', 'jane@example.com'),
|
|
50
|
+
('Bob Johnson', 'bob@example.com'),
|
|
51
|
+
('Alice Brown', 'alice@example.com'),
|
|
52
|
+
('Charlie Wilson', 'charlie@example.com');
|
|
53
|
+
|
|
54
|
+
-- Insert sample products
|
|
55
|
+
INSERT INTO products (name, description, price, category, stock_quantity) VALUES
|
|
56
|
+
('Laptop', 'High-performance laptop for professionals', 899.99, 'Electronics', 15),
|
|
57
|
+
('Smartphone', 'Latest smartphone with advanced features', 699.99, 'Electronics', 25),
|
|
58
|
+
('Coffee Maker', 'Automatic coffee maker for home use', 89.99, 'Home & Kitchen', 30),
|
|
59
|
+
('Running Shoes', 'Comfortable running shoes for athletes', 129.99, 'Sports', 20),
|
|
60
|
+
('Backpack', 'Durable backpack for daily use', 49.99, 'Fashion', 40),
|
|
61
|
+
('Bluetooth Speaker', 'Portable wireless speaker', 79.99, 'Electronics', 18),
|
|
62
|
+
('Yoga Mat', 'Non-slip yoga mat for fitness', 29.99, 'Sports', 35),
|
|
63
|
+
('Desk Lamp', 'LED desk lamp with adjustable brightness', 39.99, 'Home & Kitchen', 22);
|
|
64
|
+
|
|
65
|
+
-- Insert sample orders
|
|
66
|
+
INSERT INTO orders (user_id, total_amount, status) VALUES
|
|
67
|
+
(1, 899.99, 'completed'),
|
|
68
|
+
(2, 209.98, 'completed'),
|
|
69
|
+
(3, 159.98, 'pending'),
|
|
70
|
+
(4, 699.99, 'completed'),
|
|
71
|
+
(5, 89.99, 'shipped');
|
|
72
|
+
|
|
73
|
+
-- Insert sample order items
|
|
74
|
+
INSERT INTO order_items (order_id, product_id, quantity, unit_price) VALUES
|
|
75
|
+
(1, 1, 1, 899.99), -- John bought a laptop
|
|
76
|
+
(2, 3, 1, 89.99), -- Jane bought a coffee maker
|
|
77
|
+
(2, 7, 1, 29.99), -- Jane also bought a yoga mat
|
|
78
|
+
(2, 8, 1, 39.99), -- Jane also bought a desk lamp
|
|
79
|
+
(3, 5, 1, 49.99), -- Bob bought a backpack
|
|
80
|
+
(3, 6, 1, 79.99), -- Bob also bought a bluetooth speaker
|
|
81
|
+
(3, 8, 1, 39.99), -- Bob also bought a desk lamp
|
|
82
|
+
(4, 2, 1, 699.99), -- Alice bought a smartphone
|
|
83
|
+
(5, 3, 1, 89.99); -- Charlie bought a coffee maker
|
|
84
|
+
|
|
85
|
+
-- Update some user last_login times
|
|
86
|
+
UPDATE users SET last_login = datetime('now', '-1 day') WHERE id = 1;
|
|
87
|
+
UPDATE users SET last_login = datetime('now', '-3 days') WHERE id = 2;
|
|
88
|
+
UPDATE users SET last_login = datetime('now', '-7 days') WHERE id = 3;
|
|
89
|
+
UPDATE users SET last_login = datetime('now', '-2 days') WHERE id = 4;
|
|
90
|
+
UPDATE users SET last_login = datetime('now', '-5 days') WHERE id = 5;
|
|
91
|
+
|
|
92
|
+
-- Create indexes for better performance
|
|
93
|
+
CREATE INDEX IF NOT EXISTS idx_users_email ON users(email);
|
|
94
|
+
CREATE INDEX IF NOT EXISTS idx_products_category ON products(category);
|
|
95
|
+
CREATE INDEX IF NOT EXISTS idx_orders_user_id ON orders(user_id);
|
|
96
|
+
CREATE INDEX IF NOT EXISTS idx_orders_status ON orders(status);
|
|
97
|
+
CREATE INDEX IF NOT EXISTS idx_order_items_order_id ON order_items(order_id);
|
|
98
|
+
CREATE INDEX IF NOT EXISTS idx_order_items_product_id ON order_items(product_id);
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Database Interaction Agent
|
|
2
|
+
# This agent demonstrates an alternative approach to building database interfaces
|
|
3
|
+
# Instead of traditional web UIs with forms and buttons, this agent provides
|
|
4
|
+
# natural language interaction with database operations through MCP tools
|
|
5
|
+
|
|
6
|
+
mcpServers:
|
|
7
|
+
# SQLite database server for direct database interaction
|
|
8
|
+
sqlite:
|
|
9
|
+
type: stdio
|
|
10
|
+
command: npx
|
|
11
|
+
args:
|
|
12
|
+
- -y
|
|
13
|
+
- "@executeautomation/database-server"
|
|
14
|
+
- "${{dexto.agent_dir}}/data/example.db"
|
|
15
|
+
timeout: 30000
|
|
16
|
+
connectionMode: strict
|
|
17
|
+
|
|
18
|
+
# Filesystem access for database file management and schema inspection
|
|
19
|
+
filesystem:
|
|
20
|
+
type: stdio
|
|
21
|
+
command: npx
|
|
22
|
+
args:
|
|
23
|
+
- -y
|
|
24
|
+
- "@modelcontextprotocol/server-filesystem"
|
|
25
|
+
- .
|
|
26
|
+
timeout: 30000
|
|
27
|
+
connectionMode: lenient
|
|
28
|
+
|
|
29
|
+
# System prompt that defines the agent's database interaction capabilities
|
|
30
|
+
systemPrompt:
|
|
31
|
+
contributors:
|
|
32
|
+
- id: primary
|
|
33
|
+
type: static
|
|
34
|
+
priority: 0
|
|
35
|
+
content: |
|
|
36
|
+
You are a Database Interaction Agent that provides natural language access to database operations
|
|
37
|
+
and analytics. You orchestrate database operations through intelligent conversation and tool usage.
|
|
38
|
+
|
|
39
|
+
## Your Core Capabilities
|
|
40
|
+
|
|
41
|
+
**Database Operations:**
|
|
42
|
+
- Execute SQL queries and return formatted results
|
|
43
|
+
- Create, modify, and drop database tables
|
|
44
|
+
- Insert, update, and delete records
|
|
45
|
+
- Analyze database schema and structure
|
|
46
|
+
- Generate reports and data insights
|
|
47
|
+
- Perform data validation and integrity checks
|
|
48
|
+
|
|
49
|
+
**Intelligent Orchestration:**
|
|
50
|
+
- Understand user intent from natural language
|
|
51
|
+
- Break down complex requests into sequential operations
|
|
52
|
+
- Validate data before operations
|
|
53
|
+
- Provide clear explanations of what you're doing
|
|
54
|
+
- Handle errors gracefully with helpful suggestions
|
|
55
|
+
|
|
56
|
+
**Intelligent Data Operations:**
|
|
57
|
+
- Natural conversation for data access
|
|
58
|
+
- Intelligent data handling and validation
|
|
59
|
+
- Context-aware operations and insights
|
|
60
|
+
- Flexible querying and reporting
|
|
61
|
+
|
|
62
|
+
## Interaction Patterns
|
|
63
|
+
|
|
64
|
+
**For Data Queries:**
|
|
65
|
+
1. Understand what the user wants to know
|
|
66
|
+
2. Formulate appropriate SQL queries
|
|
67
|
+
3. Execute and format results clearly
|
|
68
|
+
4. Provide insights or suggest follow-up questions
|
|
69
|
+
|
|
70
|
+
**For Data Modifications:**
|
|
71
|
+
1. Confirm the user's intent
|
|
72
|
+
2. Validate data integrity
|
|
73
|
+
3. Execute the operation safely
|
|
74
|
+
4. Confirm success and show results
|
|
75
|
+
|
|
76
|
+
**For Schema Operations:**
|
|
77
|
+
1. Analyze current structure
|
|
78
|
+
2. Plan the changes needed
|
|
79
|
+
3. Execute modifications
|
|
80
|
+
4. Verify the new structure
|
|
81
|
+
|
|
82
|
+
## Best Practices
|
|
83
|
+
|
|
84
|
+
- Always explain what you're doing before doing it
|
|
85
|
+
- Show sample data when creating tables
|
|
86
|
+
- Validate user input before database operations
|
|
87
|
+
- Provide helpful error messages and suggestions
|
|
88
|
+
- Use transactions for multi-step operations
|
|
89
|
+
- Keep responses concise but informative
|
|
90
|
+
|
|
91
|
+
## Example Interactions
|
|
92
|
+
|
|
93
|
+
User: "Create a users table with name, email, and created_at fields"
|
|
94
|
+
You: "I'll create a users table with the specified fields. Let me set this up for you..."
|
|
95
|
+
|
|
96
|
+
User: "Show me all users who signed up this month"
|
|
97
|
+
You: "I'll query the users table for recent signups. Let me get that information..."
|
|
98
|
+
|
|
99
|
+
User: "Add a new user named John Doe with email john@example.com"
|
|
100
|
+
You: "I'll insert a new user record for John Doe. Let me add that to the database..."
|
|
101
|
+
|
|
102
|
+
Remember: You're demonstrating intelligent database interaction through
|
|
103
|
+
natural conversation and data analysis.
|
|
104
|
+
|
|
105
|
+
- id: dateTime
|
|
106
|
+
type: dynamic
|
|
107
|
+
priority: 10
|
|
108
|
+
source: dateTime
|
|
109
|
+
enabled: true
|
|
110
|
+
|
|
111
|
+
# LLM configuration for intelligent database interactions
|
|
112
|
+
llm:
|
|
113
|
+
provider: openai
|
|
114
|
+
model: gpt-4o-mini
|
|
115
|
+
apiKey: $OPENAI_API_KEY
|
|
116
|
+
temperature: 0.1 # Lower temperature for more consistent database operations
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
# Exit immediately on errors, unset variables, or pipeline failures
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
# Get the directory where this script is located
|
|
7
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
8
|
+
|
|
9
|
+
# Setup script for Database Interaction Agent
|
|
10
|
+
# This script creates the data directory and initializes the database with sample data
|
|
11
|
+
|
|
12
|
+
echo "🚀 Setting up Database Interaction Agent..."
|
|
13
|
+
|
|
14
|
+
# Create data directory if it doesn't exist
|
|
15
|
+
echo "📁 Creating data directory..."
|
|
16
|
+
mkdir -p "${SCRIPT_DIR}/data"
|
|
17
|
+
|
|
18
|
+
# Check if SQLite is available
|
|
19
|
+
if ! command -v sqlite3 &> /dev/null; then
|
|
20
|
+
echo "❌ SQLite3 is not installed. Please install SQLite3 first:"
|
|
21
|
+
echo " macOS: brew install sqlite3"
|
|
22
|
+
echo " Ubuntu/Debian: sudo apt-get install sqlite3"
|
|
23
|
+
echo " Windows: Download from https://www.sqlite.org/download.html"
|
|
24
|
+
exit 1
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
# Initialize database with sample data
|
|
28
|
+
echo "🗄️ Initializing database with sample data..."
|
|
29
|
+
|
|
30
|
+
# Remove existing database if it exists to avoid constraint violations
|
|
31
|
+
if [ -f "${SCRIPT_DIR}/data/example.db" ]; then
|
|
32
|
+
echo "🗑️ Removing existing database..."
|
|
33
|
+
rm "${SCRIPT_DIR}/data/example.db"
|
|
34
|
+
fi
|
|
35
|
+
|
|
36
|
+
sqlite3 "${SCRIPT_DIR}/data/example.db" < "${SCRIPT_DIR}/database-agent-example.sql"
|
|
37
|
+
|
|
38
|
+
# Verify the database was created successfully
|
|
39
|
+
if [ -f "${SCRIPT_DIR}/data/example.db" ]; then
|
|
40
|
+
echo "✅ Database created successfully!"
|
|
41
|
+
|
|
42
|
+
# Show some basic stats
|
|
43
|
+
echo "📊 Database statistics:"
|
|
44
|
+
echo " Tables: $(sqlite3 "${SCRIPT_DIR}/data/example.db" "SELECT COUNT(*) FROM sqlite_master WHERE type='table';")"
|
|
45
|
+
echo " Users: $(sqlite3 "${SCRIPT_DIR}/data/example.db" "SELECT COUNT(*) FROM users;")"
|
|
46
|
+
echo " Products: $(sqlite3 "${SCRIPT_DIR}/data/example.db" "SELECT COUNT(*) FROM products;")"
|
|
47
|
+
echo " Orders: $(sqlite3 "${SCRIPT_DIR}/data/example.db" "SELECT COUNT(*) FROM orders;")"
|
|
48
|
+
|
|
49
|
+
echo ""
|
|
50
|
+
echo "🎉 Database setup complete!"
|
|
51
|
+
echo ""
|
|
52
|
+
echo "You can now run the Database Interaction Agent with:"
|
|
53
|
+
echo " dexto --agent agents/database-agent.yml"
|
|
54
|
+
echo ""
|
|
55
|
+
echo "Example interactions you can try:"
|
|
56
|
+
echo " - 'Show me all users'"
|
|
57
|
+
echo " - 'List products under \$100'"
|
|
58
|
+
echo " - 'Create a new user named Test User with email test@example.com'"
|
|
59
|
+
echo " - 'Show me total sales by category'"
|
|
60
|
+
echo " - 'Find users who haven't logged in for more than 5 days'"
|
|
61
|
+
else
|
|
62
|
+
echo "❌ Failed to create database. Please check the SQL file and try again."
|
|
63
|
+
exit 1
|
|
64
|
+
fi
|
|
@@ -54,7 +54,7 @@ systemPrompt:
|
|
|
54
54
|
# # describes the llm configuration
|
|
55
55
|
llm:
|
|
56
56
|
provider: openai
|
|
57
|
-
model: gpt-
|
|
57
|
+
model: gpt-5-mini
|
|
58
58
|
apiKey: $OPENAI_API_KEY
|
|
59
59
|
|
|
60
60
|
# Storage configuration - uses a two-tier architecture: cache (fast, ephemeral) and database (persistent, reliable)
|
|
Binary file
|