Agent skill

Langchain4j AI Services Patterns

by giuseppe-trisciuoglio in giuseppe-trisciuoglio/developer-kit

Provides patterns to build declarative AI Services with LangChain4j for LLM integration, chatbot development, AI agent implementation, and conversational AI in Java.

MITAuto-check: notesAI & LLM Engineering

Install Langchain4j AI Services Patterns

skills CLI
$ npx skills add giuseppe-trisciuoglio/developer-kit --skill langchain4j-ai-services-patterns -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install giuseppe-trisciuoglio/developer-kit langchain4j-ai-services-patterns --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/giuseppe-trisciuoglio/developer-kit.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/developer-kit-java/skills/langchain4j-ai-services-patterns .claude/skills/langchain4j-ai-services-patterns && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
langchain4j-ai-services-patterns
GitHub stars
357
Token cost
~1.6k tokens
SKILL.md length
423 words
Files
3 (incl. references)
Skills in repo
115
Repo updated
First seen
Licence
MIT

At a glance

Provides patterns to build declarative AI Services with LangChain4j for LLM integration, chatbot development, AI agent implementation, and conversational AI in Java.

  • Works in 6 steps: Define AI Service Interface → Add Annotations for System and User… → Create AI Service Instance → …
  • Creating AI-powered Java applications with minimal boilerplate
  • SKILL.md covers Overview, When to Use, Instructions and Examples, plus 5 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Langchain4j AI Services Patterns is an agent skill from giuseppe-trisciuoglio/developer-kit. Provides patterns to build declarative AI Services with LangChain4j for LLM integration, chatbot development, AI agent implementation, and conversational AI in Java. Generates type-safe AI services using interface-based patterns, annotations, memory management, and tools integration. Use when creating AI-powered Java applications with minimal boilerplate, implementing conversational AI with memory, or building AI agents with function calling.

