CtrlK
BlogDocsLog inGet started
Tessl Logo

jbaruch/quarkus-langchain4j

Build Quarkus applications with LangChain4j extensions - project setup, CDI services, REST endpoints, MCP, agentic, and dev mode

91

1.71x
Quality

90%

Does it follow best practices?

Impact

96%

1.71x

Average score across 3 eval scenarios

SecuritybySnyk

Advisory

Suggest reviewing before use

Overview
Quality
Evals
Security
Files

task.mdevals/scenario-3/

Financial Assistant with Calculator Tools

Problem/Feature Description

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.

Output Specification

Produce a complete Maven project with:

  • pom.xml — all required dependencies
  • src/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 support
  • src/main/java/.../FinanceResource.java — the REST endpoint
  • src/main/resources/application.properties — named model configuration for fast and smart tiers using Anthropic and/or OpenAI as providers

Also produce a DESIGN.md briefly explaining the tool registration approach chosen (service-level vs method-level) and the named model configuration.

evals

tile.json