How agents talk in LangChain4j. Share the scope, not the chat.
How LangChain4j agents communicate without pasting chat: define @Agent, publish with outputKey into AgenticScope, read with @V, and wire with sequenceBuilder or parallelBuilder. Pins langchain4j 1.24.0 and langchain4j-agentic 1.24.0-beta34.
Define
One interface, one @Agent method, with a short description other agents can use.
Publish
Set outputKey so the result lands in AgenticScope for the next agent.
Read
@V("story") pulls the prior key. Pass only what that agent needs.
Wire
agentBuilder, sequenceBuilder, parallelBuilder, loopBuilder, or a supervisor.
Invoke
Call the top agent once. Scope is created on that invoke and carries the handoff.
Keep thin
One key per handoff. Do not paste transcripts. Pin the experimental agentic beta.