Skip to content

Atmosphere/atmosphere

Atmosphere

Atmosphere

Real-time transport layer for Java AI agents.
Build once with @Agent — deliver over WebTransport/HTTP3, WebSocket, SSE, gRPC, MCP, A2A, AG-UI, or any transport. Works with Spring AI, LangChain4j, Google ADK, Embabel, JetBrains Koog, or the built-in OpenAI-compatible client.

Maven Central npm Atmosphere CI E2E Tests Atmosphere.js CI


Atmosphere is a transport-agnostic runtime for Java. Your application code declares what it 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.

Quick Start

brew install Atmosphere/tap/atmosphere

# or

curl -fsSL https://raw.githubusercontent.com/Atmosphere/atmosphere/main/cli/install.sh | sh

# Run a built-in agent sample
atmosphere run spring-boot-multi-agent-startup-team

# Or scaffold your own project from a sample
atmosphere new my-agent --template ai-chat

# Import a skill from GitHub and run it
atmosphere import https://github.com/anthropics/skills/blob/main/skills/frontend-design/SKILL.md
cd frontend-design && LLM_API_KEY=your-key ./mvnw spring-boot:run

@Agent

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
    }

    @Command(value = "/reset", description = "Reset data",
             confirm = "This will delete all data. Are you sure?")
    public String reset() {
        return dataService.resetAll();  // Requires user confirmation first
    }

    @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 this registers depends on which modules are on the classpath:

Module on classpath What gets registered
atmosphere-agent (required) WebSocket endpoint at /atmosphere/agent/my-agent with streaming AI, conversation memory, /help auto-generation
atmosphere-mcp MCP endpoint at /atmosphere/agent/my-agent/mcp
atmosphere-a2a A2A endpoint at /atmosphere/agent/my-agent/a2a with Agent Card discovery
atmosphere-agui AG-UI endpoint at /atmosphere/agent/my-agent/agui
atmosphere-channels + bot token Same agent responds on Slack, Telegram, Discord, WhatsApp, Messenger
(built-in) Console UI at /atmosphere/console/

Key Features

Multi-Agent Orchestration@Coordinator manages a fleet of agents with parallel fan-out, sequential pipelines, conditional routing, coordination journal, and result evaluation. Test with StubAgentFleet — no infrastructure needed.

Agent Handoffs & Human-in-the-Loop — Transfer conversations between agents with session.handoff(). Pause tool execution with @RequiresApproval for human-in-the-loop approval — the virtual thread parks cheaply until the client approves or denies.

6 AI Runtimes — Built-in, LangChain4j, Spring AI, Google ADK, Embabel, JetBrains Koog. Switch backends by changing one Maven dependency. All share tool calling, structured output, conversation memory, and usage tracking.

3 Agent Protocols — MCP (tools for Claude, Copilot, Cursor), A2A (agent-to-agent via JSON-RPC), AG-UI (streaming state to frontends). Auto-registered from classpath.

6 Channels — Web, Slack, Telegram, Discord, WhatsApp, Messenger. Set a bot token and the same @Command + AI pipeline works everywhere.

Skill Files — Markdown system prompts with sections for tools, guardrails, and channels. Auto-discovered from classpath. Import 1,200+ skills from GitHub with atmosphere import.

Long-Term Memory — Agents remember users across sessions. LongTermMemoryInterceptor extracts facts via LLM and injects them into future system prompts. Three strategies: on session close, per message, or periodic.

Conversation Memory — Pluggable compaction strategies (sliding window, LLM summarization). Durable sessions via SQLite or Redis survive server restarts.

Eval AssertionsLlmJudge tests agent quality with meetsIntent(), isGroundedIn(), and hasQuality(). StubAgentFleet and CoordinatorAssertions for testing coordinators without infrastructure.

15 Event TypesAiEvent sealed interface: text deltas, tool start/result/error, agent steps, handoffs, approval prompts, structured output, routing decisions. Normalized across all runtimes.

5 Transports — WebTransport/HTTP3, WebSocket, SSE, Long-Polling, gRPC. Automatic fallback, reconnection, heartbeats, message caching. First Java framework with WebTransport over HTTP/3.

Observability — OpenTelemetry tracing, Micrometer metrics, AI token usage tracking. Auto-configured with Spring Boot.

Client — atmosphere.js

npm install atmosphere.js
import { useStreaming } from 'atmosphere.js/react';

function Chat() {
  const { fullText, isStreaming, send } = useStreaming({
    request: { url: '/atmosphere/agent/my-agent', transport: 'websocket' },
  });
  return <p>{fullText}</p>;
}

React, Vue, Svelte, and React Native bindings available. For Java/Kotlin clients, see wAsync — async WebSocket, SSE, long-polling, and gRPC client.

Samples

Sample Description
startup team @Coordinator with 4 specialist agents
dentist agent Commands, tools, skill file, Slack + Telegram
ai-tools Framework-agnostic tool calling + approval gates
orchestration-demo Agent handoffs and approval gates
mcp-server MCP tools, resources, prompts
rag-agent RAG with knowledge base search tools
durable-sessions SQLite/Redis session persistence

All 18 samples · atmosphere install for interactive picker · CLI reference

Getting Started

<!-- Spring Boot 4.0 starter -->
<dependency>
    <groupId>org.atmosphere</groupId>
    <artifactId>atmosphere-spring-boot-starter</artifactId>
    <version>4.0.28</version>
</dependency>

<!-- Agent module (required for @Agent, @Coordinator) -->
<dependency>
    <groupId>org.atmosphere</groupId>
    <artifactId>atmosphere-agent</artifactId>
    <version>4.0.28</version>
</dependency>

Optional: atmosphere-ai, atmosphere-mcp, atmosphere-a2a, atmosphere-agui, atmosphere-channels, atmosphere-coordinator. Add to classpath and features auto-register.

Requirements: Java 21+ · Spring Boot 4.0+ or Quarkus 3.21+

Documentation

Tutorial · Full docs · CLI · Javadoc · Samples

Support

Commercial support and consulting available through Async-IO.org.

Companion Projects

Project Description
javaclaw-atmosphere Atmosphere chat transport plugin for JavaClaw

License

Apache 2.0 — @Copyright 2008-2026 Async-IO.org

About

Real-time transport layer for Java AI agents. Build once with @agent — deliver over WebSocket, SSE, gRPC, MCP, A2A, AG-UI, or any transport. Works with Spring AI, LangChain4j, Google ADK, Embabel, Koog or the built-in OpenAI-compatible client.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Contributors