Skip to content

Commit cf97765

Browse files
xuyushun441-sysos-zhuangclaude
authored
docs: align AI guides + ADR-0040 with the ask/build two-agent model (ADR-0063/0064) (#2206)
Follow-up to #2194 — sweeps the remaining docs-site + ADR prose that still described the superseded ADR-0040 unified-assistant / custom-agent model: - guides/ai-capabilities.mdx: reframe the "AI Agents" section to the two surface-bound platform agents (`ask` OSS/free, `build` cloud/paid). State ADR-0063 §2 (you extend via skills, not agents — `*.agent.ts` is platform-internal, `allowRuntimeCreate:false`) and ADR-0064 (tools = union of surface-compatible skills' tools; `surface:'build'` inert on OSS). Add the `surface` field to the AgentSchema table; recontextualize the example `defineAgent()` blocks as anatomy, not a tenant-authoring tutorial. - guides/plugin-chatbot-integration.mdx: code examples use `ask`, not the legacy `data_chat` alias. - adr/0040: add a Superseded-by-ADR-0063 banner + Status line (body kept as the historical record). Generated schema refs (references/ai/agent.mdx, skill.mdx) already carry the `surface` field — build-docs.ts reruns with no diff. Docs-only. Refs #2168 Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent a210ed1 commit cf97765

3 files changed

Lines changed: 50 additions & 14 deletions

File tree

content/docs/guides/ai-capabilities.mdx

Lines changed: 45 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,27 +42,52 @@ ObjectStack provides a comprehensive AI platform:
4242

4343
## AI Agents
4444

45-
AI agents are autonomous actors that perform tasks on behalf of users.
46-
47-
### How agents are shaped
48-
49-
An agent is plain metadata validated by `AgentSchema` and created with the
50-
`defineAgent()` factory. The key fields are:
45+
Per [ADR-0063](https://github.com/objectstack-ai/framework/blob/main/docs/adr/0063-two-kernel-agents-skills-are-the-extension-primitive.md)
46+
the kernel ships **exactly two** platform agents, bound by the *surface* the user
47+
is in — the user never picks from a roster:
48+
49+
| Agent | Surface | Does | Edition |
50+
|---|---|---|---|
51+
| **`ask`** | data console | Read / query / explore records + run the business **actions** the app exposes. RLS-bounded. | open-source · free |
52+
| **`build`** | Studio | Author *metadata* (objects, fields, views, flows) via plan → draft → verify → publish. | cloud · paid |
53+
54+
There is no per-turn intent classifier and no agent dropdown: the surface binds
55+
the agent (data console → `ask`, Studio → `build`). A `build`-shaped request that
56+
reaches `ask` is declined and redirected to the Builder, never silently re-routed.
57+
58+
### You extend the platform with **skills**, not agents
59+
60+
`*.agent.ts` is **closed to third parties** — the `agent` metadata type is
61+
`allowRuntimeCreate:false, allowOrgOverride:false`, reserved for the two platform
62+
agents and platform-owned subagents (ADR-0063 §2). To give the `ask` agent a new
63+
capability you author a **skill** (`*.skill.ts`) whose `tools` reference your
64+
Actions / Flows / queries; it then attaches to `ask`. Every skill declares
65+
`surface: 'ask' | 'build' | 'both'`, and an agent's tool set is the **union of its
66+
surface-compatible skills' tools** — there is no global fall-through, so a skill
67+
reaches an agent only when their surfaces match
68+
([ADR-0064](https://github.com/objectstack-ai/framework/blob/main/docs/adr/0064-tool-scoping-to-agent.md)).
69+
`surface:'build'` skills are inert on the open-source framework (the `build` agent
70+
is cloud-only) — intentional tiering, not a bug.
71+
72+
### The shape of an agent
73+
74+
An agent is metadata validated by `AgentSchema` (the platform's own `ask` / `build`
75+
records use exactly these fields):
5176

5277
| Field | Meaning |
5378
|------|---------|
79+
| `surface` | `'ask'` \| `'build'` — the product surface this agent binds (ADR-0063 §1) |
5480
| `role` | Free-text **persona** string (e.g. `"Senior Support Engineer"`) — not an enum |
5581
| `instructions` | System prompt / prime directives |
5682
| `model` | Provider + model config (`provider`: `openai` \| `azure_openai` \| `anthropic` \| `local`) |
5783
| `skills` | Skill names to attach (the primary Agent → Skill → Tool capability model) |
5884
| `tools` | Direct tool **references** `{ type, name, description }``type` is `action` \| `flow` \| `query` \| `vector_search`; `name` points at an existing Action/Flow/query |
5985
| `knowledge` | RAG access: `{ topics: string[], indexes: string[] }` |
6086

61-
There is no `type` field and no fixed agent "type" taxonomy — the way an agent
62-
behaves comes from its persona, instructions, skills, and tools. Likewise there
63-
are no `triggers` or `schedule` fields on an agent; drive agents from
64-
[Flows/Workflows](./automation) or invoke them via the chat endpoint when you
65-
need event- or time-based behaviour.
87+
There is no `type` field and no fixed agent "type" taxonomy — behaviour comes from
88+
persona, instructions, skills, and tools. There are no `triggers` / `schedule`
89+
fields on an agent; drive agents from [Flows/Workflows](./automation) or invoke
90+
them via the chat endpoint.
6691

6792
<Callout type="info">
6893
Agent tools are **references** to existing Actions, Flows, or queries — you do
@@ -71,6 +96,15 @@ not define ad-hoc tool names with inline parameter schemas here. See
7196
LLM-callable.
7297
</Callout>
7398

99+
<Callout type="warning">
100+
The agent definitions below illustrate agent **anatomy** — they show how an
101+
`AgentSchema` record is shaped, *not* a tenant-authoring tutorial. On today's
102+
platform you do not ship your own agents (`*.agent.ts` is platform-internal); you
103+
add capability by authoring a **skill** that attaches to the built-in `ask` agent.
104+
Read the examples for structure, then express your own capability as a skill plus
105+
the Actions/Flows its tools reference.
106+
</Callout>
107+
74108
### Sales Assistant Agent
75109

76110
```typescript

content/docs/guides/plugin-chatbot-integration.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ verified in step 3):
3535

3636
```bash
3737
curl http://localhost:3000/api/v1/ai/agents
38-
# → { "agents": [{ "name": "data_chat", ... }, ...] }
38+
# → { "agents": [{ "name": "ask", ... }, ...] }
3939

4040
curl http://localhost:3000/api/v1/ai/models
4141
# → { "models": [...] } ← may be empty until the adapter lists models
@@ -82,7 +82,7 @@ import { useObjectChat } from '@object-ui/plugin-chatbot';
8282
const chat = useObjectChat({
8383
api: 'http://localhost:3000/api/v1/ai/assistant/chat',
8484
headers: { 'X-Environment-Id': 'env_local' },
85-
body: { agent: 'data_chat' },
85+
body: { agent: 'ask' },
8686
});
8787
```
8888

docs/adr/0040-unified-assistant-and-agent-binding.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# ADR-0040: Unified Assistant — the end user never picks an agent
22

3-
**Status**: Proposed (2026-06-11)
3+
> **⚠️ Superseded by [ADR-0063](./0063-two-kernel-agents-skills-are-the-extension-primitive.md)** (2026-06-22). Its core decision — a *single* unified assistant carrying all skills, switched by a per-turn intent classifier — was **reversed**: the kernel now ships two agents (`ask` / `build`) bound by *surface*, and `*.agent.ts` is closed to third parties (skills are the extension primitive). The UX win it established (the user never picks from a roster) is kept, re-grounded as surface binding. Kept below as a historical record of the decision and the incident that motivated it.
4+
5+
**Status**: **Superseded by [ADR-0063](./0063-two-kernel-agents-skills-are-the-extension-primitive.md)** — original: Proposed (2026-06-11)
46
**Deciders**: ObjectStack Protocol Architects
57
**Builds on**: [ADR-0033](./0033-ai-assisted-metadata-authoring.md) (draft-gated authoring tools the assistant drives), [ADR-0038](./0038-build-verification-loop.md) (the verify-fix-reverify discipline carried by skills), ADR-0037 / [framework#1694](https://github.com/objectstack-ai/framework/pull/1694) (Live Canvas — the surface the unified assistant builds into)
68
**Consumers**: `@objectstack/spec` (agent/skill types — clarified, not changed), `@objectstack/service-ai` (default agent composition), `../cloud/service-ai-studio` (authoring skills attach to the platform assistant), `../objectui` (chat surfaces drop the agent picker)

0 commit comments

Comments
 (0)