Content
# 🤖 AI Programming Assistant - LangChain4j Practical Project
> An AI intelligent programming learning and job coaching robot based on LangChain4j + Tongyi Qianwen
[](https://spring.io/projects/spring-boot)
[](https://vuejs.org/)
[](https://github.com/langchain4j/langchain4j)
[](https://www.oracle.com/java/)
Hello everyone, I am Programmer Yupi. Nowadays, AI application development can be considered an essential skill for programmers, significantly increasing competitiveness during job hunting. Previously, I used Spring AI to guide everyone through an [open-source AI super agent project](https://github.com/liyupi/yu-ai-agent). This time, I will help you quickly master another mainstream Java AI application development framework, LangChain4j.
This tutorial project is also carefully designed by me, rejecting dull theory and instead using a programming assistant project to help you learn the mainstream usage of LangChain4j in practice. After completing this tutorial, you will not only have learned LangChain4j but also gained a project experience. Isn't that wonderful?
Project video tutorial: https://bilibili.com/video/BV1X4GGziEyr
Text tutorial: https://mp.weixin.qq.com/s/7cNh7ndeiWiHBjnkTkz_Zg (in the article of the public account Programmer Yupi)
More original project tutorials and programming learning paths by Yupi can be found on [Programming Navigation Learning Network](https://www.codefather.cn/).
⭐ If this project helps you, please give Yupi a Star. This will motivate me to continue producing more valuable tutorials. Thank you very much!

In this project, topics such as conversation memory, structured output, RAG (Retrieval-Augmented Generation), tool invocation, MCP (Model Context Protocol), guardrails, observability, and AI code generation will all be explained and practiced from scratch.
## ✨ Project Introduction
### Positioning
- Programming Learning Mentor: Provides clear learning path planning and personalized suggestions
- Job Interview Assistant: Covers resume optimization, interview skills, and high-frequency question analysis
- Code Q&A Expert: Answers programming technical questions in real-time and provides code examples
### Technology
#### AI Services
- **LangChain4j Integration**: Utilizes the industry-leading AI application development framework
- **Tongyi Qianwen Model**: Based on Alibaba Cloud's large model, professional and reliable
- **Streaming Response**: Real-time typing effect to enhance user experience
#### Security Mechanism
- **Input Safety Protection**: Detects sensitive content to ensure application security
#### Tool Integration
- **RAG Retrieval Enhancement**: Combines local knowledge base to provide accurate answers
- **MCP Protocol Support**: Model Context Protocol to enhance AI capabilities
- **Interview Question Search**: Real-time fetching of the latest interview questions
- **Web Crawler Tool**: Obtains real-time technical information
## 🚀 Quick Start
### Environment Requirements
- **Java**: JDK 21+
- **Node.js**: 16.0+
- **Maven**: 3.6+
- **Tongyi Qianwen API**: API key application required
- **Big Model API**: API key application required
### Startup Steps
#### 1. Start the Backend
```bash
# Clone the project
git clone <repository-url>
cd ai-code-helper
# Configure API keys
# Edit src/main/resources/application.yml
# Fill in your Tongyi Qianwen API and Big Model API keys
# Start the backend service
mvn spring-boot:run
```
#### 2. Start the Frontend
```bash
# Enter the frontend directory
cd ai-code-helper-frontend
# Install dependencies
npm install
# Start the development server
npm run dev
```
#### 3. Access the Application
- Frontend address: `http://localhost:5173`
- Backend API: `http://localhost:8081/api`
## Technical Architecture
```
┌─────────────────┐ ┌─────────────────┐
│ Vue.js Frontend │────│ Spring Boot │
│ - Chat Interface │ │ Backend Service │
│ - Real-time Stream │ │ - RESTful API │
│ - Markdown │ │ - SSE Push │
└─────────────────┘ └─────────────────┘
│
┌─────────────────┐
│ LangChain4j │
│ - AI Service Layer │
│ - Tool Integration │
│ - Security Protection │
└─────────────────┘
│
┌─────────────────┐
│ Tongyi Qianwen API │
│ - Conversation Model │
│ - Embedding Model │
│ - Streaming Output │
└─────────────────┘
```
## Core Modules
- `AiCodeHelperService`: Core conversation service
- `QwenChatModelConfig`: Model configuration management
- `RagConfig`: Retrieval enhancement configuration
- `McpConfig`: Model context protocol
- `InterviewQuestionTool`: Interview question search
- `SafeInputGuardrail`: Input safety protection
- `ChatModelListener`: Conversation listener
## Acknowledgments
- [LangChain4j](https://github.com/langchain4j/langchain4j) - Powerful AI application development framework
- [Alibaba Cloud Tongyi Qianwen](https://dashscope.aliyun.com/) - Excellent large language model
- [Spring Boot](https://spring.io/projects/spring-boot) - Simplified Java development framework
- [Vue.js](https://vuejs.org/) - Progressive JavaScript framework
Connection Info
You Might Also Like
markitdown
MarkItDown-MCP is a lightweight server for converting URIs to Markdown.
servers
Model Context Protocol Servers
Time
A Model Context Protocol server for time and timezone conversions.
Filesystem
Node.js MCP Server for filesystem operations with dynamic access control.
Sequential Thinking
A structured MCP server for dynamic problem-solving and reflective thinking.
git
A Model Context Protocol server for Git automation and interaction.