In short.
LangChain4j AI Services Patterns is an assistant skill for Java developers building AI applications, but its examples contain errors and lack demonstrated compilation or runtime results. It explains how Java interfaces connect to language models and supplies patterns for memory, tools, structured data, streaming and document retrieval. A memory example assigns the generated service to an incompatible interface, and its proposed isolation check does not establish separation between users. The material is useful for drafting implementations, with API compatibility, correctness, reliability and operating costs still unassessed.
Researched and written by an AI model and checked by a second AI model. How it works
Scope covers SKILL.md, references/examples.md and references/references.md under plugins/developer-kit-java/skills/langchain4j-ai-services-patterns at commit fe73fb33a09ee6562eeec7415a3f9a3bcf795177, plus the repository-root LICENSE outside that folder. The three skill files are eligible for redistribution together with the required notice. Other developer-kit folders, LangChain4j implementation code, external documentation and provider terms are outside this scope. Compilation, API compatibility, model calls, memory isolation, tool execution, streaming, retrieval and production behavior were not executed or assessed through runtime evidence.
The overview
identity
The resource is the langchain4j-ai-services-patterns skill in Giuseppe Trisciuoglio's developer-kit repository. Its three files are SKILL.md, references/examples.md and references/references.md. The original folder is [https://github.com/giuseppe-trisciuoglio/developer-kit/tree/main/plugins/developer-kit-java/skills/langchain4j-ai-services-patterns].
The supplied version is commit fe73fb33a09ee6562eeec7415a3f9a3bcf795177. SKILL.md contains assistant-facing instructions and metadata; the companion files provide examples and API sketches. The folder supplies guidance rather than a standalone Java application.
assessment
The material offers a useful progression from a one-method chat interface to assistants with memory, tools and retrieved documents. Beginners get concrete examples; experienced Java developers get annotations, builder configuration and integration patterns to inspect.
The examples file calls its snippets production-ready, but that claim is not established. There are no supplied build or execution results, and the main memory snippet contains an incompatible variable declaration. Treat the code as patterns requiring correction and verification.
users
The strongest fit is a Java developer using a coding assistant to draft chatbots, information extractors, tool-using assistants or document question-answering features. The skill assumes familiarity with interfaces, annotations, dependency management and application configuration.
A beginner can follow the basic chat and memory examples, but will need enough Java knowledge to resolve inconsistencies. Developers seeking a complete deployable application, an authenticated multi-user service or proven production behavior will need additional implementation and evidence.
capabilities
The skill describes chat interfaces, system and user prompt templates, per-user conversation memory, outputs mapped to Java types, model-selected Java tool calls and streamed responses. Its ten examples also cover personas, tool failures and retrieval-augmented generation, where relevant document text is supplied to help answer a question.
The reference file additionally sketches dynamic tool selection, moderation, retrieval query transformation, reranking and token-usage reporting. These are documented patterns; their compatibility and behavior are not demonstrated by execution evidence.
Using it
requirements
Following the Java examples requires a Java project and dependency management. SKILL.md specifies dev.langchain4j:langchain4j:1.8.0 and dev.langchain4j:langchain4j-open-ai:1.8.0 for Maven or Gradle. The minimum JDK and a complete dependency configuration for every example are not stated.
The examples obtain OPENAI_API_KEY from an environment variable and name gpt-4o-mini for chat and text-embedding-3-small for embeddings. They therefore depend on external model access as written. Current model availability and account requirements are unknown.
The skill metadata declares Read, Write, Edit, Bash, Glob and Grep as allowed tools. Compatible assistant hosts, installation paths and how a host grants these capabilities are not documented in the supplied folder.
mechanism
The assistant-facing instructions guide code creation. In the resulting Java design, a developer declares an interface and uses AiServices.create or AiServices.builder to obtain an implementation backed by a language model. SystemMessage and UserMessage annotations define prompts, while V binds parameters to template variables.
MemoryId supplies an identifier for separate conversation histories. Registered methods marked Tool can be selected by the model. For document question answering, the example embeds documents, stores their representations in memory and attaches a content retriever to the service. Java return types express the expected output shape; they do not establish factual correctness.
setup
Keep SKILL.md together with its references directory so its relative references remain usable. The exact assistant installation procedure is unknown because the selected folder provides no host-specific installation instructions.
For the documented Java path, add the stated dependencies, supply the API key through the environment, define a small service interface and connect it to a configured chat model. Start with the basic chat example before adding memory, tools or retrieval. Dependency resolution and API compatibility have not been assessed.
example
The multi-user example defines chat with a MemoryId-annotated integer followed by the user's message. Its builder supplies a separate MessageWindowChatMemory with a 20-message limit for each identifier. The illustrated conversations give user 1 a Java preference and user 2 a Python preference, then ask each assistant to recall it.
This demonstrates the intended pattern for separate histories, not proven isolation. The displayed answers are comments rather than recorded results, and the example does not show authentication, authorization, durable storage or memory cleanup.
Assessment & evidence
limitations
In SKILL.md, the memory example builds MultiUserAssistant but assigns it to Assistant, an unrelated interface in the preceding definitions. Its later two-argument validation calls also conflict with Assistant's one-argument method. Relative to the declared MultiUserAssistant signature, those validation calls place the message and identifier in reversed positions. These are inconsistencies visible in the text; no compilation was performed.
The proposed memory-isolation assertion only checks that two responses differ. Different responses do not demonstrate that one user's history is inaccessible to another. The streaming example waits a fixed five seconds, which does not establish that generation has completed.
The weather tool returns fixed simulated weather, and the database tools return illustrative strings. They do not demonstrate live integrations. The reference file contains schematic API declarations rather than a complete compilable reference implementation. Compatibility of the JSON-object response setting with all illustrated return types is not established.
The source itself warns that model outputs are nondeterministic and that tools can be called unexpectedly. Its suggestion to use temperature zero does not establish deterministic or correct results. Accuracy, latency, throughput, security and production reliability remain unassessed.
reasoning
The resource's practical value is showing how a Java feature can be expressed through a small interface and then extended with prompts, memory, tools and retrieval. Having these patterns together can help a developer identify which configuration belongs to each feature.
Its strongest use is as a drafting and learning aid for someone able to review the resulting Java. The concrete snippet inconsistencies and missing execution evidence limit confidence in copying the examples directly into an application.
alternatives
The resource points to LangChain4j documentation [https://docs.langchain4j.dev] and the LangChain4j examples repository [https://github.com/langchain4j/langchain4j-examples] as further sources. Their contents, current compatibility and comparative quality are not assessed in the supplied evidence.
Within the included reference, direct ChatModel.chat calls with ChatRequest and callback-based streaming provide lower-level patterns to consider when an interface-based service does not fit. Those sketches have no supplied execution results either.
evidence
The supplied source consists of the complete three-file skill folder and the repository-root MIT notice. SKILL.md provides the instructions, dependency versions and warnings; examples.md provides ten worked examples; references.md provides API sketches.
These are repository-authored descriptions and snippets. The selected folder includes no build project, automated test suite, execution logs, benchmark results or deployment evidence. Expected answers in comments do not establish observed behavior. Nothing was executed.
Access & freshness
costs
The MIT notice grants permission free of charge for the covered material. It does not establish the cost of running an application built from these examples.
The shown applications make external chat-model calls, and the retrieval example also makes embedding-model calls. Provider prices, free allowances, infrastructure costs and total operating costs are unknown. The skill warns that conversation context can increase token costs and recommends pruning history, limiting tool execution and monitoring usage.
rights
The repository-root LICENSE is the MIT License, with copyright attributed to Giuseppe Trisciuoglio in 2025. It permits use, copying, modification, distribution, sublicensing and sale of the covered software and documentation, provided the copyright and permission notices accompany copies or substantial portions.
The material is provided without warranty. The supplied scope contains no separate skill-folder licence notice. Terms governing dependencies, model providers or external data are not established by this repository notice.
freshness
The supplied source snapshot was captured on 17 November 2026 at 09:42:22.533 UTC and identifies commit fe73fb33a09ee6562eeec7415a3f9a3bcf795177. Its dependency examples specify LangChain4j 1.8.0; this is a documented version, not evidence that it is the latest release.
The files do not establish their last substantive update, a support policy or compatibility with later releases. Current model availability and whether the repository's main branch has changed are unknown.
actions
Before adopting the patterns, compile a minimal chat example against the dependencies you intend to use. Correct the memory-service variable type and keep identifier and message arguments in the declared order. Check isolation with a unique fact in one session and an attempt to retrieve it from another; response inequality alone is insufficient.
Verify structured-output configuration, streaming callbacks and error-handler signatures against the installed APIs. Replace the fixed streaming wait with a completion signal and replace simulated integrations with controlled implementations. Add authorization, parameter validation, timeouts and usage limits before exposing tools that change application data. These steps have no established results in the supplied material.
