Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions apps/agent-app/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Databricks workspace (auto-injected by platform on deploy)
DATABRICKS_HOST=https://e2-dogfood.staging.cloud.databricks.com

# Agent LLM endpoint
DATABRICKS_AGENT_ENDPOINT=databricks-claude-sonnet-4-5

# Analytics plugin — SQL warehouse ID
DATABRICKS_WAREHOUSE_ID=dd43ee29fedd958d

# Files plugin — Volume path
DATABRICKS_VOLUME_FILES=/Volumes/main/mario/mario-vol
3 changes: 3 additions & 0 deletions apps/agent-app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
.env
8 changes: 8 additions & 0 deletions apps/agent-app/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
command: ['node', '--import', 'tsx', 'server.ts']
env:
- name: DATABRICKS_WAREHOUSE_ID
valueFrom: sql-warehouse
- name: DATABRICKS_AGENT_ENDPOINT
valueFrom: serving-endpoint
- name: DATABRICKS_VOLUME_FILES
valueFrom: volume
50 changes: 50 additions & 0 deletions apps/agent-app/databricks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
bundle:
name: appkit-agent-app

variables:
sql_warehouse_id:
description: SQL Warehouse ID for analytics queries
serving_endpoint_name:
description: Model Serving endpoint name for the agent LLM
volume_full_name:
description: "UC Volume full name (e.g. catalog.schema.volume_name)"

resources:
apps:
agent_app:
name: "appkit-agent-app"
description: "AppKit agent with auto-discovered tools from analytics, files, and genie plugins"
source_code_path: ./

user_api_scopes:
- sql
- files.files
- dashboards.genie

resources:
- name: sql-warehouse
sql_warehouse:
id: ${var.sql_warehouse_id}
permission: CAN_USE

- name: serving-endpoint
serving_endpoint:
name: ${var.serving_endpoint_name}
permission: CAN_QUERY

- name: volume
uc_securable:
securable_type: VOLUME
securable_full_name: ${var.volume_full_name}
permission: WRITE_VOLUME

targets:
dogfood:
default: true
workspace:
host: https://e2-dogfood.staging.cloud.databricks.com

variables:
sql_warehouse_id: dd43ee29fedd958d
serving_endpoint_name: databricks-claude-sonnet-4-5
volume_full_name: main.mario.mario-vol
12 changes: 12 additions & 0 deletions apps/agent-app/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>AppKit Agent</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
40 changes: 40 additions & 0 deletions apps/agent-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "agent-app",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "NODE_ENV=development tsx watch server.ts",
"build": "tsc -b && vite build",
"preview": "vite preview"
},
"dependencies": {
"@databricks/appkit": "workspace:*",
"@databricks/appkit-ui": "workspace:*",
"@databricks/sdk-experimental": "^0.16.0",
"dotenv": "^16.6.1",
"lucide-react": "^0.511.0",
"react": "19.2.0",
"react-dom": "19.2.0",
"marked": "^15.0.0",
"zod": "^3.25.67"
},
"devDependencies": {
"@tailwindcss/postcss": "4.1.17",
"@types/node": "24.10.1",
"@types/react": "19.2.7",
"@types/react-dom": "19.2.3",
"@vitejs/plugin-react": "5.1.1",
"autoprefixer": "10.4.21",
"postcss": "8.5.6",
"tailwindcss": "4.1.17",
"tailwindcss-animate": "1.0.7",
"tw-animate-css": "1.4.0",
"tsx": "4.20.6",
"typescript": "5.9.3",
"vite": "npm:rolldown-vite@7.1.14"
},
"overrides": {
"vite": "npm:rolldown-vite@7.1.14"
}
}
6 changes: 6 additions & 0 deletions apps/agent-app/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
"@tailwindcss/postcss": {},
autoprefixer: {},
},
};
68 changes: 68 additions & 0 deletions apps/agent-app/server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { analytics, createAgent, files } from "@databricks/appkit";
import { DatabricksAdapter } from "@databricks/appkit/agents/databricks";
import { WorkspaceClient } from "@databricks/sdk-experimental";

const endpointName =
process.env.DATABRICKS_AGENT_ENDPOINT ?? "databricks-claude-sonnet-4-5";
const port = Number(process.env.DATABRICKS_APP_PORT) || 8003;

createAgent({
plugins: [analytics(), files()],
tools: [
{
type: "function",
name: "get_weather",
description: "Get the current weather for a city",
parameters: {
type: "object",
properties: {
city: { type: "string", description: "City name" },
},
required: ["city"],
},
execute: async ({ city }) => {
return `The weather in ${city} is sunny, 22°C`;
},
},
{
type: "custom_mcp_server",
custom_mcp_server: {
app_name: "mario-mcp-hello",
app_url:
"https://mario-mcp-hello-6051921418418893.staging.aws.databricksapps.com/mcp",
},
},
{
type: "custom_mcp_server",
custom_mcp_server: {
app_name: "vector-search",
app_url:
"https://e2-dogfood.staging.cloud.databricks.com/api/2.0/mcp/vector-search/main/default",
},
},
{
type: "custom_mcp_server",
custom_mcp_server: {
app_name: "uc-greet",
app_url:
"https://e2-dogfood.staging.cloud.databricks.com/api/2.0/mcp/functions/main/mario/greet",
},
},
],
adapter: DatabricksAdapter.fromServingEndpoint({
workspaceClient: new WorkspaceClient({}),
endpointName,
systemPrompt: [
"You are a helpful data assistant running on Databricks.",
"Use the available tools to query data, browse files, and help users with their analysis.",
"When using analytics.query, write Databricks SQL.",
"When results are large, summarize the key findings rather than dumping raw data.",
"You also have access to additional tools from MCP servers — use them when relevant.",
].join(" "),
}),
port,
}).then((agent) => {
console.log(
`Agent running on port ${port} with ${agent.getTools().length} tools`,
);
});
Loading