Skip to content

Commit acd37c4

Browse files
jfarcandclaude
andcommitted
docs: add @coordinator, AI testing, migrate AiSupport → AgentRuntime
- Add @coordinator documentation (agents/coordinator.md): @fleet, @AgentRef, AgentFleet API, parallel fan-out, sequential pipelines, optional agents, weighted routing, local vs remote transport - Add AI Testing reference (reference/testing.md): AiTestClient, AiResponse, AiAssertions fluent API for JUnit 5 - Migrate AiSupport → AgentRuntime across all docs (reference/ai, tutorial/11-ai-adapters, tutorial/12-ai-filters, all integration pages) - Fix @agent annotation attributes: value→name, skills→skillFile, remove nonexistent memory attr, add endpoint attribute - Update splash page and welcome to balance real-time core and AI stories - Add @coordinator and AI Testing to sidebar navigation - Update What's New with multi-agent orchestration and AgentRuntime SPI Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 312ab37 commit acd37c4

16 files changed

Lines changed: 837 additions & 92 deletions

File tree

docs/astro.config.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default defineConfig({
77
integrations: [
88
starlight({
99
title: 'Atmosphere',
10-
description: 'The Java framework for WebSocket, SSE, and AI streaming',
10+
description: 'Real-time for the JVM — WebSocket, SSE, gRPC, rooms, presence, AI streaming, and multi-agent orchestration',
1111
logo: {
1212
src: './src/assets/logo.svg',
1313
replacesTitle: false,
@@ -34,6 +34,7 @@ export default defineConfig({
3434
label: 'Agents',
3535
items: [
3636
{ label: '@Agent', slug: 'agents/agent' },
37+
{ label: '@Coordinator', slug: 'agents/coordinator' },
3738
{ label: 'Skills', slug: 'agents/skills' },
3839
{ label: 'A2A Protocol', slug: 'agents/a2a' },
3940
{ label: 'AG-UI Protocol', slug: 'agents/agui' },
@@ -103,6 +104,7 @@ export default defineConfig({
103104
{ label: 'Core Runtime', slug: 'reference/core' },
104105
{ label: 'Rooms & Presence', slug: 'reference/rooms' },
105106
{ label: 'AI / LLM', slug: 'reference/ai' },
107+
{ label: 'AI Testing', slug: 'reference/testing' },
106108
{ label: 'MCP Server', slug: 'reference/mcp' },
107109
{ label: 'gRPC Transport', slug: 'reference/grpc' },
108110
{ label: 'Kotlin DSL', slug: 'reference/kotlin' },

docs/src/content/docs/agents/a2a.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ A2A (Agent-to-Agent) is Google's open protocol for agent interoperability. Atmos
3030
Declares a skill that this agent exposes to other agents. Applied at the class level alongside `@Agent` or `@ManagedService`.
3131

3232
```java
33-
@Agent(value = "/translator", headless = true)
33+
@Agent(name = "translator", headless = true)
3434
@AgentSkill(
3535
name = "translate",
3636
description = "Translates text between languages",
@@ -104,7 +104,7 @@ A2A uses JSON-RPC 2.0 over HTTP. Atmosphere handles serialization, error mapping
104104
A2A is designed for agent-to-agent communication. Agents that only serve other agents should use `headless = true`:
105105

106106
```java
107-
@Agent(value = "/data-enrichment", headless = true)
107+
@Agent(name = "data-enrichment", headless = true)
108108
@AgentSkill(name = "enrich", description = "Enriches records with external data")
109109
public class DataEnrichmentAgent {
110110

docs/src/content/docs/agents/agent.md

Lines changed: 64 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ description: "The @Agent annotation — wiring AI endpoints, commands, tools, sk
2525

2626
```java
2727
@Agent(
28-
value = "/my-agent",
29-
skills = "classpath:skills/my-agent.skills",
30-
memory = true
28+
name = "my-agent",
29+
skillFile = "skills/my-agent.md",
30+
description = "A helpful assistant"
3131
)
3232
public class MyAgent {
3333

@@ -43,15 +43,26 @@ public class MyAgent {
4343
}
4444
```
4545

46+
## Annotation Attributes
47+
48+
| Attribute | Type | Default | Description |
49+
|-----------|------|---------|-------------|
50+
| `name` | `String` | _(required)_ | Agent name. Used in the registration path (`/atmosphere/agent/{name}`) and in protocol metadata (A2A Agent Card). |
51+
| `skillFile` | `String` | `""` | Classpath resource path to the skill file (`.md`). The entire file becomes the system prompt. Sections are also extracted for protocol metadata. |
52+
| `description` | `String` | `""` | Human-readable description for A2A Agent Card metadata. |
53+
| `endpoint` | `String` | `""` | Custom endpoint path for the agent's A2A protocol endpoint. Overrides the default `/atmosphere/agent/{name}/a2a`. |
54+
| `version` | `String` | `"1.0.0"` | Agent version for Agent Card metadata and protocol responses. |
55+
| `headless` | `boolean` | `false` | When `true`, no WebSocket UI handler is registered — agent operates as a headless A2A/MCP service only. |
56+
4657
## What `@Agent` Wires
4758

4859
| Concern | How it works |
4960
|---------|-------------|
50-
| **AI endpoint** | Registers an HTTP/WebSocket endpoint at the path you specify |
61+
| **AI endpoint** | Registers an HTTP/WebSocket endpoint at `/atmosphere/agent/{name}` |
5162
| **Commands** | Methods annotated with `@Command` become slash commands with type-safe parameters |
5263
| **Tools** | Methods annotated with `@AiTool` are registered as portable tools, callable by any LLM backend |
53-
| **Skill file** | Loaded from the path in `skills`, or auto-discovered at `META-INF/skills/` on the classpath |
54-
| **Conversation memory** | When `memory = true`, session-scoped conversation history is maintained automatically |
64+
| **Skill file** | Loaded from the `skillFile` path, or auto-discovered at `META-INF/skills/` by convention |
65+
| **Conversation memory** | Session-scoped conversation history is enabled by default |
5566
| **Protocol exposure** | MCP, A2A, and AG-UI protocols are auto-registered based on classpath dependencies |
5667

5768
## Full-Stack vs Headless Mode
@@ -61,12 +72,27 @@ By default, `@Agent` runs in **full-stack mode** — it serves a built-in AI Con
6172
Set `headless = true` to run in **headless mode** — no UI is served. The agent is only reachable via its protocol endpoints (MCP, A2A, AG-UI) or programmatic API. This is the right mode for agent-to-agent communication.
6273

6374
```java
64-
@Agent(value = "/background-worker", headless = true)
75+
@Agent(name = "background-worker", headless = true)
6576
public class BackgroundWorker {
6677
// reachable via A2A, MCP, or direct API — no browser UI
6778
}
6879
```
6980

81+
Headless mode is also **auto-detected**: if the class has `@AgentSkill`/`@AgentSkillHandler` methods but no `@Prompt` method, it is treated as headless.
82+
83+
### Custom Endpoint
84+
85+
Use the `endpoint` attribute to set a custom A2A path for headless agents:
86+
87+
```java
88+
@Agent(name = "research",
89+
endpoint = "/atmosphere/a2a/research",
90+
description = "Web research agent")
91+
public class ResearchAgent {
92+
// A2A endpoint served at /atmosphere/a2a/research
93+
}
94+
```
95+
7096
## Commands
7197

7298
`@Command` methods are user-facing slash commands. Parameters are declared with `@Param` and are type-safe.
@@ -97,14 +123,42 @@ public List<Order> queryOrders(
97123
}
98124
```
99125

100-
Tools are automatically registered with the active LLM backend and are also exposed as MCP tools when the MCP module is on the classpath.
126+
Tools are automatically registered with the active `AgentRuntime` and are also exposed as MCP tools when the MCP module is on the classpath.
127+
128+
## Skill File
129+
130+
The `skillFile` attribute points to a Markdown file on the classpath that serves as the agent's system prompt. Sections within the file are also extracted for protocol metadata:
131+
132+
- `## Skills` — A2A Agent Card skills
133+
- `## Tools` — cross-referenced with `@AiTool` methods
134+
- `## Channels` — included in system prompt
135+
- `## Guardrails` — included in system prompt (LLM self-enforces)
136+
137+
```java
138+
@Agent(name = "devops", skillFile = "prompts/devops-skill.md")
139+
public class DevOpsAgent { ... }
140+
```
141+
142+
If no `skillFile` is specified, Atmosphere matches by convention — an agent named `devops` will pick up `META-INF/skills/devops.skills` if present.
101143

102144
## Conversation Memory
103145

104-
When `memory = true`, Atmosphere maintains a session-scoped conversation history. The history is passed to the LLM on every request, giving the agent context about previous exchanges.
146+
Conversation memory is enabled by default. Atmosphere maintains a session-scoped conversation history — the history is passed to the LLM on every request, giving the agent context about previous exchanges.
105147

106-
Memory is stored in-memory by default. For durable persistence, configure a `MemoryStore` implementation.
148+
Memory is stored in-memory by default. For durable persistence across restarts, add `atmosphere-durable-sessions-sqlite` or `atmosphere-durable-sessions-redis` to the classpath and a `ConversationPersistence` backend is auto-discovered via `ServiceLoader`.
107149

108150
## Relationship to `@ManagedService`
109151

110152
`@Agent` builds on top of `@ManagedService`. An `@Agent` is a `@ManagedService` with AI-specific wiring added. You can still use `@ManagedService` directly for non-AI real-time endpoints (chat rooms, presence, pub/sub). Protocol annotations (`@McpTool`, `@AgentSkill`, `@AgUiEndpoint`) work on both.
153+
154+
## Relationship to `@Coordinator`
155+
156+
For multi-agent orchestration, use [`@Coordinator`](/docs/agents/coordinator/) instead. A coordinator subsumes `@Agent` — it adds fleet management on top of the base agent setup. See the [@Coordinator documentation](/docs/agents/coordinator/) for details.
157+
158+
## See Also
159+
160+
- [@Coordinator](/docs/agents/coordinator/) — multi-agent orchestration
161+
- [Skills](/docs/agents/skills/) — skill files and auto-discovery
162+
- [A2A Protocol](/docs/agents/a2a/) — agent-to-agent communication
163+
- [AG-UI Protocol](/docs/agents/agui/) — structured agent events for frontends
164+
- [@AiTool](/docs/tutorial/10-ai-tools/) — framework-agnostic tool calling

0 commit comments

Comments
 (0)