Skip to content

Introduction

Atmosphere is a transport-agnostic runtime for Java AI agents. You declare what your agent does — the framework handles how it’s delivered. A single @Agent class can serve browsers over WebSocket, expose tools via MCP, accept tasks from other agents via A2A, stream state to frontends via AG-UI, and route messages to Slack, Telegram, or Discord — all without changing a line of code.

One annotation. The framework wires everything based on what’s in the class and what’s on the classpath.

@Agent(name = "my-agent", description = "What this agent does")
public class MyAgent {
@Prompt
public void onMessage(String message, StreamingSession session) {
session.stream(message); // LLM streaming via configured backend
}
@Command(value = "/status", description = "Show status")
public String status() {
return "All systems operational"; // Executes instantly, no LLM cost
}
@AiTool(name = "lookup", description = "Look up data")
public String lookup(@Param("query") String query) {
return dataService.find(query); // Callable by the LLM during inference
}
}

What gets registered depends on which modules are on the classpath:

Module on classpathWhat gets registered
atmosphere-agent (required)WebSocket endpoint at /atmosphere/agent/my-agent with streaming AI, conversation memory, /help auto-generation
atmosphere-mcpMCP endpoint at /atmosphere/agent/my-agent/mcp — tools exposed to Claude, Copilot, Cursor
atmosphere-a2aA2A endpoint at /atmosphere/agent/my-agent/a2a with Agent Card discovery
atmosphere-aguiAG-UI endpoint at /atmosphere/agent/my-agent/agui — CopilotKit-compatible
atmosphere-channels + bot tokenSame agent responds on Slack, Telegram, Discord, WhatsApp, Messenger
(built-in)Console UI at /atmosphere/console/ — auto-detects the agent

An @Agent with a @Prompt method gets a WebSocket UI. An @Agent with only @AgentSkill methods runs headless — A2A and MCP only, no browser endpoint. The framework detects the mode automatically.

Write your agent once. The execution engine is determined by what’s on the classpath — like Servlets run on Tomcat or Jetty without code changes.

RuntimeDependency
Built-inatmosphere-ai — OpenAI-compatible client (Gemini, OpenAI, Ollama). Zero framework overhead.
LangChain4jatmosphere-langchain4j — ReAct tool loops, StreamingChatModel
Spring AIatmosphere-spring-aiChatClient, function calling, RAG advisors
Google ADKatmosphere-adkLlmAgent, function tools, session management
Embabelatmosphere-embabel — Goal-driven GOAP planning
JetBrains Koogatmosphere-koog — Graph-based orchestration, AIAgent
Microsoft Semantic Kernelatmosphere-semantic-kernelChatCompletionService with streaming + embeddings

Seven runtimes share one AgentRuntime SPI. Switching backends is one dependency change. Your @Agent, @AiTool, @Command, skill files, conversation memory, guardrails, and protocol exposure stay the same. See AI Adapters for the full capability matrix (pinned per-runtime in AbstractAgentRuntimeContractTest.expectedCapabilities()).

@Coordinator manages a fleet of agents. Declare the fleet, inject AgentFleet, and orchestrate with plain Java — sequential, parallel, conditional, or any pattern.

@Coordinator(name = "ceo")
@Fleet({
@AgentRef(type = ResearchAgent.class),
@AgentRef(type = StrategyAgent.class),
@AgentRef(type = FinanceAgent.class)
})
public class CeoCoordinator {
@Prompt
public void onPrompt(String message, AgentFleet fleet, StreamingSession session) {
var research = fleet.agent("research").call("web_search", Map.of("query", message));
var results = fleet.parallel(
fleet.call("strategy", "analyze", Map.of("data", research.text())),
fleet.call("finance", "model", Map.of("market", message))
);
session.stream("Synthesize: " + research.text() + results.get("strategy").text());
}
}

The fleet handles transport automatically — local agents call directly (no HTTP), remote agents use A2A JSON-RPC. Features include coordination journal, agent handoffs, conditional routing, result evaluation, long-term memory, and eval assertions. See @Coordinator for the full guide.

Tools that require human approval before execution use @RequiresApproval:

@AiTool(name = "delete_account", description = "Permanently delete a user account")
@RequiresApproval("This will permanently delete the account. Are you sure?")
public String deleteAccount(@Param("accountId") String accountId) {
return accountService.delete(accountId);
}

The virtual thread parks cheaply until the client approves or denies. See @AiTool & Human-in-the-Loop for the wire protocol and frontend handling.

Atmosphere has been in continuous development since 2008. The AI agent layer is built on top of a battle-tested real-time transport infrastructure that also powers non-AI applications:

  • Transports — WebSocket, SSE, Long-Polling, gRPC with automatic fallback and reconnection
  • Broadcaster — Pub/sub hub that delivers messages to all subscribers regardless of transport
  • Rooms & Presence — Named rooms with join/leave lifecycle and message history
  • @ManagedService — The original annotation-driven programming model (fully compatible with @Agent)

See Real-Time Infrastructure for details.

ModuleArtifactDescription
Agentatmosphere-agent@Agent, @Command, @Prompt, protocol auto-wiring
AIatmosphere-aiAgentRuntime SPI, @AiTool, conversation memory, compaction, artifacts
Coordinatoratmosphere-coordinator@Coordinator, @Fleet, AgentFleet, coordination journal
MCPatmosphere-mcpModel Context Protocol server (tools, resources, prompts)
A2Aatmosphere-a2aAgent-to-Agent protocol (Agent Card, JSON-RPC task delegation)
AG-UIatmosphere-aguiAgent-User Interaction (SSE event streaming, CopilotKit-compatible)
Channelsatmosphere-channelsSlack, Telegram, Discord, WhatsApp, Messenger
Core Runtimeatmosphere-runtimeBroadcaster, AtmosphereResource, transports
Spring Bootatmosphere-spring-boot-starterAuto-configuration for Spring Boot 4.0+
Quarkusatmosphere-quarkus-extensionBuild-time extension for Quarkus 3.31.3
LangChain4jatmosphere-langchain4jLangChain4j adapter
Spring AIatmosphere-spring-aiSpring AI adapter
ADKatmosphere-adkGoogle ADK adapter
Embabelatmosphere-embabelEmbabel adapter
Koogatmosphere-koogJetBrains Koog adapter
Semantic Kernelatmosphere-semantic-kernelMicrosoft Semantic Kernel adapter
Durable Sessionsatmosphere-durable-sessionsSession persistence (SQLite, Redis)
Clientatmosphere.jsTypeScript client — React, Vue, Svelte, React Native

Start with @Agent & @Prompt to learn the core programming model, then continue to @AiTool & Human-in-the-Loop for tool calling and approval gates.