CtrlK
BlogDocsLog inGet started
Tessl Logo

gamussa/langchain4j-agentic

Build and demo Java AI agent systems with langchain4j-agentic: workflow patterns, supervisor, custom Planner strategies (incl. the flagship typed-verdict / CriticResult-style critic pattern), plus MCP tools, A2A remote agents, build setup, and conference-demo storylines. Pinned to 1.15.0 / 1.15.0-beta25.

84

4.76x
Quality

89%

Does it follow best practices?

Impact

100%

4.76x

Average score across 2 eval scenarios

SecuritybySnyk

Passed

No known issues

Overview
Quality
Evals
Security
Files

index.mddocs/

LangChain4j Agentic — Java Agents & Demo Builder

Reference + demo-building context for the langchain4j-agentic module. Distilled from the official LangChain4j docs (langchain4j/docs/docs/tutorials/agents.md) and verified against maven-metadata.xml.

Experimental module. Builder names and coordinates drift between betas. Run scripts/check_versions.sh before relying on pins.

Versions (confirmed current 2026-05-25)

ArtifactVersion
langchain4j-bom / langchain4j / -anthropic / -open-ai1.15.0 (GA)
langchain4j-agentic / -agentic-a2a / -agentic-patterns / -mcp1.15.0-beta25 (pin explicitly — not in BOM)
implementation(platform("dev.langchain4j:langchain4j-bom:1.15.0"))
implementation("dev.langchain4j:langchain4j")
implementation("dev.langchain4j:langchain4j-anthropic")
implementation("dev.langchain4j:langchain4j-agentic:1.15.0-beta25")        // explicit
implementation("dev.langchain4j:langchain4j-agentic-a2a:1.15.0-beta25")    // explicit
implementation("dev.langchain4j:langchain4j-mcp:1.15.0-beta25")            // explicit

What this module provides

Per Anthropic's "Building Effective Agents", agentic architectures split into:

  • Workflows — deterministic: sequential, loop, parallel, parallel-mapper, conditional.
  • Pure agents — adaptive: the LLM-driven supervisor, and algorithmic custom planners (incl. the flagship typed-critic strategy, goal-oriented, peer-to-peer, voting).

Agents share data through an AgenticScope; any composed system is itself an agent, so patterns nest.

⭐ Start here

custom-strategy-critic-result.md — the flagship "money slide" pattern: a Custom Strategy with Domain Modeling where the verifier returns a typed result object (illustrated as CriticResult — your own type, not a framework one) carrying verdict + feedback + the typed payload, deterministically driving Identify→Fix→Verify→Adjust with feedback loop-back. This is the centerpiece of the demo.

Documentation map

FileContents
custom-strategy-critic-result.md⭐ Flagship: typed-verdict custom strategy, CriticResult-style (the money slide)
agents-and-scope.md@Agent, agentBuilder, untyped/typed agents, AgenticScope
workflow-patterns.mdSequential, loop, parallel, parallel-mapper, conditional, human-in-the-loop, planner+executor+critic
agent-configuration.mdOptional, async, streaming, dynamic model, error handling, observability & monitoring
declarative-api.mdAnnotation API, supplier annotations, strongly typed keys
pure-agentic.mdSupervisor + custom Planner patterns: goal-oriented, peer-to-peer, voting
tools-memory-and-build.md@Tool, maxSequentialToolsInvocations, memory, model selection, -parameters, BOM split, deps
mcp-and-a2a.mdMCP tool servers (toolProviders) and A2A remote agents (a2aBuilder)
demo-storylines.mdFour-act conference/workshop demo, centered on the flagship pattern
gotchas.mdTop-10 live-demo risks + API-correctness notes

AgenticServices — the single factory

agentBuilder(Class) / agentBuilder()        // single agent (typed / untyped)
sequenceBuilder / loopBuilder               // ordered / iterative
parallelBuilder / parallelMapperBuilder     // concurrent / fan-out-over-collection
conditionalBuilder                          // predicate routing
supervisorBuilder                           // LLM-planned
plannerBuilder                              // custom Planner (incl. the CriticResult strategy)
humanInTheLoopBuilder                       // pause for human input
a2aBuilder(url[, Class])                    // remote agent over A2A
createAgenticSystem(Class, ChatModel)       // build from a declarative interface

Bundled assets (in the skill)

  • assets/build.gradle.kts, assets/App.java — runnable starting point
  • scripts/check_versions.sh — refresh the version pins

docs

agent-configuration.md

agents-and-scope.md

custom-strategy-critic-result.md

declarative-api.md

demo-storylines.md

gotchas.md

index.md

mcp-and-a2a.md

pure-agentic.md

tools-memory-and-build.md

workflow-patterns.md

README.md

tile.json