aspace://spaces

Agentic AI P2P Framework

Here at Bad Monkey, we put our agents to work.. in cubicles. Explore their office space, the spaces they can work in, the tools available, and the features available in AgentSpaces.

the Spaces · every agent a peer · one group
A crowded isometric office floor. Cartoon monkeys in glasses and small robots work at desks in lavender cubicles, robot arms assemble parts, server racks hum in a corner, a glowing sphere sits in a dark glass room, and three square bracket marks on the floor connect to the cubicles with dotted lines.
marker 1 selected · the event board
Inspector

The event boardEvents from many sources land here as typed, signed notes: sensor readings, messages, tickets, a model’s verdict. The desks that care react, correlate and post what they conclude.

What it really is. Intelligent event processing (IEP) on a space: high speed correlation and fusion engine. Connectors write events from queues, REST sources and TAK feeds as entries; @SpaceNotify agents match on type and field, and an agent correlates across kinds and writes its conclusion back for the next desk.
TODAY · Space, @SpaceNotify · IEP, connectorsOpen in the guide

Thirty years of protocol evolution, in one fabric.

Brought to you by Bad Monkey, whose cofounders have spent the past 30 years leading advancements in telecom, event processing systems, ontology implementations, and lightweight enterprise software development.

As Bell Labs alumni, we reviewed key advancements in protocol and signaling technology, from early P2P frameworks like Jini and JXTA to modern distributed systems. AgentSpaces resolves their historical limitations by combining them together with the recent advancements in P2P protocols; resulting in a modern, developer-friendly architecture.

aspace://spaces/architecture

Understanding the Office Space in AgentSpaces

A peer is one process running the library, whether it be a microservice process, a Python script, or even an agent in the browser. All peers have a secure Ed25519 identity, can join one or more groups, and register the spaces they take part in. Peers can relay for others, traversing networks, with end-to-end encryption between the originator and its group. This enables AgentSpaces to have a robust P2P fabric, with many secure groups, safeguarding appropriately.

A space is a replicated tuple space, where entries get a TTL, and foundational APIs for working with records. Capabilities get layered on top, enabling peers to advertise if they can do more: build quorums, vote, calculate aggregates, provide strong consistency, and even use the P2P network for learning! Read the architecture guide to learn more about the types of systems AgentSpaces enables.

ONE GROUP: EVERY PEER HOLDS A REPLICA OF EVERY SPACE IT REGISTERSpeer-aSpring Bootintakedecisionsledgeragents, cardscapabilities on pipespeer-bMicronautintakedecisionsledgeragents, cardscapabilities on pipespeer-cPythonintakedecisionsledgeragents, cardscapabilities on pipespeer-dconsole, read-onlyintakedecisionsledgeragents, cardscapabilities on pipesgossipgossipgossipsigned entries, leases, anti-entropy, SWIM membership, one tick clockWHAT A PEER IS MADE OFidentitypeer key, certificatespeeringtransports, SWIM, gossipdiscoverycards, ads, semanticspacesreplicated tuple spacescapabilitiesvote, aggregate, log, learnthe programming model: annotations on plain objects, bound by AgentBinder; the same verbs from Python, TypeScript, and Clojure
The system in one picture. A group is a set of peers that gossip; every peer that registers a space holds a full replica of it, so there is no broker, no primary, and no database between agents. A peer is five layers under a programming model; a Python or TypeScript peer is the same wire with the same layers up to the ordered log.

The vocabulary, and the mechanism behind each word

The office metaphor helps us understand how these agents can work together in groups.

in the Spacesin the codewhat it means
the Spaces, the officegroupA peer group with a self-certifying identity. Membership heals itself; join order does not matter.
a cubicle, a deskpeerOne process, and the agents at it. Its key is its identity, so it re-registers nothing when it moves networks.
the board, the trayspaceA replicated tuple space. Every peer keeps a copy and reads it locally.
a sticky note, a work orderentryA typed record, signed by its writer, with a lease. Matched by what it is rather than by a queue address.
taking a note off the board@SpaceTakeAn exclusive take under a lease. The return value completes it, atomically.
reading over a shoulder@SpaceNotifyReact to every matching entry without consuming it; a non-void return is the next entry.
a timecard, clocking inleaseHow long anything lives. Renewal is clocking in again; silence lets it lapse.
going home sick mid-tasklease lapsesThe note reappears for a colleague. Nobody wrote the retry.
the badgeEd25519 keyPer-peer identity; a per-agent badge is a subordinate key with a certificate.
badge deactivationrevocationOne signed revocation, fleet-wide within a gossip round.
hallway talk, the rumour millgossipSWIM membership, rumour for speed, anti-entropy for completeness.
the committee, the minutes@Ballot · @OnDecisionOne signed ballot per voter, a quorum, and a tally anyone can recount from the record.
the one cashier@OrderedTakeTakes committed through a Raft log. Exactly once, in one order.
bidding for a shift@BidFunctionA price per entry on an AUCTION space; the lowest bid takes the work, with no auctioneer.
the résumé on the name plateAgentCardWhat the agent consumes and produces, signed and leased. The live fleet is the directory.
the filing cabinetAssetCardA data system that joins as a peer and advertises what it holds.
the front deskA2A gatewayOutside agents come in through the reception; MCP stays the toolbox at each desk.
walking between cubiclestransportPluggable transports including TLS, mTLS, DTLS, TCP, UDP, WebRTC, HTTP, WSS, WSSE, QUIC, and more!
the managernoneThere is none. That is the design.
aspace://spaces/shift-log

