The Swim backend runtime provides a self-contained application server for hosting stateful Web Agents. The runtime provides Web Agent applications with:
- Compute Scheduling: Each Web Agent runs in a long-lived logical compute process that executes arbitrary application code in response to real-time state changes, scheduled timers, and other system events.
- State Management: The program state of each agent is preserved locally between operations. Processing latencies are measured in nanoseconds—the time needed to access local memory.
- Local Persistence: Unused state is transparently persisted to local disks, when available. Web Agents pick up where they left off afte a restart. And vastly more data than fits in main memory can be maintained as agent state.
- Cache Coherence: Web Agents operate on locally materialized views of remote states. Real-time changes made to one view of a shared state propagate to all other linked views with ping latency. A cache coherent streaming memory model ensures that all views consistently converge to the same state.
To embed the Swim backend runtime in a Java application, add the swim-runtime
library as a dependency of the project.
compile group: 'org.swimos', name: 'swim-runtime', version: '4.1.0-SNAPSHOT'
<dependency>
<groupId>org.swimos</groupId>
<artifactId>swim-runtime</artifactId>
<version>4.1.0-SNAPSHOT</version>
</dependency>
The Swim backend stack runs on any Java 11+ JVM. Depending only on the minimal
java.base
module, it has no other Java library dependencies.
Install a Java 11+ JDK, such as OpenJDK or GraalVM.
The stack is built with Gradle, which can be invoked via the
included gradlew
script.
./gradlew compileJava
./gradlew test
./gradlew :javadoc
Take a look at the Contributing Guide to learn about our submission process, coding standards, and more.