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 by me, rejecting tedious theories and instead using a programming assistant project to help you learn the mainstream uses 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 by Programmer Yupi on WeChat)
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 │
│ - 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
You Might Also Like
Ollama
Ollama enables easy access to large language models on various platforms.

n8n
n8n is a secure workflow automation platform for technical teams with 400+...
OpenWebUI
Open WebUI is an extensible web interface for customizable applications.

Dify
Dify is a platform for AI workflows, enabling file uploads and self-hosting.

Zed
Zed is a high-performance multiplayer code editor from the creators of Atom.
MarkItDown MCP
markitdown-mcp is a lightweight MCP server for converting various URIs to Markdown.