LangChain4j Agentic Framework provides a comprehensive Java library for building multi-agent AI systems with support for workflow orchestration, supervisor agents, planning-based execution, declarative configuration, agent-to-agent communication, and human-in-the-loop workflows.
Maven:
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j-agentic</artifactId>
<version>1.11.0-beta19</version>
</dependency>Gradle:
implementation 'dev.langchain4j:langchain4j-agentic:1.11.0-beta19'langchain4j-agentic requires langchain4j-core:
<dependency>
<groupId>dev.langchain4j</groupId>
<artifactId>langchain4j</artifactId>
<version>1.11.0-beta19</version>
</dependency>Key Types from langchain4j-core:
dev.langchain4j.model.chat.ChatModel - LLM interface (required)dev.langchain4j.model.chat.StreamingChatModel - Streaming LLM (optional)dev.langchain4j.memory.ChatMemory - Chat history storage (optional)dev.langchain4j.memory.chat.ChatMemoryProvider - Memory provider factory (optional)dev.langchain4j.rag.content.retriever.ContentRetriever - Content retrieval for RAG (optional)dev.langchain4j.rag.RetrievalAugmentor - RAG orchestration (optional)dev.langchain4j.guardrail.InputGuardrail / OutputGuardrail - Safety guardrails (optional)import dev.langchain4j.agentic.AgenticServices;
import dev.langchain4j.agentic.Agent;
import dev.langchain4j.agentic.UntypedAgent;
import dev.langchain4j.agentic.agent.AgentBuilder;
import dev.langchain4j.agentic.scope.AgenticScope;
import dev.langchain4j.model.chat.ChatModel;// Assuming you have a ChatModel instance from langchain4j-core
// ChatModel chatModel = ...; (e.g., OpenAiChatModel, OllamaChatModel, etc.)
UntypedAgent agent = AgenticServices.agentBuilder()
.chatModel(chatModel)
.tools(calculator, weatherService)
.build();
Object result = agent.invoke("What is 25 * 4 and what's the weather in NYC?");interface Assistant {
@Agent(name = "assistant", description = "General purpose assistant")
String assist(String input);
}
Assistant assistant = AgenticServices.createAgenticSystem(Assistant.class, chatModel);
String response = assistant.assist("Hello!");Install with Tessl CLI
npx tessl i tessl/maven-dev-langchain4j--langchain4j-agentic@1.11.0docs
declarative
A2AClientAgent
ActivationCondition
Agent
ConditionalAgent
ErrorHandler
ExitCondition
HumanInTheLoop
HumanInTheLoopResponseSupplier
LoopAgent
LoopCounter
Output
ParallelAgent
ParallelExecutor
PlannerAgent
SequenceAgent
SupervisorAgent
SupervisorRequest
quick-start
workflows