MCPcopy Index your code
hub / github.com/Atmosphere/atmosphere

github.com/Atmosphere/atmosphere @js-v5.0.34

Chat with this repo
repository ↗ · DeepWiki ↗ · release js-v5.0.34 ↗ · + Follow
54,547 symbols 249,597 edges 2,693 files 5,831 documented · 11% 1 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Atmosphere

Atmosphere

The real-time JVM engine for streaming, governable AI agents. Atmosphere's broadcaster transport — WebSocket, SSE, long-polling, gRPC — is the foundation; declare behavior with @Agent and Atmosphere owns runtime dispatch, reconnect, authorization, observability, and the governance path.

Maven Central npm CI: Core CI: E2E CI: atmosphere.js


Atmosphere is built for teams that need AI agents to behave like production services: streaming over real transports, guarded before every tool call, observable by tenant and run, and portable across AI frameworks without rewriting the endpoint.

Why Atmosphere

Need What Atmosphere provides
Stream to real clients WebSocket, SSE, long-polling, and gRPC run through one broadcaster pipeline as always-on defaults; WebTransport over HTTP/3 is optional (needs jetty-http3-server or reactor-netty-http on the classpath plus a dev cert)
Swap AI integrations One AgentRuntime SPI with twelve runtime adapters and contract-tested capability flags
Govern execution Policy admission, @AgentScope, human approval, plan-and-verify, cost ceilings, PII rewriting, and admin kill switches
Pause for humans Durable HITL approvals hibernate without holding a thread, persist workflow state, and resume through REST approval surfaces
Resume long runs Durable sessions, run IDs, replay buffers, checkpoints, and reconnect-safe continuation
Expose the same agent everywhere Browser endpoints plus MCP (stateless 2026-07-28 RC + sessions back to 2024-11-05), A2A, AG-UI, Slack, Telegram, Discord, WhatsApp, and Messenger modules

Scope

Atmosphere is a JVM framework, not an agent-hosting platform. We ship the primitives your application uses at runtime; the host you choose (Tomcat, Jetty, Netty, Undertow, Quarkus, Spring Boot, or any servlet container) owns compute and scheduling. Payment rails and commerce primitives are out of scope. Compared to the agent-platform stack vocabulary that has emerged around offerings like Cloudflare Agents, AWS Bedrock Agents, and Vertex AI Agents:

