|
| 1 | +# Omnigent |
| 2 | + |
| 3 | +<!-- AUTO-GENERATED: stability-banner-start --> |
| 4 | +:::warning Beta plugin |
| 5 | +This plugin is currently **beta**. APIs may change between minor releases. Import from `@databricks/appkit/beta`. See [Plugin Stability Tiers](./stability.md). |
| 6 | +::: |
| 7 | +<!-- AUTO-GENERATED: stability-banner-end --> |
| 8 | + |
| 9 | +The `omnigent` plugin gives your app's users [Omnigent](https://docs.databricks.com/aws/en/omnigent/) agent sessions: Claude Agent SDK, Pi and OpenAI Agents SDK, on the workspace's managed Omnigent. |
| 10 | + |
| 11 | +- **Sessions belong to the signed-in user.** Every call carries the user's token, so a session is theirs, appears in `<workspace>/omnigent`, and is private to them until they share it. |
| 12 | +- **Each session runs on a Databricks Sandbox**, so agent-written code runs in an isolated, Databricks-managed box with the user's own permissions. |
| 13 | +- **Model calls go through Unity Gateway**, with its governance, limits and usage tracking. |
| 14 | + |
| 15 | +Omnigent owns the agent loop: sessions, history, approvals. Use the [`agents`](./agents.md) plugin when you want AppKit to own the loop against one serving endpoint. Use `omnigent` when you want the harnesses themselves. |
| 16 | + |
| 17 | +## Install |
| 18 | + |
| 19 | +```ts |
| 20 | +import { createApp, server } from "@databricks/appkit"; |
| 21 | +import { omnigent } from "@databricks/appkit/beta"; |
| 22 | + |
| 23 | +await createApp({ |
| 24 | + plugins: [ |
| 25 | + server(), |
| 26 | + omnigent({ instructions: "You help the team explore order data." }), |
| 27 | + ], |
| 28 | +}); |
| 29 | +``` |
| 30 | + |
| 31 | +## Workspace setup |
| 32 | + |
| 33 | +- **Previews.** Enable the **Omnigent** and **Databricks Sandbox** previews in the workspace. Omnigent needs a region that supports Unity Gateway; Sandbox hosts are in select AWS regions. |
| 34 | +- **The `all-apis` scope on the app.** Managed Omnigent only accepts tokens with the `all-apis` scope, which an app's user authorization cannot request itself. An account admin adds it to the app's OAuth integration once, keeping the app's existing scopes: |
| 35 | + |
| 36 | + ```bash |
| 37 | + databricks apps get <app-name> -o json # oauth2_app_integration_id, effective_user_api_scopes |
| 38 | + databricks account custom-app-integration update <oauth2_app_integration_id> \ |
| 39 | + --json '{"scopes": ["<existing scopes>", "all-apis"]}' |
| 40 | + ``` |
| 41 | + |
| 42 | + The update replaces the whole scope list. New scopes can take up to an hour to reach users' tokens. A bundle deploy, or a change to the app's user API scopes, sets the scopes back to the declared list, so repeat the update after either. |
| 43 | + |
| 44 | +`GET /api/omnigent/status` reports whether the user can reach managed Omnigent, and why not. |
| 45 | + |
| 46 | +## Configuration |
| 47 | + |
| 48 | +| Option | Default | | |
| 49 | +|---|---|---| |
| 50 | +| `instructions` | a generic assistant prompt | System instructions for every session | |
| 51 | +| `harnesses` | `claude-sdk`, `pi`, `openai-agents` | Harnesses users may pick | |
| 52 | +| `defaultHarness`, `defaultModel` | first available | | |
| 53 | + |
| 54 | +Each harness is offered the Unity Gateway `system.ai` models whose API it speaks: Claude Agent SDK the Anthropic Messages API, Pi the Codex Responses API, OpenAI Agents SDK the OpenAI Responses API. |
| 55 | + |
| 56 | +## Routes |
| 57 | + |
| 58 | +All routes are under `/api/omnigent` and act as the signed-in user. Sessions are limited to the ones this app created. |
| 59 | + |
| 60 | +| Route | | |
| 61 | +|---|---| |
| 62 | +| `GET /status` | Whether managed Omnigent and Sandbox hosts are usable | |
| 63 | +| `GET /harnesses` | Harnesses available to the user, each with the models it can drive | |
| 64 | +| `GET /sessions`, `POST /sessions` | List, create (`harness`, `model`, `message`, `title`) | |
| 65 | +| `GET /sessions/:id`, `DELETE /sessions/:id` | Snapshot (items, status), delete | |
| 66 | +| `POST /sessions/:id/messages` | `{ "text": "..." }` | |
| 67 | +| `GET /sessions/:id/stream` | Server-sent events (Omnigent's session stream, which replays from `Last-Event-ID`) | |
| 68 | +| `POST /sessions/:id/interrupt` | Stop the current turn | |
| 69 | + |
| 70 | +Creating a session returns once its Sandbox host is up, about 30 seconds on a cold start. |
| 71 | + |
| 72 | +## Local development |
| 73 | + |
| 74 | +With `NODE_ENV=development` and no forwarded token, the plugin calls Omnigent as the developer, with the token of the app's local Databricks CLI profile. |
| 75 | + |
| 76 | +## Limits |
| 77 | + |
| 78 | +- **Beta, in Omnigent's regions.** The plugin needs the workspace's managed Omnigent; it does not run Omnigent itself. |
| 79 | +- **Only gateway harnesses.** Harnesses that sign in with their vendor (Cursor, Copilot, Gemini and others) are not offered. Codex is not offered yet: on a Sandbox host, its brokered sign-in rejects the Codex CLI version the Sandbox ships. |
| 80 | +- **Broad app scope.** The `all-apis` scope lets the app call any API the user can, on the user's behalf. |
0 commit comments