Atmosphere/atmosphere
Portable AI agent runtime for the JVM. One @Agent class runs on Spring AI, LangChain4j, Anthropic, or 9 more behind one SPI. Token streaming, tool calls, human approvals, and governance over WebSocket, SSE, gRPC, or WebTransport/HTTP3. Speaks MCP, A2A, and AG-UI.
Atmosphere – Real‑time Engine for AI Agents on the JVM
What it is – A Java‑centric framework that lets you run deep AI agents as if they were ordinary web services. It handles the plumbing that most LLM‑backed agents need: streaming responses over real‑time transports, durable state, governance (policies, cost limits, PII redaction), human‑in‑the‑loop approvals, and multi‑channel exposure (WebSocket, SSE, gRPC, Slack, Discord, …). The core library lives on Maven Central (org.atmosphere:atmosphere‑runtime) and a companion JavaScript client (atmosphere.js) is published on npm.
Core concepts & how they fit together
| Concept | What Atmosphere provides | Why it matters for AI agents |
|---|---|---|
| @Agent annotation | Declares a class as an AI agent. The annotation automatically wires memory, a planning tool, a virtual file‑system, sub‑agent delegation, and command endpoints. | You get a deep agent out‑of‑the‑box without writing boiler‑plate. |
| Streaming transport | One broadcaster can serve WebSocket, Server‑Sent Events, long‑polling, gRPC, and optional HTTP/3 WebTransport. | Clients receive token‑by‑token output just like a chat UI, even over firewalls or mobile networks. |
| AgentRuntime SPI | Pluggable adapters (atmosphere-ai, atmosphere‑spring‑ai, atmosphere‑langchain4j, Anthropic, Cohere, etc.) translate the @Agent calls to the underlying LLM provider. |
Switch from OpenAI to Gemini, Ollama, or a custom model without changing your agent code. |
| Governance layer | Policy admission, @AgentScope, cost ceilings, PII redaction, kill‑switches, and plan‑and‑verify verifiers. |
Guarantees that agents obey organisational rules before they call tools or spend tokens. |
| Durable sessions & checkpoints | SQLite or Redis‑backed conversation memory, long‑term facts, replay buffers, and checkpoint stores (Temporal‑backed optional). | Agents can hibernate, survive restarts, and be resumed after a human approval step. |
| Multi‑channel adapters | Built‑in modules expose the same agent over MCP, A2A, AG‑UI, Slack, Telegram, Discord, WhatsApp, Messenger, and a browser console UI. | One code base powers web chat, internal tools, and messaging bots. |
| Sandbox execution | atmosphere-sandbox SPI with a default Docker sandbox provider for safe code or browser automation. |
Keeps potentially dangerous tool calls isolated from your host system. |
Typical workflow for a developer
- Create a project with the CLI:
atmosphere new my-agent --template ai-chat # picks a Spring‑Boot starter cd my-agent LLM_API_KEY=… ./mvnw spring-boot:run - Write an @Agent class. Methods annotated with
@Promptreceive the user message and can stream back tokens via aStreamingSession.@Commandmethods expose slash‑style commands, and@AiToolmethods become LLM‑callable tools. - Choose a runtime – keep the default built‑in adapter or add
--runtime spring-ai/--runtime langchain4jto pull in a different SPI implementation. - Configure governance (optional) in
application.yml– set cost limits, PII redaction rules, or require human approval for certain tools. - Run – the agent is reachable at URLs such as:
ws://host/atmosphere/agent/my-agent(WebSocket stream)http://host/atmosphere/agent/my-agent/mcp(MCP protocol)- Slack/Discord webhook URLs generated by the
atmosphere-channelsmodule.
- Observe & replay – enable the session tape to store every AI event in SQLite. Later you can reconstruct a run without hitting the model, useful for debugging or distilling a smaller model.
Who should use Atmosphere?
| Situation | Recommended choice |
|---|---|
| Existing JVM service (Spring Boot, Quarkus, Netty, etc.) that needs stateful, governed agents with real‑time streaming. | Atmosphere – plug‑and‑play, no rewrite. |
| Short‑lived, stateless bots that can run serverless (e.g., Cloudflare Workers). | A serverless agent platform is simpler; Atmosphere’s durability would be overkill. |
| Teams that need human‑in‑the‑loop, audit trails, and compliance evidence (PII, cost caps, OWASP Agentic Top 10). | Atmosphere’s governance modules and admin console provide built‑in evidence. |
| Projects already using Spring AI or LangChain4j and want to keep the same model/provider but add streaming, multi‑channel, and policy enforcement. | Add the corresponding atmosphere‑spring‑ai or atmosphere‑langchain4j adapter. |
Strengths & limitations (as described in the README)
Strengths
- Unified real‑time transport layer (WebSocket, SSE, gRPC, optional HTTP/3).
- Deep‑agent defaults (memory, plan, virtual FS, sub‑agents) with fine‑grained harness control.
- Pluggable runtime adapters – you can swap OpenAI, Anthropic, Cohere, or any Spring‑AI‑compatible provider.
- Strong governance: policy admission, cost/PII limits, plan‑and‑verify, durable HITL.
- Multi‑channel exposure (MCP, A2A, AG‑UI, Slack, Discord, etc.) without extra code.
- Open‑source, Maven Central + npm distribution, CI badges show active testing.
Limitations / scope
- It is not a hosting platform; you must provide the servlet container (Tomcat, Jetty, etc.) and any compute resources.
- Payment/commerce features are out of scope – you still need to manage LLM billing yourself.
- Some adapters have version constraints (e.g.,
atmosphere‑spring‑ai‑alibabaonly works with Spring Boot 3.5). - The framework focuses on JVM languages; non‑JVM ecosystems would need a separate bridge.
Quick reference links (from the README)
- Documentation site – https://atmosphere.github.io/docs
- Maven Central – https://central.sonatype.com/artifact/org.atmosphere/atmosphere-runtime
- npm package – https://www.npmjs.com/package/atmosphere.js
- CLI installation –
brew install Atmosphere/tap/atmosphereor the one‑liner install script. - Key modules –
atmosphere-runtime,atmosphere-ai,atmosphere-agent,atmosphere-mcp,atmosphere-channels,atmosphere-admin,atmosphere-sandbox.
TL;DR
Atmosphere is a production‑grade, JVM‑native framework that turns a plain Java class annotated with @Agent into a fully‑featured, streaming AI service. It supplies real‑time transports, durable state, policy‑driven governance, human‑in‑the‑loop approval, and out‑of‑the‑box connectors to many chat‑model providers and messaging channels. If you already run Java services and need a governed, stateful LLM agent that can talk to browsers, Slack, or custom gRPC clients, Atmosphere gives you the plumbing so you can focus on the agent logic.
All details above are taken directly from the repository’s README; no additional features have been inferred.
Related
- Project
- Project
- Project
- Project