Layer What Atmosphere ships Provided by your stack
Streaming transport atmosphere-runtime over WebSocket, SSE, long-polling (always-on defaults), gRPC, plus optional WebTransport/HTTP-3 (needs jetty-http3-server or reactor-netty-http on the classpath plus a dev cert)
Runtime dispatch atmosphere-ai AgentRuntime SPI + 12 adapters with contract-tested capability flags Model hosting (we call providers; we do not host weights)
Orchestration @Coordinator, AgentFleet, handoffs, conditional routing, event-sourced coordination journal (CoordinationJournal SPI with causal EventEnvelope lineage, CoordinationProjection DAG-from-log, FileCoordinationJournal append-only NDJSON persistence, CoordinationFork what-if branching), result evaluation, and durable hibernating Workflow<S> over CheckpointStore (per-step retry, resume across JVM restart, no thread held while hibernated) — durable step execution, not wall-clock triggering Cron / wall-clock scheduling (your container scheduler or a dedicated scheduler fires the workflow)
Memory AiConversationMemory per-conversation history (in-memory, plus durable SQLite/Redis through the ConversationPersistence SPI in atmosphere-durable-sessions{-sqlite,-redis}), LongTermMemory per-user facts (InMemoryLongTermMemory, SqliteLongTermMemory, RedisLongTermMemory), SemanticRecallInterceptor for BYO vector-store recall Managed vector stores (use Spring AI's VectorStore, LangChain4j embeddings, or your own)
Governance Policy admission, @AgentScope, plan-and-verify, PII redaction, cost ceilings, durable HITL approvals, admin kill switches
Protocol surface MCP, A2A, AG-UI, Slack/Telegram/Discord/WhatsApp/Messenger channel adapters
Code execution atmosphere-sandbox SandboxProvider SPI + DockerSandboxProvider default Browser automation, headless Chromium
SDK atmosphere.js (React, Vue, Svelte, React Native, vanilla TS), wasync (JVM client)

The differentiator is the streaming + JVM + governance combination: long-lived stateful agent sessions over real-time transports, with policy admission on the critical path. For stateless, bursty, autonomous agents that should hibernate when idle, a serverless agent platform is usually the better fit. For human-in-the-loop, multi-channel, governed agents inside an existing JVM stack, Atmosphere is the fit.

Quick Start

Run a sample

brew install Atmosphere/tap/atmosphere

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

atmosphere run spring-boot-multi-agent-startup-team

Create an app

atmosphere new my-agent --template ai-chat
cd my-agent
LLM_API_KEY=your-key ./mvnw spring-boot:run

Swap the runtime adapter

# Built-in is the default. This injects the Spring AI adapter dependencies.
atmosphere new my-agent --template ai-chat --runtime spring-ai

# Use --force when a sample already pins a runtime adapter.
atmosphere new my-agent --template ai-tools --runtime langchain4j --force

Import a skill

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

Terminology

Term Meaning in Atmosphere Examples
Model provider The model/API vendor or endpoint that serves tokens OpenAI, Gemini compatibility endpoint, Ollama, DashScope, local OpenAI-compatible proxies
Runtime adapter The Atmosphere integration that implements AgentRuntime Built-in, Spring AI, LangChain4j, Google ADK, Embabel, Koog, Semantic Kernel, AgentScope, Spring AI Alibaba, Anthropic, Cohere, CrewAI
Capability A feature advertised by a runtime adapter and pinned by contract tests tool calling, embeddings, streaming, structured output, prompt caching

Use provider for model vendors and runtime adapter for Atmosphere integrations. Not every runtime adapter exposes every capability.

@Agent

One annotation declares the agent. Modules on the classpath decide which endpoints and integrations are registered.

@Agent(name = "my-agent", description = "What this agent does")
public class MyAgent {

    @Prompt
    public void onMessage(String message, StreamingSession session) {
        session.stream(message);
    }

    @Command(value = "/status", description = "Show status")
    public String status() {
        return "All systems operational";
    }

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

    @AiTool(name = "lookup", description = "Look up data")
    public String lookup(@Param("query") String query) {
        return dataService.find(query);
    }
}
Module on classpath What gets registered
atmosphere-agent Browser endpoint at /atmosphere/agent/my-agent, streaming AI dispatch, memory, commands, /help
atmosphere-mcp MCP endpoint at /atmosphere/agent/my-agent/mcp — session protocol + stateless 2026-07-28 RC (Tasks, MCP Apps, OAuth resource server)
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 Slack, Telegram, Discord, WhatsApp, and Messenger dispatch
atmosphere-admin Admin dashboard and /api/admin/* control surfaces
built-in console Console UI at /atmosphere/console/

AI Runtime Adapters

atmosphere-ai ships the AgentRuntime SPI plus the Built-in OpenAI-compatible adapter. Eleven additional adapters live in separate modules — nine wrap a third-party framework, and two (atmosphere-anthropic, atmosphere-cohere) are native HTTP+SSE clients for the Anthropic Messages API and the Cohere v2 chat API respectively. Drop one runtime adapter on the classpath and the same @Agent code dispatches through it.

Capabilities are intentionally not identical. The authoritative matrix is pinned by AbstractAgentRuntimeContractTest.expectedCapabilities(), so a runtime cannot drift from its declared feature set without breaking tests.

Runtime adapter Backing framework Spring Boot Capability highlights Notes
atmosphere-ai (Built-in) OpenAI-compatible HTTP client 3.5 / 4.0 tool calling, JSON mode, vision, audio, prompt caching, token usage, native retry, tool-call deltas Default. Works with OpenAI-compatible endpoints such as OpenAI, Gemini compatibility endpoints, Ollama, and local proxies.
atmosphere-spring-ai Spring AI 2.0.0 4.0 tool calling, structured output, vision, audio, prompt caching, token usage Best fit for Spring Boot applications already using Spring AI.
atmosphere-langchain4j LangChain4j 1.15.0 4.0 tool calling, structured output, vision, audio, prompt caching, token usage Best fit for LangChain4j tool ecosystems and non-Spring services.
atmosphere-adk Google ADK 1.2.0 4.0 agent orchestration, tool calling, multi-modal, prompt caching Multi-agent runtime with AGENT_ORCHESTRATION.
atmosphere-koog JetBrains Koog 1.0.0 4.0 agent orchestration, tool calling, multi-modal, prompt caching, cancellation Multi-agent runtime.
atmosphere-semantic-kernel Microsoft Semantic Kernel 1.5.0 4.0 tool calling, structured output, vision, token usage No audio path through the SK Java SDK today.
atmosphere-agentscope Alibaba AgentScope 1.0.12 4.0 tool calling, structured output, vision, audio, conversation memory, token usage, cancellation AgentScopeToolBridge routes every @AiTool invocation through ToolExecutionHelper.executeWithApproval.
atmosphere-embabel Embabel 0.3.5 3.5 only agent orchestration, tool calling, vision, conversation memory Requires atmosphere-spring-boot3-starter and the -Pspring-boot3 profile.
atmosphere-spring-ai-alibaba Spring AI Alibaba 1.1.2.2 3.5 only tool calling, structured output, vision, audio, conversation memory, token usage Buffered streaming (the upstream ReactAgent.call() returns one AssistantMessage); UsageCapturingChatModel decorator threads token usage. Token-by-token streaming should use another adapter until Alibaba ships a Spring AI 2.x-aligned agent framework.
atmosphere-anthropic Anthropic Messages API (no third-party SDK) 3.5 / 4.0 tool calling, structured output, conversation memory, token usage, per-request retry Native HTTP+SSE client; tool loop capped at five rounds, cancellation-aware. Configure via anthropic.api.key (system property or AiConfig.LlmSettings); custom headers (Helicone-Auth, tenant IDs, tracing) are passthrough with reserved-header filtering.
atmosphere-cohere Cohere v2 chat API (no third-party SDK) 3.5 / 4.0 tool calling, structured output, vision, multi-modal, conversation memory, token usage, per-request retry Native HTTP+SSE client against POST /v2/chat; tool dispatch routes through ToolExecutionHelper.executeWithApproval. Configure via cohere.api.key (system property or AiConfig.LlmSettings).
[`atm

Extension points exported contracts — how you extend this code

Invoker (Interface)
Functional adapter the runtime calls to invoke the user's AiServices method. The single-method shape ({@code Str [6 implementers]
modules/langchain4j/src/main/java/org/atmosphere/ai/langchain4j/LangChain4jAiServices.java
BroadcasterCacheInspector (Interface)
Inspect BroadcastMessages before they get added to the BroadcasterCache. Messages can also be modified before th [47 implementers]
modules/cpr/src/main/java/org/atmosphere/cache/BroadcasterCacheInspector.java
AgUiEvent (Interface)
Sealed interface representing all 27 AG-UI protocol events. Each record variant maps to a specific wire-format event typ [56 …
modules/agui/src/main/java/org/atmosphere/agui/event/AgUiEvent.java
CheckpointStore (Interface)
Pluggable persistence for WorkflowSnapshot instances. Provides the primitives needed for durable execution: [8 implementers]
modules/checkpoint/src/main/java/org/atmosphere/checkpoint/CheckpointStore.java
MessagingChannel (Interface)
Unified messaging channel interface for external chat platforms. Each channel adapter (Telegram, Slack, Discord, Wha [10 …
modules/channels/src/main/java/org/atmosphere/channels/MessagingChannel.java
CedarAuthorizer (Interface)
Strategy for evaluating a Cedar policy against a request. Mirrors RegoEvaluator — pluggable CLI-subprocess defau [6 implementers]
modules/ai-policy-cedar/src/main/java/org/atmosphere/ai/policy/cedar/CedarAuthorizer.java
ContextProvider (Interface)
SPI for RAG (Retrieval-Augmented Generation) context augmentation. Implementations retrieve relevant documents/context t [11 …
modules/ai/src/main/java/org/atmosphere/ai/ContextProvider.java
LocalDispatchable (Interface)
Interface for handlers that support direct in-JVM dispatch without HTTP. Implemented by A2aHandler so that local [8 implementers]
modules/a2a/src/main/java/org/atmosphere/a2a/runtime/LocalDispatchable.java

Core symbols most depended-on inside this repo

get
called by 4991
modules/ai/src/main/java/org/atmosphere/ai/cache/ResponseCache.java
push
called by 3466
atmosphere.js/src/types/index.ts
of
called by 3032
modules/ai/src/main/java/org/atmosphere/ai/TokenUsage.java
contains
called by 1608
modules/cpr/src/main/java/org/atmosphere/room/Room.java
when
called by 1563
modules/coordinator/src/main/java/org/atmosphere/coordinator/fleet/RoutingSpec.java
put
called by 1562
modules/ai/src/main/java/org/atmosphere/ai/cache/ResponseCache.java
add
called by 1533
modules/cpr/src/main/java/org/atmosphere/cpr/BroadcasterFactory.java
call
called by 1468
modules/coordinator/src/main/java/org/atmosphere/coordinator/fleet/AgentProxy.java

Shape

Function 26,199
Method 24,353
Class 3,487
Interface 426
Enum 79
Route 3

Languages

TypeScript56%
Java43%
Kotlin1%
Python1%
Ruby1%

Modules by API surface

samples/spring-boot-ai-tools/src/main/resources/static/assets/index-CnyuWngM.js1,129 symbols
samples/spring-boot-rag-chat/src/main/resources/static/assets/index-Y7u2IOyJ.js1,125 symbols
samples/spring-boot-multi-agent-startup-team/src/main/resources/static/assets/index-C2FnegHt.js1,125 symbols
samples/spring-boot-rag-chat/src/main/resources/static/assets/index-my4YktJh.js1,124 symbols
samples/spring-boot-multi-agent-startup-team/src/main/resources/static/assets/index-DPWEbRUU.js1,113 symbols
samples/spring-boot-multi-agent-startup-team/src/main/resources/static/assets/index-DM_p-7F0.js1,113 symbols
samples/spring-boot-multi-agent-startup-team/src/main/resources/static/assets/index-D-TcU3Ko.js1,113 symbols
samples/spring-boot-a2a-agent/src/main/resources/static/assets/index-Cv-qlzxh.js1,025 symbols
samples/spring-boot-ai-classroom/src/main/resources/static/assets/index-39PlOdtz.js809 symbols
samples/spring-boot-ai-chat/src/main/resources/static/assets/index-CiZfy-P_.js795 symbols
samples/spring-boot-agui-chat/src/main/resources/static/assets/index-D-dxeCqx.js791 symbols
samples/grpc-chat/src/main/webapp/assets/index-Dw6ZZe4e.js739 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add atmosphere \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact