Build Quarkus applications with LangChain4j extensions - project setup, CDI services, REST endpoints, MCP, agentic, and dev mode
91
90%
Does it follow best practices?
Impact
96%
1.71xAverage score across 3 eval scenarios
Advisory
Suggest reviewing before use
A fintech startup is building a conversational financial assistant on top of Quarkus. Users interact with the assistant over multiple turns — they might ask questions like "If I invest $5,000 at 7% annual return for 10 years, what will it be worth?" The assistant needs to perform accurate arithmetic (compound interest, percentage calculations, rounding) rather than rely on the model's internal arithmetic, which can be unreliable.
The team wants a POST /finance/chat endpoint that accepts a JSON body with a sessionId and a message, and returns the assistant's reply. The assistant should remember previous messages in the conversation so users don't have to repeat context. The team also has two model tiers they want to configure: a fast model for routine queries and a smart model for complex financial planning — the main assistant should use the smart model.
Arithmetic operations must be delegated to a dedicated tool component rather than computed inline by the model. The team uses Quarkus's reactive runtime and wants tool executions to follow the appropriate threading model.
Produce a complete Maven project with:
pom.xml — all required dependenciessrc/main/java/.../FinanceTools.java — the tool bean with at least two arithmetic operations (e.g. compound interest, percentage)src/main/java/.../FinanceAssistant.java — the AI service interface wired to the tools, with session memory supportsrc/main/java/.../FinanceResource.java — the REST endpointsrc/main/resources/application.properties — named model configuration for fast and smart tiers using Anthropic and/or OpenAI as providersAlso produce a DESIGN.md briefly explaining the tool registration approach chosen (service-level vs method-level) and the named model configuration.