OpenViSTAI · Agents · Blockchain · Crypto
Menu
Agent Frameworks

Ai4J

Ai4J is an open-source Java SDK for building AI agent applications, with shared interfaces for model services and features for orchestration, tool calling, retrieval-augmented generation, MCP and agent runtime.

Independent OpenViST project profile, based on linked sources.

Ai4J — OpenViST project profile in Agent Frameworks.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Ai4J when developing a Java application that needs model access plus agent-building components such as orchestration, retrieval or tool connectivity. The repository’s first-chat example uses an OpenAI API key; other provider setups require their corresponding configuration.

Who it is for

  • Java developers building applications that use large language models.
  • Teams implementing agent workflows with delegation, graph orchestration or retrieval.
  • Developers building coding-agent applications with CLI, TUI or ACP interfaces.

Documented uses

  • Connect a Java application to supported model providers through a common interface.
  • Build agents with ReAct, CodeAct or deep-research execution patterns.
  • Coordinate branching and looping workflows, subagents and multi-agent teams.
  • Add document retrieval, tool calling and MCP connections to an agent application.
  • Develop a coding-agent application using the included CLI, TUI or ACP entry points.
Before you choose

Requirements & limits

The repository identifies the project as open source under the Apache-2.0 license. It documents Maven and Gradle dependencies and a JDK 8+ requirement.

  • The SDK is written for Java and targets JDK 8 or later.
  • The project documents integrations with OpenAI, Anthropic, DashScope, Doubao and DeepSeek, among others.
  • Its scope includes both model-service interfaces and agent-specific capabilities such as graph orchestration, subagents, RAG and MCP.
  • The coding-agent CLI/TUI/ACP tools are separate entry points from the core SDK dependency.
  • The documented first-chat example requires an OpenAI API key.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Add Ai4J to a Java project

Declare the Ai4J SDK dependency using Maven or Gradle.

Before you start

  • A Java project using JDK 8 or later.
  • Maven or Gradle.

Steps

  1. For Maven, add the dependency with groupId io.github.lnyo-cly, artifactId ai4j, and version 2.8.1.

  2. For Gradle, add implementation 'io.github.lnyo-cly:ai4j:2.8.1'.

Expected outcome

The project declares the Ai4J SDK as a dependency.

Guide limitations

  • This covers dependency setup only; it does not configure a model provider or demonstrate an agent workflow.
Source-based practical guide

Send a first OpenAI chat request

Configure the documented Java example to make an OpenAI chat request.

Before you start

  • A Java project with Ai4J added as a dependency.
  • An OpenAI API key available as the OPENAI_API_KEY environment variable.

Steps

  1. Create an OpenAiConfig and set its API key from OPENAI_API_KEY.

  2. Place the OpenAiConfig in an Ai4J Configuration and create an AiService.

  3. Get the OpenAI chat service and build a ChatCompletion request with a model and user message.

  4. Call chatCompletion and print the returned message text.

Expected outcome

The example submits a chat request and prints the response text.

Guide limitations

  • The example depends on an OpenAI API key and a configured model; it is a chat example, not an agent-orchestration recipe.
COMPARE OPTIONS

Compare options for Retrieval-augmented applications

These projects document a common task and share a project role. This is a source-based comparison, not an execution benchmark or a guarantee of interchangeability.

ProjectDocumented purposePlatformAccess and requirements
Ai4JConnect a Java application to supported model providers through a common interface.CLI, Linux, macOS, WindowsThe repository identifies the project as open source under the Apache-2.0 license. It documents Maven and Gradle dependencies and a JDK 8+ requirement.
Hydra — hassenhamdiIngest Markdown documents into a searchable knowledge base.CLI, Self-hosted, ServerThe repository is public and identifies an MIT license. Local setup requires Python 3.10+, a Gemini API key and Docker with Docker Compose for Milvus.
AgentnexusConfigure agents from stored models, tools, prompts, memory, and knowledge sources.Docker, Self-hosted, ServerThe project is documented as open source, and its README states that it uses the MIT License.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
13 October 2026
Original website title
LnYo-Cly/ai4j · Official homepage title · retained in its source language