Build AI agents with LangChain4j - basic agent, memory, tools/MCP, agentic workflows, guardrails, and observability
90
90%
Does it follow best practices?
Impact
90%
2.90xAverage score across 3 eval scenarios
Passed
No known issues
A SaaS company is building a customer support portal where multiple customers can chat with an AI assistant simultaneously. Each customer must have their own isolated conversation history — so the agent remembers what Customer A said earlier without mixing it up with Customer B's context. The engineering team also wants the conversation history to survive application restarts, so it must be persisted to a storage backend (an in-memory map simulating a database is sufficient for the prototype).
The team needs a plain Java implementation (no Quarkus for now) that demonstrates correct use of per-user memory isolation, a configurable memory window that limits the conversation history length, and a pluggable persistence layer using the standard LangChain4j storage interface.
Produce a working Java project with the following:
pom.xml — Maven build file with all required dependenciessrc/main/java/support/ChatMemoryStoreImpl.java — a custom chat memory store implementationsrc/main/java/support/SupportAgent.java — the AI service interfacesrc/main/java/support/SupportAgentDemo.java — a runnable demo that:
user-alice and user-bob)design-notes.md — a brief document (bullet points acceptable) explaining the memory architecture choices made, including the class names and interfaces used