LangChain4j on Future AGI
Agent Frameworks
Java-native chains, agents, and RAG with LangChain4j.
What you get
Everything traced, scored, and improvable
One install instruments LangChain4j on OpenTelemetry. Future AGI then layers evaluators, optimisers, and simulations on top of the same trace tree — no second SDK, no double instrumentation.
Trace
Auto-instrumented spans
Every LangChain4j call becomes a span — inputs, outputs, latency, tokens, cost, model name, tool args, retrieval results, and chain steps captured automatically.
Evaluate
70+ evaluators on every span
Attach Groundedness, Context Relevance, Prompt Injection, Toxicity, and 70+ more — purpose-built scorers powered by the Turing eval models, not generic LLM-as-judge.
Optimize
Closed-loop improvement
Pipe failed traces into agent-opt: GEPA, PromptWizard, ProTeGi, and Bayesian search rewrite your prompts with proof of measured gains.
Simulate
Adversarial scenarios at scale
Generate hundreds of personas and run them through your LangChain4j agent before launch — text and voice, scripted or persona-driven.
Quickstart · <3 min
Instrument LangChain4j in three steps
-
Step 1
Install the traceAI package
One package per language, ships from PyPI, npm, and Maven Central.
-
Step 2
Register the trace provider
Set
FI_API_KEYandFI_SECRET_KEY, then callLangChain4jInstrumentor().instrument(). -
Step 3
Run your existing LangChain4j app
No code changes. Traces appear in the Future AGI dashboard within seconds.
Install
<dependency>
<groupId>ai.futureagi</groupId>
<artifactId>traceai-langchain4j</artifactId>
<version>LATEST</version>
</dependency>Instrument
import ai.futureagi.fi.instrumentation.TraceProvider;
import ai.futureagi.traceai.langchain4j.LangChain4jInstrumentor;
TraceProvider provider = TraceProvider.builder()
.projectName("langchain4j_app")
.projectType("observe")
.build();
new LangChain4jInstrumentor().instrument(provider);
// Your existing LangChain4j code runs unchanged.
// Every call is now an OpenTelemetry span in Future AGI.Pick a recipe
What do you want to do with LangChain4j?
Each recipe is a copy-paste page with the exact code, the gotchas, and a working example you can clone.
Recipes for LangChain4j
Adjacent integrations
Other agent frameworks
LangChain
Chains, agents, and LCEL pipelines with auto-traced spans for every step.
DSPy
Declarative LLM programs with optimisable signatures and modules.
CrewAI
Role-based multi-agent crews with task plans and tool use.
AutoGen
Microsoft's multi-agent conversation framework.