Framework Comparison & Adoption Guide
The JVM ecosystem already provides capable LLM client libraries such as Spring AI, LangChain4j, and Google ADK (Java). OpenHusky targets a distinct architectural layer: a framework-agnostic, embeddable Agent Runtime microkernel designed for stateful, steerable, fail-closed agent execution on Java 21 Virtual Threads.
Objective Architecture Comparison
| Capability | OpenHusky (0.3.0) | Spring AI | LangChain4j | Google ADK (Java) |
|---|---|---|---|---|
| Primary Architectural Role | Embeddable Agent Runtime microkernel (durable loop, live control, permissions, sandboxes, protocols) | Spring-native AI integration layer (ChatClient, Advisors, VectorStore, Boot Starters) | LLM / RAG / AiServices toolkit and model/embedding ecosystem | Agent orchestration SDK aligned with Gemini & Google Cloud workflows |
| Framework Coupling | Zero in core, AI gateway, session, and protocol modules (ArchUnit-enforced) + optional openhusky-spring-boot-starter | Tightly coupled to Spring Framework / Spring Boot | Lightweight core with dedicated Spring Boot / Quarkus integrations | Independent Java SDK (RxJava / Vert.x / Spring integrations vary by module) |
| Concurrency Model | Native JDK 21 Virtual Threads with ReentrantLock I/O guards and explicit ToolContext / AbortSignal | Servlet / WebFlux (Flux) depending on stack | Synchronous / streaming callbacks (TokenStream) | Reactive / async flow abstractions |
| Session Persistence Model | Event-sourced append-only tree (fork, rewindTo, StatePatchEntry, cut-point-safe compaction) | Flat ChatMemory message list | Flat ChatMemory message list | SessionService (in-memory / DB event list) |
Mid-Run Control (steer / followUp / abort) | First-class dual-queue control at tool boundaries + cooperative AbortSignal | Not built-in | Not built-in | Interrupts via callback / runner controls |
| Tool Authorization & HITL | Fail-closed PermissionPolicy + race-free ApprovalDecision.Handler + AG-UI /approve broker | Manual / custom Advisors | Manual / custom interceptors | Callback / tool confirmation hooks |
| Multi-Tenant Isolation | Built-in Principal(id, tenantId) + SessionAccessPolicy (TENANT_ISOLATED default) + HTTP 401/403 SPI | Application-managed | Application-managed | App / user / session scoping |
| Streaming UI Protocol | Native AG-UI v1.0 SSE + RFC 6902 STATE_DELTA + progress events | Custom SSE / Flux | TokenStream (custom schema) | ADK Web / SSE event stream |
| Execution Sandbox Plane | Built-in L0–L4 AgentSandbox (InMemory, LocalHost, LocalOs bwrap/Seatbelt, Docker) | External / custom | External / custom (CodeExecutionEngine) | Container / code executor plugins |
Agent Skills (agentskills.io) | Native 3-stage progressive SKILL.md + AGENTS.md loader | Not built-in | Not built-in | Not built-in |
| MCP Client | Native MCP 2025-11-25 (Stdio & Streamable HTTP, OAuth 2.1 PKCE) | Supported (via MCP Java SDK) | Supported | Supported (MCPToolset) |
| RAG / Vector Stores | Intentionally outside core (expose any retriever as a PARALLEL_SAFE @Tool) | Rich built-in VectorStore ecosystem | Rich built-in EmbeddingStore ecosystem | Retrieval tools / Vertex RAG |
Decision Guide
When OpenHusky Is the Best Fit
Choose OpenHusky when building interactive, stateful, multi-step AI agents with strict operational guarantees:
- Live user intervention: Callers need to redirect (
steer()), queue (followUp()), or cancel (abort()) an active agent mid-run while preserving valid tool-call history. - High-stakes actions & compliance: Financial transactions, refunds, workspace edits, or external mutations require fail-closed allowlists, audit trails, and interactive HITL approvals.
- Multi-tenant B2B / SaaS: Shared deployments require enforced tenant boundaries across persistence, tool injection (
Principal), and HTTP endpoints (401/403). - Branching, compaction & observability: You require non-destructive
fork()/rewindTo(), cut-point-safe compaction, and OpenTelemetry GenAI spans across virtual threads. - Framework freedom: You want one runtime core that embeds cleanly into Spring Boot, Micronaut, Quarkus, Ktor, Vert.x, or standalone JDK 21 services without Reactor/Netty dependency conflicts.
When Spring AI or LangChain4j May Fit Better
Choose Spring AI or LangChain4j as your primary library when:
- Your workload consists of stateless single-turn completions, document ingestion, or RAG pipelines where a broad catalog of
VectorStore/EmbeddingStoreintegrations is the main requirement. - You prefer Spring's
ChatClientAdvisor pipeline and do not need tree-structured sessions, mid-run steering, execution sandboxes, or AG-UI state deltas.
Hybrid Architecture Patterns
OpenHusky is explicitly designed to compose with existing Spring Boot infrastructure and vector databases:
- OpenHusky + Spring Boot 3.4+: Use
openhusky-bomandopenhusky-spring-boot-starter(0.3.0) to expose@OpenHuskyToolsbeans (with@Transactional/@CacheableAOP proxies preserved) and Spring MVC AG-UI SSE endpoints. See Embedding in Spring Boot. - OpenHusky + Existing VectorStore / RAG: Retain your Spring AI
VectorStore, LangChain4jEmbeddingStore, or PostgreSQLpgvector/ Elasticsearch retriever and expose it as aToolExecutionMode.PARALLEL_SAFE,readOnly = true@Toolmethod. OpenHusky governs the agent loop, authorization, context compaction, and streaming while your retriever executes hybrid search.