In short.
ai4j is a Java SDK for developers building generative AI applications on JDK 8 or later. Its captured README and LICENSE state that it is under the Apache License 2.0. The main catch is that this analysis covers only the README, which is mainly in Chinese, so the many feature claims were not checked against code, documentation or a run. The README describes one factory interface over 12 or more model platforms (OpenAI, Anthropic, DeepSeek, Zhipu, Doubao, Ollama and others), Chat, Responses and Messages protocols, ReAct, CodeAct and Deep Research agent modes, graph orchestration, a built-in RAG pipeline, MCP client and server, A2A, a Spring Boot starter, a plugin system, a durable task runtime called ai4j-harness and a coding agent with CLI, TUI and ACP entry points. Apache 2.0 grants a no-charge, royalty-free licence; software pricing and external service costs are not stated. Nothing here was installed or executed.
Researched and written by an AI model and checked by a second AI model. How it works
The analysed scope is one file: the README.md of the LnYo-Cly/ai4j repository at revision a48b30c7c0e9572ba9c4aff7af643fb9e148b7f9. The repository's Apache License 2.0 LICENSE file at the same revision was read beside it as the licence notice. The documentation site, English README, source code, tests, release notes, install scripts, plugin repositories and any NOTICE file were not covered. Nothing was installed, compiled, executed or tested, so every capability described is a claim made in the README and not a verified result.
The overview
What this resource is
ai4j is a Java library, described in its README as a Java AI Agentic development kit for JDK 8 and later. It is published on Maven Central under the group io.github.lnyo-cly and the artifact ai4j, and the README gives version 2.8.1 in its Gradle and Maven snippets. The repository is LnYo-Cly/ai4j on GitHub, and the analysed file is the top-level README.md at revision a48b30c7c0e9572ba9c4aff7af643fb9e148b7f9.
The README is a project overview and entry point rather than an API reference. It points to a documentation site [https://lnyo-cly.github.io/ai4j/], an AI question-and-answer guide to the repository on DeepWiki [https://deepwiki.com/LnYo-Cly/ai4j], an English README (README-EN.md) and many pages under docs-site and docs. None of these were captured.
Beyond the core SDK, the README names related modules: ai4j-spring-boot-starter, ai4j-harness, ai4j-cli, ai4j-testing and ai4j-plugin-ask-user, plus plugins in separate repositories. It is therefore a family of modules, not a single jar.
Overall assessment
On the evidence of the README, ai4j is a substantial and ambitious SDK. It has concrete install coordinates, a short code sample, a Spring Boot path, a stated licence and a documentation site. It covers a wide area for one library: model access, agents, RAG, MCP, A2A, long-running task governance, plugins and a coding agent.
The README is a promotional document written by the project itself. It makes many strong claims, such as a complete RAG chain, resumable tasks and full protocol support. None of them is backed here by tests, benchmarks, issue history or code. The README does not show how mature, stable or well tested any single module is, so module maturity is unknown. If you work in Java, ai4j may be worth a hands-on evaluation, but check each module you plan to use on its own.
This is a desk review of one file and its licence notice. Nothing was installed, compiled or run.
Who it is for
The README targets Java developers who want to add large language model features to JVM applications. Because it states support for JDK 8 and later, this includes projects that still run on JDK 8. The Spring Boot starter, which injects an AiService bean from YAML configuration, suits Spring teams.
Besides OpenAI, Anthropic, DeepSeek and Ollama, the platform list names DashScope (Tongyi/Bailian), Doubao (Volcano Ark), Zhipu, Hunyuan, Lingyi, Moonshot, MiniMax and Baichuan, so teams already using any of these providers are a natural audience. The main README is predominantly Chinese. It links an English README and describes the documentation site as bilingual, but neither was captured, so their language coverage and completeness are unknown.
The ai4j-harness section targets teams that need agent tasks that survive restarts, can be resumed, and pass review gates. Its examples are approval flows, long business processes and automations that need a human to confirm. The coding-agent CLI targets developers who want a local coding assistant or a base for building their own.
It is not aimed at people who want a hosted, no-code product or who work mainly in Python or JavaScript.
What it can do (as claimed)
Model access: one factory (AiService) returns services for 12 or more platforms. The README lists OpenAI and OpenAI-compatible endpoints, Anthropic, DashScope, Doubao, DeepSeek, Moonshot, Zhipu, Hunyuan, Lingyi, Ollama, MiniMax, Baichuan and Suno. It also lists rerank services (Jina, Ollama, Doubao) and AgentFlow connections to Dify, Coze and n8n. It claims Chat, Responses and Messages protocols, Function Calling, SSE streaming, embeddings, rerank, image, audio, video and music generation and realtime conversation. Switching platform is said to need only a PlatformType change, and several API keys can coexist and be routed by name.
Agents: ReAct, CodeAct and Deep Research execution modes, StateGraph orchestration with conditional branches and loops, subagent delegation and multi-agent teams.
ai4j-harness: tasks persisted to File or JDBC storage that can resume after a restart, worker leases to prevent duplicate work, review and acceptance gates before a task counts as complete, a ledger of dependencies, facts, decisions and evidence, and task-type presets. A person can also promote accepted decisions to runtime rules.
RAG: document loading (optional Tika for PDF, Word and Excel, or the MinerU cloud service for scans, formulas and complex layouts), chunking, vector store adapters, hybrid retrieval, reranking and citations. The README explicitly names eight vector store adapters: Pinecone, Qdrant, pgvector, Milvus, Redis, Elasticsearch, Chroma and InMemory. It says the whole chain is built into the SDK with no separate retrieval framework needed. These are project claims, and how the adapters are implemented is unverified.
Interoperability: MCP client and server over Stdio, SSE and Streamable HTTP, and A2A agent-to-agent support.
Control and observability: sandboxed execution, permission approval, hooks, skills, memory compression, checkpoints, call tracing and an event-sourced session log that can be replayed, forked and searched offline.
Other features named in the README: RAG online evaluation with an LLM judge, prompt caching and declarative Agent Blueprint assembly. It also names ai4j-testing, whose record-and-replay fixtures let you regression-test agent behaviour without real keys, an integration with a decision model called TypeSafe System One (Jev), and FlowGram visual workflows.
Using it
What you need
For the library: JDK 8 or later and a build tool. The README gives Gradle and Maven coordinates. For the Spring Boot route, a Spring Boot project and the ai4j-spring-boot-starter dependency.
For the first-request sample: an OPENAI_API_KEY environment variable and access to the gpt-4o-mini model. For other providers, the README says to swap the PlatformType and the matching config. What each provider needs for authentication depends on the provider and is not fully documented in this file, nor are the config classes and models available for each provider.
For the coding-agent CLI: Java 8 or later, network access to Maven Central and to the install script host, and whatever access or authentication your chosen model provider requires. The README's example commands name models such as gpt-5-mini and glm-4.7 and a Zhipu coding endpoint; whether those models are available to you is outside the evidence.
Optional pieces bring their own requirements. For RAG, the README names an in-memory store alongside external vector stores (Pinecone, Qdrant, pgvector, Milvus, Redis, Elasticsearch and Chroma), so an external store is a choice rather than a stated requirement. ai4j-harness keeps task state in File or JDBC storage, so you need a database only if you choose JDBC. Document parsing can use Tika or the MinerU cloud service. MCP servers and Dify, Coze or n8n instances are needed only if you connect to them. The README does not describe versions or setup for any of these.
The README does not state hardware needs, minimum memory or supported operating systems for the CLI. The only platforms it mentions are the install-script targets: Linux, macOS, Git Bash and Windows PowerShell.
How it works
The README describes a layered design. A Configuration object holds the config for each platform (for example OpenAiConfig). AiService is built from it and returns service interfaces such as IChatService for a given PlatformType. Request and response classes appear to follow the OpenAI chat shape (ChatCompletion, ChatMessage, ChatCompletionResponse), and the README says you reach other platforms by swapping the PlatformType and config.
Agent features sit on top of those services: tool calling, skills, MCP tools and orchestration modes, with StateGraph named for graph orchestration. ai4j-harness adds durable state, leases and acceptance gates around agent tasks. The README describes File and JDBC persistence for harness task state and the ExtensionRegistry gate sequence for plugins. It does not establish storage schemas, how leases are implemented or how acceptance gates are configured.
Extensions work through plugins that are ordinary Maven jars discovered with Java ServiceLoader. An ExtensionRegistry applies three gates (discover, enable and exposeTool), so adding a dependency does not turn a plugin on. Each plugin gets its own class loader. A failed apply is rolled back and its class loader cleaned up, and exposed tools must use a plugin__<id>__<tool> name. The README states that this isolation is not a security sandbox.
The coding agent (ai4j-cli) offers three entry points: code for one-shot or interactive use, tui for a terminal interface, and acp for IDE integration. It stores provider profiles in ~/.ai4j/providers.json. It also offers session resume, fork and replay, subagents and agent teams, a skills directory, MCP, tool approval and background process management.
Setup
Library: add implementation 'io.github.lnyo-cly:ai4j:2.8.1' to Gradle, or the equivalent Maven dependency with the same group, artifact and version. Then build a Configuration, set the provider config (the sample sets an OpenAI API key), create an AiService and ask it for the chat service for a PlatformType.
Spring Boot: add io.github.lnyo-cly:ai4j-spring-boot-starter:2.8.1, set ai.openai.api-key to ${OPENAI_API_KEY} in YAML, and autowire AiService. The README also describes named platform entries (ai.platforms[].api-key-env) that hold the name of an environment variable. The variable is resolved when the context is assembled and takes priority over a plain-text key, so keys need not be stored in files.
CLI: the README gives two one-line install commands, each of which downloads a script from the project documentation site and pipes it straight into a shell. For Linux, macOS and Git Bash, the command uses curl with the options -fsSL to fetch the script at [https://lnyo-cly.github.io/ai4j/install.sh] and pipes it to sh. For Windows PowerShell, it uses irm to fetch [https://lnyo-cly.github.io/ai4j/install.ps1] and pipes the result to iex. The README says the script fetches ai4j-cli from Maven Central and creates an ai4j command. Piping a remote script into a shell runs whatever it contains at that moment, and the script was not captured, so read it first or install another way.
Version 2.8.1 is what the README states; whether it is the latest release is not shown in the evidence.
Example from the README
The README's thirty-second example assumes an OPENAI_API_KEY environment variable is set. In a main method it creates an OpenAiConfig with the API key read from the environment, puts it in a Configuration, builds an AiService, and calls getChatService(PlatformType.OPENAI) to get an IChatService. It builds a ChatCompletion request for model gpt-4o-mini with one user message (in Chinese, asking for a one-sentence introduction of ai4j), calls chatCompletion, and prints response.getChoices().get(0).getMessage().getContent().getText().
The README shows a sample output sentence saying ai4j is a JDK 8+ Java AI agentic development kit that unifies several model services. That output is the README's own illustration. The code was not run, so it is unconfirmed whether it compiles or behaves as shown.
For the coding agent, the README shows three commands. The one-shot form is ai4j code --provider openai --protocol responses --model gpt-5-mini --prompt "...". The terminal UI form runs ai4j tui with provider zhipu, protocol chat, model glm-4.7, a base URL of [https://open.bigmodel.cn/api/coding/paas/v4] and the current directory as workspace. The IDE form is ai4j acp --provider openai --protocol responses --model gpt-5-mini --workspace . (the final dot means the current directory). None of these commands were run either.
Assessment & evidence
Limitations and risks
Evidence limits: only the README and the licence text were read. Source code, tests, the documentation site, release notes, issues and the English README were not. Every capability above is an unverified project claim, and quality, performance, error handling and API stability are not assessed.
Documentation language: the main README is predominantly Chinese; it describes the documentation site as bilingual, but the linked pages' language coverage is unknown. The sample prompt is in Chinese, which does not affect how the library works.
Module maturity: the feature list is broad. It covers model access, agents, RAG, MCP, A2A, the harness runtime, plugins, a coding agent, image, audio, video and music generation, realtime conversation, FlowGram and a decision-model integration. The README does not show how mature, tested or stable any single module is, so module maturity is unknown.
Safety: the CLI is a coding agent that can run tools and background processes. The README mentions sandboxing, approval and hooks, but how strong they are was not assessed. The README states plugin isolation is not a security sandbox, so untrusted plugins should not be enabled. The recommended install pipes a remote script into a shell. A person should review what harness and agent features are allowed to do before they act on business data.
Provider coverage: the README says switching platform needs only a PlatformType and config change, but it does not document which features, protocols and models each provider supports, so it is unknown whether features work the same across providers. Model names in the examples may become outdated.
Java baseline: the README claims JDK 8 and later, but which modules, including the CLI and TUI, actually work on JDK 8 was not checked.
Why this reading
The resource is classed as a code library because its main distribution is a Maven Central SDK with a Spring Boot starter. The coding-agent CLI, the harness runtime and the plugin system ship as modules around that library, so the library framing fits better than a single end-user application.
The assessment is cautious because the only evidence about behaviour is the project's own description. Concrete, checkable details raise confidence that this is a real project: Maven coordinates, specific class names in the sample, named transports (Stdio, SSE, Streamable HTTP), named storage back ends (File and JDBC), a named config key (ai.platforms[].api-key-env) and a stated plugin gate sequence. Specific details are not proof of working behaviour, so they are reported as claims.
Where the README is silent, as with prices, release dates, module maturity, how features differ across providers and the copyright holder, this report says so instead of filling the gap.
Alternatives
The README links to a comparison page (docs-site/docs/reference/about/comparison.md) that was not captured, so its contents and the project's comparative conclusions are unknown from the supplied evidence.
The captured README names no alternative libraries and makes no comparison with any, so this report makes no claim about how ai4j compares with other options. Features the README itself emphasises, which a reader may want to weigh in any comparison, include JDK 8 support, one factory over many providers, the ai4j-harness runtime for durable governed tasks, and a built-in coding agent.
Evidence used
Evidence one is the repository README.md (13,918 bytes) at revision a48b30c7c0e9572ba9c4aff7af643fb9e148b7f9, captured on 14 November 2026. It supplies the description, feature claims, install coordinates, Spring Boot and CLI instructions, the sample code, the plugin model and the links to documentation.
Evidence two is the repository's LICENSE file (11,356 bytes) at the same revision, read beside the README as its licence notice. It contains the full Apache License 2.0 text, ending with the standard appendix that explains how to apply the licence. It does not name a specific copyright holder.
Missing evidence includes the source code, tests, documentation site pages, the English README, release history, issue tracker, the install scripts, any NOTICE file, and the separate plugin repositories. No claim in this report comes from running, compiling or testing the library.
Access & freshness
Costs
Apache 2.0 grants a no-charge, royalty-free licence. The README does not mention a paid edition, hosted service, subscription or usage fee for ai4j itself, and the captured evidence does not state any software pricing.
Using it may incur costs from other parties: model provider API usage (OpenAI, Anthropic, DeepSeek and so on), any commercial vector database, the MinerU cloud parsing service, web-search augmentation, and your own infrastructure for hosting or, if you choose it, JDBC storage. The README gives no prices, free tiers or rate limits for any of these, so those costs are unknown.
Agent modes, deep research and long-running tasks may make several model calls per task. The README does not quantify token use or cost, so it is prudent to set spending limits on any API key you try it with.
Licence and rights
The README's licence badge and License section point to the Apache License 2.0, and the captured LICENSE file at the same revision contains the Apache License 2.0 text. Under it, each contributor grants a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright licence to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense and distribute the work and derivative works in source or object form. Each contributor also grants a patent licence to make, use, sell, offer to sell, import and otherwise transfer the work. That licence covers only the contributor's patent claims necessarily infringed by their contributions, and it terminates for you if you start patent litigation alleging that the work or a contribution infringes a patent.
When you redistribute the work or derivative works, you must give recipients a copy of the licence and mark modified files with prominent notices saying you changed them. In the source form of any derivative works you distribute, you must keep the copyright, patent, trademark and attribution notices from the source form of the work, except those that do not pertain to any part of the derivative works. If the work includes a NOTICE text file, derivative works you distribute must include a readable copy of its attribution notices, again leaving out those that do not pertain to any part of the derivative works. That copy can go in a NOTICE file, in the source form or documentation, or in a display generated by the derivative works. NOTICE contents are informational and do not modify the licence.
The licence grants no permission to use the licensor's trade names, trademarks, service marks or product names, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file. Unless applicable law requires otherwise or it is agreed in writing, the work is provided as is, without warranties or conditions of any kind. On the same terms, contributors are not liable for damages arising from the licence or from use of the work; the licence gives deliberate and grossly negligent acts as an example of where applicable law may require otherwise. You may offer support, warranty or liability terms for a fee, but only on your own behalf.
Neither the captured README nor the captured LICENSE names a specific copyright holder or year. The LICENSE ends with the standard appendix that explains how to apply the licence, and the placeholder fields there are part of that example, not missing licence terms. Whether a NOTICE file exists was not captured.
These conclusions rest only on the captured README and LICENSE at this revision. Whether every other file in the repository is under the same terms was not established. The licences of the separate plugin repositories, of optional dependencies such as Tika, and of the third-party services and models you connect were not captured, and each may carry its own terms.
Freshness
The README was captured on 14 November 2026 at the revision above and names version 2.8.1. The commit date, release dates and the date of the last change are not in the captured evidence, so how recently the project was updated is unknown.
The README shows a live Maven Central version badge, but only the badge link was captured, not the value it displays, so it cannot be confirmed here whether 2.8.1 is still the newest release. Model names in the examples (gpt-4o-mini, gpt-5-mini, glm-4.7) and provider endpoints change over time. The README says its DeepWiki guide refreshes weekly from the repository, so that guide may not match this revision.
What to do next
If you work in Java and want to evaluate it, start small. Add the core dependency to a scratch project and run the README's first-chat sample, which uses OpenAI with an OPENAI_API_KEY; set a low spending limit on that key. Alternatively, adapt the sample to a provider you already use and follow that provider's own authentication requirements. Then try the Spring Boot starter if you use Spring.
Before relying on it, check the current release on Maven Central and read the English README and the documentation pages for the modules you plan to use. Look at the repository's issues and release notes for signs of maturity and maintenance, and confirm that the vector stores and providers you need are supported.
If you want the coding agent, read the install script before running it, or install another way, and keep tool approval switched on while you learn what it does. For ai4j-harness, pilot it on a low-risk workflow and check how state, leases and acceptance gates behave with the persistence backend you select (File or JDBC).
Before adopting any plugin or optional dependency, check its own licence, and treat plugin isolation as separation of code, not as a security boundary.