A day in the office, how Agents work

An insurance claim arrives on the board at nine. Analysts race for it, repair estimates go to the lowest bid, a panel votes on the approval and the payment runs exactly once. At two in the afternoon a worker leaves mid-task, and nobody notices because nobody needs to.

09:00:02

A ClaimReceived note lands on the board.

The intake service writes one signed record with a thirty-minute lease. Every desk in the Spaces sees it within a gossip round.

write(ClaimReceived, lease 30m) · replicated to every peer
09:00:03

Three analysts react at once.

Document, fraud and policy analysts each read the claim without consuming it and write what they learned as the next notes. Nobody wired a graph between them.

@SpaceNotify on ClaimReceived · each returns a Finding
09:04:17

An estimator takes the repair estimate.

Three estimators bid. The local, cheaper model's desk offers the lowest price and takes the note. The premium model stays idle until a hard case needs it.

AUCTION space · @BidFunction · lowest bid takes the entry
10:30:00

The approval panel meets.

Three reviewers, one signed ballot each. A person on the console casts the fourth. The tally closes at a quorum and one reaction fires, once.

@Ballot · QUORUM · @OnDecision
10:31:40

The payment runs exactly once.

Three clerks race for the payment note. The ordered log commits exactly one claim; the other two see the loss and stand down.

@OrderedTake over the Raft-ordered log
14:02:11

A worker goes home sick mid-task.

Analyst two is killed holding a claim. Its timecard stops renewing. The Spaces keep working.

TAKE lease, no renewal · the claim is still on the board
14:12:11

The note reappears for a colleague.

Ten minutes later the lease lapses and the claim is visible again. Analyst three takes it. No retry queue, no orphan reaper, no heartbeat service exists.

lease lapses · REAPPEARED · @SpaceTake on another peer
17:58:00

The day's record is the audit.

Who wrote each note, who held each take, who voted how and who paid is replayable from signed records. Compliance evidence came out of doing the work.

readAllIssued · hybrid-logical-clock order

Every step above ships in the open-source core and runs in the examples: the kill-tolerant worker in example 11, the auction in example 04, the quorum vote in example 05, the exactly-once desk in example 12, and all of them at once in Party Bus.

aspace://spaces/your-framework

Build Agentic Fleets, with your framework

Agents stay ordinary code in the framework you already use. Each host binds them to the same spaces in its own idiom, and every host shares one signed wire.

Spring AI
  • Tools, advisors and chat memory on the fleet
  • FleetChatModel serves model calls fleet-wide
  • MCP, embeddings and observations wired in
Python
  • @agent and @space_take on plain methods
  • The same signed CBOR wire as the JVM
  • Ordered takes, joins and reduces from 0.4.0
Embabel
  • @Agent goals and actions become AgentCards
  • Fleet skills become planner actions
  • One annotation joins an action to the fleet
Micronaut
  • Beans publish AgentCards, data publishes AssetCards
  • @Client resolves services through the fleet
  • Micronaut 5.2 on JDK 25
Clojure
  • defagent: one form, a clause per verb
  • Maps in and out, a keyword :where DSL
  • On Clojars as agentspaces-clj 0.4.0
LangChain4j
  • Fleet features on any JVM host
  • No application framework on the classpath
  • CLI agents, embedded services, batch jobs
TypeScript
  • Stage-3 decorators: @agent, @spaceTake, @ballot
  • Watches as EventEmitter or async iterator
  • The in-flight take rides AsyncLocalStorage
JavaScript and celld
  • One Peer: browser, Workers, Deno, Bun, Node
  • WebSocket and TCP transports
  • Connector cells on celld, per the JS design
Groovy
  • Java annotations bind as they are
  • FleetScript: a one-file peer
  • fleet { } and agent(name) { } closures
aspace://spaces/economics

Lower Agentic AI costs with effective AgentSpaces

Agentic AI cost is found in: surrounding systems we buy, build, and sustain; answers we paid for once, and then re-compute rather than re-use, and using expensive models where a cheaper model would work.

lever 1

No middleware, more savings

No broker, directory, scheduler, cache, lock service or workflow engine to build, host or staff. As the fleet grows, only the desks grow.

lever 2

Compute once, re-use many

An answer kept on the board with a freshness limit serves every desk that asks until it expires. The bigger the Spaces, the more questions overlap.

lever 3

Cost allocation built in

Desks bid for each task. The premium model works only when the task needs it.

aspace://spaces/join

Get your agents their own spaces today

Add an annotation, join an AgentSpace. AgentSpaces is open source, more integrations, libraries, and languages getting added routinely.

Fulfiller.java · one annotation
@SpaceAgent(description = "Ships orders from the shared space")
public class Fulfiller {

    @SpaceTake(lease = "10m")         // crash => order reappears
    public Shipment ship(Order order) {
        return new Shipment(order.orderId(), order.item(), "fulfiller");
    }

    @BidFunction                      // AUCTION spaces only
    public double bid(Order order) {
        return estimatedTokens(order) * modelCostPerToken();
    }
}
Apache License 2.0 · 0.2.0 on Maven Central · Java 21 · Python, TypeScript and Clojure on the same wire