Post
CommunityJev Practices & Patterns
Routing Agents with Jev and Laya: Adding System One Decisions to Quarkus LangChain4j
A hands-on write-up of swapping an LLM routing call for System One decisions in a Quarkus LangChain4j app: a custom Planner asks one Choice question to pick the specialist agent, and an OutputGuardrail asks a Noul question to reject bad replies.
- Format
- Post
- Reading time
- 3 min
- Published by
- Community
- Author
- Kevin Dubois
- Last verified
- Oct 2026
- Languages
- Java
Highlights
- Replaces the LLM supervisor's routing chat call with a custom LangChain4j Planner that asks the decision model one Choice question.
- Adds an OutputGuardrail backed by a Noul question — does the reply actually answer the user? — which the original app lacked.
- The decision logic is about 285 lines; orchestration, retries and the REST layer stay with Quarkus (Java 25, Quarkus 3.39.x, LangChain4j 1.14.x).
- Choice returns a choice with probabilities and confidence; Score returns a score and legend; Noul returns a yes-probability between 0 and 1.
- Jev runs in the post are a deterministic stub because TypeSafe paused signups; Laya runs are real, and switching is one config property.
Watch out
Grounded in the truncated article text read on 2026-10-15; the excerpt ends inside the JevRouter.route method. The author could not test Jev because TypeSafe paused signups, so the Jev path is a stub while Laya runs are real, and no accuracy or latency measurements are reported.
Questions about this entry
Short answers drawn from the linked project or page.
Kevin Dubois rewires a Quarkus LangChain4j car-rental advisor so agent routing and reply checking use Jev-style System One decisions instead of chat completions. It is part how-to and part effort report, with code, on Java 25, Quarkus 3.39.x and LangChain4j 1.14.x.
A @PlannerAgent replaces the built-in LLM supervisor. The custom JevRoutingPlanner reads the customer message, asks one Choice question over criteria for each specialist, writes the route into state, and returns the action that invokes the matching sub-agent.
With an OutputGuardrail that asks one Noul question: does this reply actually answer the user? Noul returns a yes-probability between 0 and 1, so a low value means rejecting the reply. The post notes the original app had no check on whether the right agent was called or replies were good.
Choice picks one from a list and returns the choice with probabilities and confidence; Score rates on a scale and returns the score, legend, probabilities and confidence; Noul answers is-this-true with a yes-probability between 0 and 1.
No. TypeSafe paused signups, so the author did not have an API key; the post's Jev runs are a deterministic stub, while the Laya runs are real. Because the two share a schema and interface, swapping them is a one-property config change.
About 285 lines of actual decision logic. The post says the hooks were already there — a Planner to pick the agent and an OutputGuardrail to reject bad replies — and everything else is Quarkus orchestration, retries and the REST layer.
A Quarkus service on Java 25, Quarkus 3.39.x and LangChain4j 1.14.x, based on the Quarkus LangChain4j workshop app. The sub-agents it can route to are ReservationAgent, WeatherAgent, CostAgent and GeneralAgent.
From the Jev guides
Original write-ups on what this entry is for.
From the Jev AI model community
Posts from builders shipping with Jev right now.