Its SKILL.md is about 1.6k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/examples.md` and `references/references.md`).

It sits in AI & LLM Engineering, covering Structured output and tool calling, Chatbots and conversational support and Type safety. It works with Java. The repository describes itself as: Modular plugin marketplace for Claude Code and agentic CLIs, with validated, spec-driven skills, agents, commands, and workflows for Java, TypeScript, Python, PHP, AWS, and AI. The licence is MIT.

When your agent uses it

  • Creating AI-powered Java applications with minimal boilerplate
  • Implementing conversational AI with memory
  • Building AI agents with function calling

Example prompts

  • “Use the langchain4j-ai-services-patterns skill to provide patterns to build declarative AI Services with LangChain4j for LLM integration, chatbot…”
  • “/langchain4j-ai-services-patterns”

Requirements

  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash, Glob, Grep

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Define AI Service Interface
  2. Add Annotations for System and User Messages
  3. Create AI Service Instance
  4. Configure Memory for Multi-turn Conversations
  5. Integrate Tools for Function Calling
  6. Validate and Test

What it can do on your machine

Read from SKILL.md and the folder at commit fe73fb3. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash
    • Glob
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are java, xml and gradle).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • langchain4j.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Langchain4j AI Services Patterns loads about 1.6k tokens when it runs, and up to ~9k if it reads all its reference files. Until then it costs about 120 tokens; SKILL.md has 423 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~120
When it runs · the whole SKILL.md, loaded when a task matches
~1.6k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~9k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Write, Edit, Bash, Glob, Grep

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from giuseppe-trisciuoglio/developer-kit at commit fe73fb3, republished under its MIT licence (© giuseppe-trisciuoglio). 423 words, ~1,601 tokens.

Download SKILL.mdSave it as .claude/skills/langchain4j-ai-services-patterns/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.
name
langchain4j-ai-services-patterns
description
Provides patterns to build declarative AI Services with LangChain4j for LLM integration, chatbot development, AI agent implementation, and conversational AI in Java. Generates type-safe AI services using interface-based patterns, annotations, memory management, and tools integration. Use when creating AI-powered Java applications with minimal boilerplate, implementing conversational AI with memory, or building AI agents with function calling.
allowed-tools
Read, Write, Edit, Bash, Glob, Grep

LangChain4j AI Services Patterns

This skill provides guidance for building declarative AI Services with LangChain4j using interface-based patterns, annotations for system and user messages, memory management, tools integration, and advanced AI application patterns that abstract away low-level LLM interactions.

Overview

LangChain4j AI Services define AI functionality using Java interfaces with annotations, providing type-safe, declarative AI with minimal boilerplate.

When to Use

Use this skill when:

  • Building declarative AI services with minimal boilerplate using Java interfaces
  • Creating type-safe conversational AI with memory management
  • Implementing AI agents with function/tool calling capabilities
  • Designing AI services returning structured data (enums, POJOs, lists)
  • Integrating RAG patterns declaratively

Instructions

Follow these steps to create declarative AI Services with LangChain4j:

1. Define AI Service Interface

Create a Java interface with method signatures for AI interactions:

java
interface Assistant {
    String chat(String userMessage);
}
2. Add Annotations for System and User Messages

Use @SystemMessage and @UserMessage annotations to define prompts:

java
interface CustomerSupportBot {
    @SystemMessage("You are a helpful customer support agent for TechCorp")
    String handleInquiry(String customerMessage);

    @UserMessage("Analyze sentiment: {{it}}")
    Sentiment analyzeSentiment(String feedback);
}
3. Create AI Service Instance

Use AiServices builder or create to instantiate the service:

java
// Simple creation
Assistant assistant = AiServices.create(Assistant.class, chatModel);

// Or with builder for advanced configuration
Assistant assistant = AiServices.builder(Assistant.class)
    .chatModel(chatModel)
    .build();
4. Configure Memory for Multi-turn Conversations

Add memory management using @MemoryId for multi-user scenarios:

java
interface MultiUserAssistant {
    String chat(@MemoryId String userId, String userMessage);
}

Assistant assistant = AiServices.builder(MultiUserAssistant.class)
    .chatModel(model)
    .chatMemoryProvider(userId -> MessageWindowChatMemory.withMaxMessages(10))
    .build();
5. Integrate Tools for Function Calling

Register tools using @Tool annotation to enable AI function execution:

java
class Calculator {
    @Tool("Add two numbers") double add(double a, double b) { return a + b; }
}

interface MathGenius {
    String ask(String question);
}

MathGenius mathGenius = AiServices.builder(MathGenius.class)
    .chatModel(model)
    .tools(new Calculator())
    .build();
6. Validate and Test

Test AI services with concrete validation patterns:

java
// 1. Test with sample inputs
String response = assistant.chat("Hello, how are you?");
assert response != null && !response.isEmpty();

// 2. Validate structured outputs with assertions
Sentiment result = bot.analyzeSentiment("Great product!");
assert result == Sentiment.POSITIVE;

// 3. Log tool calls with side effects for audit
MathGenius math = AiServices.builder(MathGenius.class)
    .chatModel(model)
    .tools(new Calculator())
    .build();

// 4. Test memory isolation between users
String userA = assistant.chat("User A message", "session-a");
String userB = assistant.chat("User B message", "session-b");
assert !userA.equals(userB); // Verify memory isolation

Examples

See examples.md for comprehensive practical examples including:

  • Basic chat interfaces
  • Stateful assistants with memory
  • Multi-user scenarios
  • Structured output extraction
  • Tool calling and function execution
  • Streaming responses
  • Error handling
  • RAG integration
  • Production patterns

API Reference

Complete API documentation, annotations, interfaces, and configuration patterns are available in references.md.

Show full SKILL.md (177 more words)Show less

Best Practices

  1. Use type-safe interfaces instead of string-based prompts
  2. Implement proper memory management with appropriate limits
  3. Design clear tool descriptions with parameter documentation
  4. Handle errors gracefully with custom error handlers
  5. Use structured output for predictable responses
  6. Implement validation for user inputs
  7. Monitor performance for production deployments

Dependencies

xml
<!-- Maven -->
<dependency>
    <groupId>dev.langchain4j</groupId>
    <artifactId>langchain4j</artifactId>
    <version>1.8.0</version>
</dependency>
<dependency>
    <groupId>dev.langchain4j</groupId>
    <artifactId>langchain4j-open-ai</artifactId>
    <version>1.8.0</version>
</dependency>
gradle
// Gradle
implementation 'dev.langchain4j:langchain4j:1.8.0'
implementation 'dev.langchain4j:langchain4j-open-ai:1.8.0'

References

Constraints and Warnings

  • AI Services rely on LLM responses which are non-deterministic; tests should account for variability.
  • Memory providers store conversation history; ensure proper cleanup for multi-user scenarios.
  • Tool execution can be expensive; implement rate limiting and timeout handling.
  • Never pass sensitive data (API keys, passwords) in system or user messages.
  • Large context windows can lead to high token costs; implement message pruning strategies.
  • Streaming responses require proper error handling for partial failures.
  • AI-generated outputs should be validated before use in production systems.
  • Be cautious with tools that have side effects; AI models may call them unexpectedly.
  • Token limits vary by model; ensure prompts and context fit within model constraints.

© giuseppe-trisciuoglio, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 2 other files (references) in plugins/developer-kit-java/skills/langchain4j-ai-services-patterns of giuseppe-trisciuoglio/developer-kit.

  • SKILL.md
  • references/examples.md
  • references/references.md

Open the folder on GitHubat commit fe73fb3

Compare with similar skills

Langchain4j AI Services Patterns next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Langchain4j AI Services Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Langchain4j AI Services Patterns this skillgiuseppe-trisciuoglio/developer-kit357—~1.6kAutomated safety check: NotesMIT
Google Agents CLI Adk Codepifferologo/cloud-agents-cli1291 repos~768Automated safety check: PassApache-2.0
AI SDKvercel-labs/ai-facts16820 repos~1.2kAutomated safety check: PassNone
LangchainOrchestra-Research/AI-Research-SKILLs13k2 repos~3.2kAutomated safety check: PassMIT
Sap Cloud SDK AIsecondsky/sap-skills462—~3.2kAutomated safety check: PassGPL-3.0
Scaffolding Openai Agentsaiskillstore/marketplace433—~3.3kAutomated safety check: PassNone

Similar skills

  • Google Agents CLI Adk Code

    pifferologo/cloud-agents-cli

    This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management", or needs ADK (Agent…

    129 GitHub starsUsed in 1 repo~768 tokens
    AI & LLM EngineeringAuto-check passed
  • AI SDK

    vercel-labs/ai-facts

    Official

    Answer questions about the AI SDK and help build AI-powered features.

    168 GitHub starsUsed in 20 repos~1.2k tokens
    AI & LLM EngineeringAuto-check passed
  • Langchain

    Orchestra-Research/AI-Research-SKILLs

    Framework for building LLM-powered applications with agents, chains, and RAG.

    13k GitHub starsUsed in 2 repos~3.2k tokens
    AI & LLM EngineeringAuto-check passed
  • Sap Cloud SDK AI

    secondsky/sap-skills

    Integrates SAP Cloud SDK for AI into JavaScript/TypeScript and Java applications.

    462 GitHub stars~3.2k tokensUpdated 5 days ago
    AI & LLM EngineeringAuto-check passed
  • Scaffolding Openai Agents

    aiskillstore/marketplace

    Builds AI agents using OpenAI Agents SDK with async/await patterns and multi-agent orchestration.

    433 GitHub stars~3.3k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Pydanticai

    magnus919/agent-skills

    Build type-safe AI agents and graph-based workflows with PydanticAI and PydanticGraph.

    115 GitHub stars~4.3k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed

More from giuseppe-trisciuoglio/developer-kit

All 115 skills in this repo
  • Nestjs Drizzle Crud Generator

    giuseppe-trisciuoglio/developer-kit

    Generates complete CRUD modules for NestJS applications with Drizzle ORM.

    357 GitHub stars~1.3k tokensUpdated 1 mo ago
    Auto-check: notes
  • Spring Boot Actuator

    giuseppe-trisciuoglio/developer-kit

    Provides patterns to configure Spring Boot Actuator for production-grade monitoring, health probes, secured management endpoints, and Micrometer metrics across JVM services.

    357 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check: notes
  • Spring Boot Crud Patterns

    giuseppe-trisciuoglio/developer-kit

    Provides and generates complete CRUD workflows for Spring Boot 3 services.

    357 GitHub stars~2.5k tokensUpdated 1 mo ago
    Auto-check: notes
  • Spring Boot Security JWT

    giuseppe-trisciuoglio/developer-kit

    Provides JWT authentication and authorization patterns for Spring Boot 3.5.x covering token generation with JJWT, Bearer/cookie authentication, database/OAuth2 integration, and RBAC/permission-based…

    357 GitHub stars~3.9k tokensUpdated 1 mo ago
    Auto-check: notes
  • AWS CLI Beast

    giuseppe-trisciuoglio/developer-kit

    Provides advanced AWS CLI patterns for managing EC2, Lambda, S3, DynamoDB, RDS, VPC, IAM, and CloudWatch.

    357 GitHub stars~1.7k tokensUpdated 1 mo ago
    Auto-check: notes
  • PR Review Comments

    giuseppe-trisciuoglio/developer-kit

    Posts review findings from a JSON file as inline comments on a GitHub Pull Request, attaching each comment to its file and line.

    357 GitHub stars~1k tokensUpdated 1 mo ago
    Auto-check: notes

Works with

Questions about Langchain4j AI Services Patterns

What does Langchain4j AI Services Patterns do?

Provides patterns to build declarative AI Services with LangChain4j for LLM integration, chatbot development, AI agent implementation, and conversational AI in Java. Langchain4j AI Services Patterns is an agent skill from giuseppe-trisciuoglio/developer-kit. Provides patterns to build declarative AI Services with LangChain4j for LLM integration, chatbot development, AI agent implementation, and conversational AI in Java.

When should I use Langchain4j AI Services Patterns?

Langchain4j AI Services Patterns fits situations like: creating AI-powered Java applications with minimal boilerplate; implementing conversational AI with memory; building AI agents with function calling.

How do I install Langchain4j AI Services Patterns in Claude Code?

Run `npx skills add giuseppe-trisciuoglio/developer-kit --skill langchain4j-ai-services-patterns -a claude-code`. Or copy the skill folder (plugins/developer-kit-java/skills/langchain4j-ai-services-patterns in giuseppe-trisciuoglio/developer-kit) into .claude/skills/langchain4j-ai-services-patterns in your project. Claude Code loads it when a task matches its description.

How do I install Langchain4j AI Services Patterns in Codex?

Run `npx skills add giuseppe-trisciuoglio/developer-kit --skill langchain4j-ai-services-patterns -a codex`. Or copy the skill folder (plugins/developer-kit-java/skills/langchain4j-ai-services-patterns in giuseppe-trisciuoglio/developer-kit) into .agents/skills/langchain4j-ai-services-patterns in your project. Codex loads it when a task matches its description.

Can I use Langchain4j AI Services Patterns in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add giuseppe-trisciuoglio/developer-kit --skill langchain4j-ai-services-patterns -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/langchain4j-ai-services-patterns, .gemini/skills/langchain4j-ai-services-patterns, .github/skills/langchain4j-ai-services-patterns and .opencode/skills/langchain4j-ai-services-patterns in your project.

What does Langchain4j AI Services Patterns need to run?

SKILL.md names no scripts, command-line tools or credentials: Langchain4j AI Services Patterns is instructions for the agent only. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash, Glob, Grep.

Does Langchain4j AI Services Patterns access the network?

SKILL.md names 1 domain. As links in the text: langchain4j.com. This is read from the text; nothing was executed.

Is Langchain4j AI Services Patterns safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Langchain4j AI Services Patterns use?

Langchain4j AI Services Patterns is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Langchain4j AI Services Patterns use?

About 1.6k tokens (SKILL.md is roughly 6.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 7.4k tokens, read only when the agent opens those files.

What are the alternatives to Langchain4j AI Services Patterns?

Skills that share tags, products or a category with Langchain4j AI Services Patterns: Google Agents CLI Adk Code (pifferologo/cloud-agents-cli, 129 stars), AI SDK (vercel-labs/ai-facts, 168 stars), Langchain (Orchestra-Research/AI-Research-SKILLs, 13k stars) and Sap Cloud SDK AI (secondsky/sap-skills, 462 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Langchain4j AI Services Patterns?

giuseppe-trisciuoglio (a GitHub user) maintains it in giuseppe-trisciuoglio/developer-kit, which has 357 GitHub stars. The repository holds 115 skills in this directory. The repository was last updated on September 10, 2026.

Source: giuseppe-trisciuoglio/developer-kit on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.