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 is an essential skill for programmers, significantly increasing competitiveness in job hunting. Previously, I guided everyone through an [open-source AI super agent project](https://github.com/liyupi/yu-ai-agent) using Spring AI. This time, I will help you quickly master another mainstream Java AI application development framework, LangChain4j.
This tutorial project is also carefully designed, rejecting tedious theory, and instead using a programming assistant project to help you learn the mainstream uses of LangChain4j through practical experience. After completing this tutorial, not only will you have learned LangChain4j, but you will also have 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 by Programmer Yupi on WeChat Official Account)
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, AI code generation, etc., are 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
# Navigate to 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 │
│ - Dialogue Model │
│ - Embedding Model │
│ - Streaming Output │
└─────────────────┘
```
## Core Modules
- `AiCodeHelperService`: Core dialogue service
- `QwenChatModelConfig`: Model configuration management
- `RagConfig`: Retrieval enhancement configuration
- `McpConfig`: Model context protocol
- `InterviewQuestionTool`: Interview question search
- `SafeInputGuardrail`: Input safety protection
- `ChatModelListener`: Dialogue listener
## Acknowledgments
- [LangChain4j](https://github.com/langchain4j/langchain4j) - A powerful AI application development framework
- [Alibaba Cloud Tongyi Qianwen](https://dashscope.aliyun.com/) - An excellent large language model
- [Spring Boot](https://spring.io/projects/spring-boot) - A simplified Java development framework
- [Vue.js](https://vuejs.org/) - A progressive JavaScript framework
Connection Info
You Might Also Like
MarkItDown MCP
MarkItDown-MCP is a lightweight server for converting various URIs to Markdown.
Context 7
Context7 MCP provides up-to-date code documentation for any prompt.
Continue
Continue is an open-source project for enhancing MCP Server functionality.
semantic-kernel
Build and orchestrate AI agents with the enterprise-ready Semantic Kernel.
Github
The GitHub MCP Server connects AI tools to manage repositories, automate...
Playwright
A lightweight MCP server for browser automation using Playwright's...