Written for: Java developers who pick which AgentSpaces example to read or run next.
There are nine examples in two groups. The four teaching fleets each add one coordination idea to the one before. The five showcase apps combine many of those ideas with real model frameworks and runtimes beyond the JVM.
Read them in this order. Each adds exactly one coordination idea to the one before.
| App | Teaches | Core AgentSpaces feature |
|---|---|---|
agentspaces-petclinic-fleet |
Service choreography: agents react to the space | @SpaceNotify methods on plain objects |
agentspaces-code-fleet |
Cost-aware allocation and kill-tolerance | AUCTION strategy: @BidFunction + @SpaceTake |
agentspaces-audit-fleet |
Collective decisions with a signed record | aspace:cap/vote (QUORUM) |
agentspaces-intake-fleet |
Evidence-as-ballots and a provenance chain | content addressing + signed entries |
A veterinary clinic run by a nurse, a scheduler, and two vets that coordinate
purely by watching one shared space. The clearest picture of what “coordinate
through the space” means, on a domain everyone understands. Just the space and
@SpaceNotify methods on ordinary objects — the space’s notify with its
delivery discipline applied for you — nothing else.
A repository’s issues become task entries; coding agents bid for them by declared
expertise and cost through the AUCTION strategy, review agents take the completed
changes, and CI flows back. A cheap generalist sweeps the mechanical work while
specialists win the hard problems in their area, and a worker that dies
mid-migration simply lets its lease lapse — the work reappears for someone else.
A release is audited by a panel of discipline specialists — security, licensing, privacy — and every finding is adjudicated by a signed quorum vote of the whole panel. A finding survives only when a cross-disciplinary majority confirms it. The showcase for the vote capability: the decision is a set of signed ballots any member can recount.
Unstructured documents to compliance: content-addressed scans, several extractor agents working the same document in parallel, a quorum over the signed extractions themselves, low-confidence documents routed to human review, and a signed filing whose provenance runs from the scan’s content hash to the filed paperwork.
| App | Shows | Stack |
|---|---|---|
opscenter |
An autonomous operations center, from incident to signed record | Spring AI 2.0, Embabel 1.5 (profile), 12 peers in one JVM |
agentspaces-springai-jev-eg |
Typed judgment of model output on a fleet | Spring Boot, Spring AI, TypeSafe Jev, 9 peers |
superfriends |
Three model vendors on three frameworks in one fleet, sharing files over the content swarm | plain Java + LangChain4j, Spring Boot + Spring AI, Micronaut, Clojure, 6 JVMs |
browser-council |
One fleet across Java, browsers, Node, and a Durable Object | Spring Boot, the @agentspaces/* JavaScript packages, WebRTC, workerd |
decision-rerank |
RAG reranking with Gemini’s decision model as a fleet service, with fallback and guardrails | LangChain4j 1.24, gemini-decision-1, 3 peers in one JVM |
All five run on a laptop with no API keys: scripted or fixture models stand in for the real ones and keep each run deterministic. Set a vendor’s key and that peer switches to the live model. Each app’s README has its run commands, prerequisites, and fleet layout.
An incident lands on a shared board. Triage workers take it under a lease, and the demo
kills one mid-call so the other finishes. Specialist agents react to each piece of evidence
and write the next. A remediation proposal goes to a quorum of three judge peers, each
casting one signed ballot from its own concern. A person approves from the fleet console,
and three executors race for the irreversible step, which the Raft ordered log commits
exactly once. The model calls are Spring AI ChatClients with structured output. Under
-Pembabel, the fleet’s capability cards become a generated Embabel agent, and GOAP plans
across the local and fleet actions together.
The example from the Spring blog post Spring AI and TypeSafe Jev, moved onto AgentSpaces. A customer ticket is drafted by Claude Haiku on a peer that holds no API key: the prompt travels through the space to the one model-server peer that does. TypeSafe Jev judges the draft with typed answers for urgency, department, and frustration, plus a verdict, and writes them back as a signed entry. A failed draft comes back as a retry ticket that carries the feedback. A billing case is taken exactly once through the ordered log, a reduce keeps the pass rate per department, and three judge peers vote on whether a very angry customer gets a person.
Grok on plain Java with LangChain4j, GPT on Spring Boot with Spring AI, and Claude on Micronaut join one fleet. They share one model service, chat memory, and usage ledger, so any peer can call any vendor’s model without holding that vendor’s key. Together they run an OSINT research desk on fictional tickers. Services auctioned across the peers fill a shared knowledge base, which a vector store and a Clojure/DataScript knowledge graph index. The three models vote buy, sell, or hold, the paper trade runs exactly once on an ordered log, and Claude writes the dossier. A web-search peer started mid-session is in the next inquiry’s plan within seconds. Files travel over the content swarm, new in 0.5.0. GPT publishes the filings, Claude fetches and reads them, and each inquiry’s dossier, chart and deck are files every peer fetches in pieces from every peer that holds them. The fleet test kills GPT and still fetches a filing it published, every byte served by Claude. Needs JDK 25 and, for the graph peer, the Clojure CLI.
The Senate Committee on Keeping It Real votes on a slate of silly motions. Its eleven
senators sit on two Spring Boot peers and in a resident browser tab. Some are scripted,
some are LLM personas, and the browser casts the deciding vote, because the committee has
no quorum without it. A gallery web page joins the fleet with one joinCouncil call over
wss and renders the live scoreboard. A Node process is the third voter of the ordered log
that minutes each decision, and the demo kills that log’s leader mid-session. A Durable
Object on workerd keeps the Hansard, which records each decision once even under a forced
retry. Two more pages pass whip notes over a direct WebRTC channel. Needs Node 22 and the
built agentspaces-typescript workspace beside this directory.
After Guillaume Laforge’s post Reranking RAG results with Gemini Decision 1 and
LangChain4j. His DecisionScoringModel over gemini-decision-1 runs on the one peer
that holds the Gemini key; the desk peer’s ReRankingContentAggregator reaches it through
FleetScoringModel, with a keyless lexical scorer as the fallback when Gemini’s scorer
leaves. A guardrail policy in the fleet refuses planted ranker-steering pages before they
are scored, and the README records what gemini-decision-1 did with them when nothing
screened them. Needs agentspaces-langchain4j 0.8.0 (install it locally until it is
released).