langchain4j-ai-services-patterns

Featured

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.

AI & Automation 330 stars 39 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 91/100

Stars 20%
84
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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); } ``` ...

Details

Author
giuseppe-trisciuoglio
Repository
giuseppe-trisciuoglio/developer-kit
Created
10 months ago
Last Updated
2 days ago
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category