Skip to main content

AI4J Docs

AI4J is an AI SDK for Java 8+. It is not an all-or-nothing AI platform, but a set of Java AI building blocks you can take on demand: start with ai4j to get model calls working, then bring in Spring Boot, RAG, MCP, Agent, Coding Agent, or FlowGram as your project needs them.

If you just want to fire off a first model request, start from plain Java or Spring Boot. If you already know you need tool calling, RAG, MCP, an Agent, or the Coding Agent, jump straight in from the feature map.

Start here

GoalRecommended entryWhat you get
Send your first AI request in plain JavaQuickstart for JavaMinimal deps, key config, validation, and your first model call
Get a plain Java project workingQuickstart for JavaMinimal deps, config, and your first snippet
Integrate a Spring Boot appQuickstart for Spring BootThe starter, config properties, and bean injection
See the full capability surfaceFeature MapCurrent AI4J capabilities, maturity, and reading paths
Find the canonical doc routesDocumentation MapCanonical main lines, legacy sources, and migration directions
Pre-launch checksProduction ChecklistChecks for versions, keys, tools, MCP, RAG, Agent, FlowGram
Understand why AI4J existsWhy AI4JPositioning, fit, and differences from adjacent options

Take what you need

You don't need to understand all of AI4J up front, nor pull every module into your project. The saner path is to take one module for the problem in front of you, then upgrade to the next layer when things get more complex.

What you want to do nowTakeWhen to upgrade
Model calls, tools, RAG, MCPai4jAdd the Spring Boot starter when you need containerized config
Add AI to a Spring Boot appai4j-spring-boot-starterAdd an Agent when you need richer state or orchestration
Build an embeddable Agent runtimeai4j-agentAdd the Coding Agent when you need codebase tasks
A local entry point for codebase tasksai4j-coding + ai4j-cliExtend the command layer when you need a productized CLI / TUI
Hook up FlowGram visual workflowsai4j-flowgram-spring-boot-starterLook at the FlowGram demo when you need a full demo
Align versions across modulesai4j-bomUse when a project pulls multiple AI4J artifacts

What AI4J covers

AI4J's capabilities sit in layers. We recommend getting the Core SDK working first, then upgrading upward as your project needs.

LayerCapabilitiesEntry
Core SDKChat, Responses, streaming, multimodal, image, audio, embedding, rerankCore SDK / Model Access
Capability wiringFunction call, local tools, Skills, MCPTools, Skills, MCP
Data augmentationMemory, search, RAG, VectorStore, ingestion, hybrid retrievalSearch & RAG
App integrationSpring Boot starter, config governance, auto-configurationSpring Boot
Upper runtimesAgent, Coding Agent, FlowGram workflowsAgent, Coding Agent, FlowGram
Scenario solutionsCommon combinations and repeatable integration pathsSolutions
Production readinessVersion compatibility, release artifacts, security, migration, troubleshootingVersion Compatibility, Security, Troubleshooting

Three concepts, kept distinct

AI4J docs deliberately separates three kinds of capabilities:

  • Function Call / Tool: lets the model invoke local functions or controlled tools.
  • Skill: on-demand assets the model reads — instructions, templates, flows, know-how.
  • MCP: brings in external tools, services, or capability gateways over a protocol.

These compose, but their responsibilities differ. Keeping the boundaries clear is what keeps the downstream cost of using them low.

Repository module map

ModuleRole
ai4j/Core SDK: provider access, Chat, Responses, RAG, MCP, vector, image, audio, realtime
ai4j-spring-boot-starter/Spring Boot auto-configuration and app-side wiring
ai4j-agent/Agent runtime, workflow, trace, memory, team orchestration
ai4j-coding/Coding Agent runtime, workspace tools, outer loop, compaction
ai4j-cli/CLI, TUI, ACP host, and local session entry
ai4j-flowgram-spring-boot-starter/FlowGram integration, task APIs, trace bridge
ai4j-flowgram-demo/ and ai4j-flowgram-webapp-demo/FlowGram backend and frontend demos
ai4j-bom/Maven version alignment

These modules exist so you can pull in only what you need right now, while leaving room to upgrade upward.

Suggested next step: if you haven't run any code yet, start with the Quickstart for Java; if you'd rather first judge whether AI4J fits your project, read Why AI4J.