Compared · checked 26 October 2026

SoPhi, Koog, LangChain4j and Spring AI compared

Written by SoPhi's author, so read it with that in mind. Every fact about the other projects links to their own documentation.

The short answer

They are not all the same kind of thing. Spring AI is a layer for talking to models; the other three run agents. SoPhi itself uses Spring AI to reach its models.

Side by side

SoPhiKoogLangChain4jSpring AI
What it isAn agent harness: one loop plus sessions, memory, learning and planningAn agent framework from JetBrainsAn LLM library with AI services, RAG and agentic workflowsSpring's layer for models, tools, memory and MCP
LanguageKotlin, JDK 21+Kotlin, with a Java API; JDK 17+Java, with Kotlin supportJava, Spring Boot 4
StatusPre-release; build from source (not on Maven Central yet)Stable 1.x since May 20261.x, released every few weeks; the agentic module is marked experimental2.0 GA, June 2026
LicenceApache 2.0Apache 2.0Apache 2.0Apache 2.0
How an agent runsA single tool-calling loop, configured with a builder DSLGraph workflows, with functional and planning strategiesAI services; agentic workflows: sequential, loop, parallel, conditional, supervisorChatClient, with the tool-calling loop inside the advisor chain
PlanningBreaks a goal into a plan, works through it and replans; the CLI's /goal --check runs until a check passesPlanning strategy (GOAP)Supervisor and custom planners; goal-oriented patternBuild it yourself on advisors
SessionsAppend-only JSONL session tree that survives a crash; branch and check outPersistence restores agent state at checkpointsChat memory; agentic workflows can resume after a suspension or crashChat memory repositories
Long-term memoryA memory palace on embedded ArcadeDB (experimental)Embeddings and RAG across conversationsChat memory and RAGChat memory, vector stores and RAG; auto-memory tools in a community project
Learning from useTool reliability stats, lessons distilled at session end, user feedback, dataset exportNot described as a built-in feature in their documentation
SkillsMarkdown skills loaded on demand; the agent can write new ones, behind safety checksNot describedNot describedAgent Skills in a community project
MCPClient (stdio and HTTP) and serverMCP tools in agentsMCP client agents; A2AClient and server, with annotations
Several agentsSubagents defined in plain Markdown files, called like a toolGraph workflows; Agent Client ProtocolAgentic workflows and A2APatterns you compose
ModelsClaude, and any OpenAI-compatible server (Ollama, LM Studio, llama.cpp); local by defaultOpenAI, Anthropic, Google, DeepSeek, OpenRouter, Ollama, BedrockMost major providers and local serversOpenAI, Anthropic, Bedrock, Google, Mistral, DeepSeek, Ollama and more
Runs onJVMJVM, Android, iOS, JavaScript, WasmJVMJVM
Ways to use itLibrary (Sophi.runtime { }), terminal app, REST and SSE serverLibrary; Spring Boot and Ktor integrationsLibrary; Spring Boot and Quarkus integrationsSpring Boot starters

Spring AI

Spring AI doesn't try to be an agent framework. It gives Spring Boot apps one way to call models, run the tool-calling loop, keep chat memory, and serve or call MCP tools. In 2.0 the tool loop moved into the advisor chain, so you can wrap and change it like any other advisor. Choose it when you want to write the agent's behaviour yourself, on Spring.

SoPhi uses Spring AI for exactly this. Its provider module wraps Spring AI, and the agent loop never imports it.

LangChain4j

LangChain4j brings ready-made building blocks to Java: AI services declared as interfaces, chat memory, RAG, and a large set of integrations. Its agentic module adds workflows (sequential, loop, parallel, conditional) and a supervisor that plans which agent to call next, plus MCP and A2A client agents. Choose it when you want those patterns decided for you, in Java. The agentic module is still marked experimental.

Koog

Koog is JetBrains' agent framework, written in Kotlin with a Java API, stable since 1.0 in May 2026. Agents are graph workflows, with functional and planning strategies as alternatives. It has persistence, history compression, OpenTelemetry tracing, and it runs beyond the JVM: Android, iOS, JavaScript and Wasm. Choose it for multi-step workflows you want to see as a graph, or for agents that must run on devices.

SoPhi

SoPhi keeps the agent to one loop, and builds in what that loop needs to run for weeks rather than minutes:

The trade-offs are real: SoPhi is younger and smaller than the other three, runs only on the JVM, is Kotlin-first, and isn't on Maven Central yet. Choose it when you want those built-in parts more than a large ecosystem.

Why we wrote our own loop instead of using Koog or LangChain4j is in Why we built a Kotlin agent harness instead of using one.

Questions

Can I use Spring AI and SoPhi together?

Yes, SoPhi already does: Spring AI is how SoPhi reaches Claude and OpenAI-compatible servers. You can also embed SoPhi in a Spring Boot app; its web server is one.

Which one runs fully on a local model?

All four can use Ollama. SoPhi starts on a local model by default (Ollama, LM Studio or llama.cpp) and only uses Claude when you choose it.

Which one should a Java team pick?

Spring AI or LangChain4j are the natural fit; Koog has a Java API too. SoPhi is written for Kotlin.

Sources

Something out of date or wrong? Email hello@sophiloop.com and we'll fix it.