LnYo-Cly/ai4j

Java 8+ agentic SDK: unified LLM access (OpenAI/Anthropic/DashScope/Doubao/DeepSeek...),unified AI service(image/video/audio...), Tool Calling, MCP, RAG, SKILLS,Agent Runtime, A2A, agent blueprint, agent harness, and a built-in Coding Agent CLI/TUI/ACP.

What it solves

ai4j is a comprehensive Java SDK designed to simplify the development of AI agents. It solves the problem of fragmented AI service integration by providing a unified interface for over 12 major model platforms (such as OpenAI, Anthropic, and DeepSeek) and offering built-in tools for agent orchestration, RAG, and long-term task management, which are typically missing or fragmented in the Java ecosystem.

How it works

The SDK provides a unified AiService factory that allows developers to switch between different LLM providers by simply changing a PlatformType configuration. It implements several agent execution modes including ReAct, CodeAct, and Deep Research, and uses a StateGraph for complex orchestration with conditional branching and loops.

For long-term tasks, it introduces ai4j-harness, a runtime that persists task states to storage (File/JDBC), allowing agents to be paused, resumed, and audited. It also includes a full RAG pipeline—from document loading (Tika/MinerU) and chunking to integration with eight different vector databases—all contained within the SDK.

Who it’s for

Java developers (JDK 8+) who want to build sophisticated AI agents, RAG applications, or long-running automated workflows that require persistence, auditability, and integration with multiple LLM providers within a Spring Boot or standalone Java environment.

Highlights

  • Unified Model Access: Single API for 12+ platforms including OpenAI, Anthropic, DeepSeek, and Ollama.
  • Agent Orchestration: Supports ReAct, CodeAct, and Deep Research modes with multi-agent team collaboration.
  • ai4j-harness: Transforms one-off AI calls into durable, recoverable, and auditable long-term tasks.
  • Built-in RAG: Complete pipeline including document parsing, hybrid search, and support for 8+ vector stores (e.g., Pinecone, Milvus, Qdrant).
  • Extensible Plugin System: Allows injection of custom tools, slash commands, and skills via Maven jars.
  • Ecosystem Connectivity: Supports Model Context Protocol (MCP) and A2A protocols for agent-to-agent collaboration.
  • Coding Agent: Includes a ready-to-use CLI/TUI/ACP tool for local coding assistance.

Related

  • Project
  • Project
  • Project
  • Project
  • Project