Content
<div align="center">
# RelaMind - AI Personal Growth Companion

> Record growth, understand yourself, become a better you
</div>
RelaMind is an AI-based personal growth tracking system that helps users better understand themselves and achieve continuous growth by recording life, reviewing history, and analyzing patterns.
[](https://star-history.com/#El-12stu/RelaMind&type=Date)
## 📸 Screenshots
### Homepage

*The homepage displays three core functions: intelligent dialogue, growth diary, and task assistant, using modern gradient design and animation effects*
### Intelligent Dialogue - Smart Routing Function
The intelligent dialogue system supports automatic recognition of user intentions and intelligent routing to the most appropriate processing method:
#### Normal Chat Mode

*Daily companionship chat, emotional support, guided recording*
#### RAG History Query Mode

*Automatically retrieves historical records to answer questions such as "What did I write in my diary?"*
#### Tool Calling Mode

*Automatically calls tools such as search, download, and file generation to complete tasks*
### Smart Routing Recognition Process
The system automatically recognizes user intentions and routes to the corresponding mode:
#### Normal Chat Routing

*The system recognizes it as a normal chat intention and uses the daily companionship mode*
#### RAG Query Routing

*The system recognizes it as a historical query intention and automatically uses the RAG retrieval mode*
#### Tool Calling Routing

*The system recognizes it as a tool calling intention and automatically calls the corresponding tool*
### Growth Diary

*Growth diary recording interface, supports mood selection, tag management, content recording, and automatic storage to the vector database*
### Manus Task Assistant 🤖
Manus is RelaMind's advanced intelligent agent, based on the ReAct (Reasoning and Acting) model, capable of autonomously planning complex tasks and executing multi-step operations.
#### Task Execution Process Display
**Step 1: Task Analysis and Planning**

*Manus analyzes user needs, develops an execution plan, and displays the thinking process and the tools called*
**Step 2: Information Collection and Processing**

*Manus automatically calls tools such as search and web scraping to collect information and displays the execution progress in real time*
**Step 3: Content Generation and File Creation**

*Manus organizes information and generates files, supports multiple formats such as txt and PDF, and provides download links*
**Step 4: Task Completion and Result Display**

*After the task is completed, Manus displays the final results and generated files, which users can download directly*
**Core Features**:
- **Streaming Output**: Displays each step immediately after execution, providing real-time feedback on task progress
- **Thinking Process Visualization**: Clearly displays the AI's thinking content and decision-making process
- **Tool Calling Transparency**: Displays the names of the tools called, hiding technical details
- **Automatic File Generation**: Supports generating files in formats such as txt and PDF, and provides download links
- **Multi-Step Collaboration**: Automatically coordinates multiple tools to complete complex tasks
### Sensitive Word Detection 🛡️
The system has a built-in sensitive word detection function to ensure content security and compliance.

*When the user enters content containing sensitive words, the system will immediately block and prompt, without calling the large model API, to protect system security*
**Technical Features**:
- **Trie Tree Algorithm**: Implements efficient sensitive word matching based on the prefix tree
- **Zero API Calls**: Directly intercepts when sensitive words are detected, without consuming large model API resources
- **Real-Time Detection**: Detects before the request is sent to the large model, with fast response speed
- **Configurable Vocabulary**: Supports loading sensitive word vocabulary from configuration files for easy maintenance and updating
## ✨ Product Positioning
RelaMind is positioned as "Your AI Growth Partner", helping users in the following ways:
- **Daily Companionship**: Listens to users' voices, providing emotional support and understanding
- **Guided Recording**: Encourages users to record life's moments and develop recording habits
- **Growth Analysis**: Analyzes growth patterns based on historical records, providing personalized insights
- **Proactive Care**: Remembers important user information and proactively cares at appropriate times
## 🎯 Core Features
### 1. Intelligent Dialogue 💬
**Features**:
- **Smart Routing**: Automatically recognizes user intentions (normal chat / historical query / tool calling) and selects the most appropriate processing method
- **Daily Companionship**: Multi-turn dialogue, emotional support, guided recording
- **Historical Retrieval**: Retrieves historical records based on RAG technology to answer questions such as "What was I doing at this time last year?"
- **Tool Calling**: Automatically calls tools such as search, download, and file generation
- **Dialogue Memory**: Stores dialogue history based on Cassandra to achieve long-term memory
**Use Cases**:
- Daily Chat: "I'm in a good mood today"
- Historical Query: "What was I doing at this time last year?"
- Tool Calling: "Help me search for today's weather"
### 2. Growth Diary 📝
**Features**:
- **Mood Recording**: 8 mood options (happy, excited, calm, tired, sad, anxious, angry, confused)
- **Tag Management**: Custom tags + common tags for easy classification and retrieval
- **RAG Storage**: Automatically stores to the vector database, supporting semantic retrieval
- **Rich Metadata**: Automatically records information such as date, time, mood, and tags
**Use Cases**:
- Record daily thoughts and moods
- Build a personal growth knowledge base
- Provide a data source for subsequent RAG retrieval
### 3. Manus Task Assistant 🤖
**Features**:
- **Autonomous Planning**: Based on the ReAct (Reasoning and Acting) model, autonomously reasons and acts
- **Multi-Tool Collaboration**: Automatically calls multiple tools to complete complex tasks (search, crawl, file generation, etc.)
- **Multi-Step Execution**: Supports complex multi-step task planning, up to 10 steps
- **Streaming Output**: Displays each step immediately after execution, providing real-time feedback on task progress
- **Thinking Visualization**: Clearly displays the AI's thinking process and decision-making logic
- **File Generation**: Automatically generates files in formats such as txt and PDF, and provides download links
- **Tool Calling Transparency**: Displays the names of the tools called, hiding technical details
**Use Cases**:
- Develop a complete plan (e.g., "Help me create a weekend plan")
- Information collection and organization (e.g., "Help me search for advice on learning fitness and return it in PDF format")
- Tasks that require multi-step operations (e.g., "Help me search for today's news and organize it into a document")
- Complex information processing (e.g., "Help me analyze a topic and generate a report")
**Execution Process**:
1. **Thinking Stage**: Analyze user needs and develop an execution plan
2. **Action Stage**: Call the appropriate tools (search, crawl, file operations, etc.)
3. **Iterative Execution**: Continue to think based on the results and execute the next step
4. **Task Completion**: Generate the final results and files, and provide download links
### 4. Intelligent Intent Recognition 🧠
**Technical Features**:
- **LLM-Based Classification**: Uses structured output for intent classification to improve accuracy
- **Rule Matching**: Fast rule matching (default), can be switched to LLM classification
- **Confidence Mechanism**: When the recognition confidence is low, actively asks the user for confirmation
- **Continuous Optimization**: Records recognition accuracy and continuously optimizes the model
### 5. Sensitive Word Detection 🛡️
**Features**:
- **Trie Tree Algorithm**: Implements efficient sensitive word matching based on the prefix tree, with a time complexity of O(n)
- **Zero API Calls**: Directly intercepts when sensitive words are detected, without consuming large model API resources
- **Real-Time Detection**: Detects before the request is sent to the large model, with fast response speed
- **Configurable Vocabulary**: Supports loading sensitive word vocabulary from the `sensitive_words.txt` configuration file
- **Advisor Interception**: Intercepts early in the call chain through the Spring AI Advisor mechanism
**Technical Implementation**:
- Uses `SensitiveWordAdvisor` as the highest priority Advisor (order = -100)
- Multi-pattern matching algorithm based on the Trie tree
- Supports Chinese and English sensitive word detection
- Automatically loads and initializes the sensitive word vocabulary
**Use Cases**:
- Prevent users from entering inappropriate content
- Protect system security and avoid malicious requests
- Save API calling costs
### 6. Tool Calling Ability 🔧
- **Internet Search**: Real-time search for the latest information
- **File Operations**: Save and read user files
- **Web Scraping**: Extract web page content
- **Resource Download**: Download resources such as images and documents
- **PDF Generation**: Generate personalized reports
- **Terminal Operations**: Execute code scripts
### 7. MCP Server Integration 🌐
- **Map Service**: Find nearby locations and plan routes
- **Image Search**: Search for images from specific websites
- **Extended Capabilities**: Supports custom MCP services
## 🛠️ Technology Stack
### Backend Technology
- **Java 21** + **Spring Boot 3**
- **Spring AI**: AI application development framework
- **LangChain4j**: AI application development tool library
- **Cassandra**: Dialogue memory persistence storage
- **PgVector**: Vector database for RAG retrieval
- **Spring AI ChatClient**: Multi-turn dialogue, Advisor, ChatMemory
- **Spring AI RAG**: Knowledge base retrieval augmented generation
- **Spring AI Tool Calling**: Tool calling ability
- **Spring AI MCP**: Model context protocol support
### AI Capabilities
- **Large Model Access**: Supports multiple AI large models (Tongyi Qianwen, GPT, etc.)
- **Prompt Engineering**: Optimized prompt design
- **Structured Output**: Uses Entity for structured data extraction
- **Streaming Response**: SSE streaming transmission to improve user experience
- **Multi-Modal Support**: Supports multiple inputs such as text and images
### Tools and Libraries
- **Kryo**: High-performance serialization
- **Jsoup**: Web scraping
- **iText**: PDF generation
- **Knife4j**: API documentation generation
### Frontend Technology
- **Vue 3**: Frontend framework
- **Vite**: Build tool
- **SSE**: Server-sent events for streaming responses
### Deployment
- **Docker**: Containerized deployment
- **Serverless**: Supports Serverless deployment
## 📁 Project Structure
```
RelaMind/
├── src/main/java/io/el12stu/RelaMind/
│ ├── app/ # Core application logic
│ │ └── RelaMindApp.java # Smart routing, RAG, tool calling
│ ├── agent/ # AI intelligent agent
│ │ ├── Manus.java # Autonomous planning intelligent agent
│ │ └── ReActAgent.java # ReAct mode intelligent agent
│ ├── advisor/ # Spring AI Advisor
│ │ ├── SensitiveWordAdvisor.java
│ │ ├── IntentDetectionService.java
│ │ └── ...
│ ├── chatmemory/ # Dialogue memory
│ │ └── CassandraBasedChatMemory.java
│ ├── rag/ # RAG related
│ │ ├── RelaMindAppDocumentLoader.java
│ │ ├── QueryRewriter.java
│ │ └── ...
│ ├── service/ # Business service
│ │ ├── IntentDetectionService.java # Intent recognition
│ │ ├── DiaryService.java # Diary storage service
│ │ └── SensitiveWordService.java
│ ├── tools/ # Tool definition
│ │ ├── WebSearchTool.java
│ │ ├── FileOperationTool.java
│ │ ├── PDFGenerationTool.java
│ │ └── ...
│ └── controller/ # API interface
│ ├── AiController.java # Intelligent dialogue interface
│ └── DiaryController.java # Diary recording interface
├── src/main/resources/
│ ├── application.yml # Configuration file
│ └── document/ # Knowledge base document
└── ai-agent-frontend/ # Frontend project
└── src/
├── views/
│ ├── Home.vue # Homepage (three function cards)
│ ├── RelaMind.vue # Intelligent dialogue page
│ ├── Diary.vue # Growth diary page
│ └── SuperAgent.vue # Task assistant page
├── components/
│ └── ChatRoom.vue # Chat room component
└── api/
└── index.js # API call encapsulation
```
## 🚀 Quick Start
### Environment Requirements
- JDK 21+
- Maven 3.6+
- PostgreSQL (supports PgVector)
- Cassandra (optional, for dialogue memory)
### Configuration Instructions
1. Configure the AI large model API Key (in `application.yml`)
2. Configure the database connection (PostgreSQL, Cassandra)
3. Configure the vector database (PgVector)
### Run the Project
#### Method 1: Local Development Run
```bash
# Backend
mvn spring-boot:run
# Frontend
cd ai-agent-frontend
npm install
npm run dev
```
#### Method 2: Docker Deployment (Recommended) 🐳
**Difficulty Assessment**: ⭐⭐☆☆☆ (Easy to Medium)
Dockerization has been completed and supports two deployment methods: using pre-built images (recommended) or building locally.
**Prerequisites**:
- Install Docker and Docker Compose
- Configure the AI large model API Key
---
### 🚀 Method A: Use Pre-Built Images (Recommended, Simplest)
**Advantages**: No need to build the environment, pull and use directly, quick start
```bash
# 1. Clone the repository
git clone https://github.com/your-username/RelaMind.git
cd RelaMind
# 2. Create the configuration file
cp env.example .env
# 3. Edit the .env file and configure the following:
# - DASHSCOPE_API_KEY (required): Your Alibaba Cloud DashScope API Key
# - GITHUB_USER (required): Your GitHub username
# - GITHUB_REPO (required): Repository name (usually RelaMind)
# - POSTGRES_PASSWORD (optional, recommended to modify): Database password
# - CASSANDRA_PASSWORD (optional, recommended to modify): Cassandra password
# 4. Modify the image address in docker-compose.yml
# Replace your-username with your GitHub username
# For example: ghcr.io/your-username/RelaMind/backend:latest
# 5. Start all services
docker-compose -f docker-compose.yml up -d
# 6. View service status
docker-compose -f docker-compose.yml ps
# 7. View logs
docker-compose -f docker-compose.yml logs -f backend
```
**Access the Application**:
- Frontend: http://localhost
- Backend API: http://localhost:8123/api
- Swagger Documentation: http://localhost:8123/api/swagger-ui.html
---
### 🔨 Method B: Build Images Locally
**Advantages**: You can customize build parameters, suitable for development and debugging
```bash
# 1. Create the .env file (optional, used to configure sensitive information)
cp env.example .env
# Edit the .env file, at least configure DASHSCOPE_API_KEY
# 2. Start with the development configuration (will automatically build the image)
docker-compose up -d --build
# 3. View service status
docker-compose ps
# 4. View logs
docker-compose logs -f backend
```
---
### 📋 Configuration Instructions
All configurations are injected through environment variables. **The image does not contain any sensitive information**.
**Required Configuration**:
- `DASHSCOPE_API_KEY`: Alibaba Cloud DashScope API Key
**Optional Configuration** (with default values):
- `POSTGRES_USER`: Default `relamind`
- `POSTGRES_PASSWORD`: Default `relamind123` (⚠️ Production environment recommended to modify)
- `CASSANDRA_USERNAME`: Default `cassandra`
- `CASSANDRA_PASSWORD`: Default `cassandra` (⚠️ Production environment recommended to modify)
For detailed configuration instructions, please see [CONFIGURATION.md](CONFIGURATION.md)
---
### 🛠️ Common Commands
```bash
# Start the service
docker-compose -f docker-compose.yml up -d
# Stop the service
docker-compose -f docker-compose.yml down
# Stop and delete data volumes (⚠️ Will delete all data)
docker-compose -f docker-compose.yml down -v
# View logs
docker-compose -f docker-compose.yml logs -f backend
# Restart the service
docker-compose -f docker-compose.yml restart backend
# Restart after modifying the configuration
# 1. Modify the .env file
# 2. Restart the service
docker-compose -f docker-compose.yml restart backend
```
---
### 📦 Docker File Instructions
- `Dockerfile`: Backend application image (multi-stage build, optimize image size)
- `ai-agent-frontend/Dockerfile`: Frontend application image (Nginx hosting)
- `docker-compose.yml`: Development environment configuration (local build image)
- `docker-compose.prod.yml`: Production environment configuration (using pre-built images)
- `.dockerignore`: Optimize build speed, exclude unnecessary files
---
### ⚠️ Notes
1. **First time using pre-built images**:
- You need to modify the image address in `docker-compose.prod.yml` first
- Replace `your-username` with your GitHub username
- Make sure the image is published to the GitHub Container Registry
2. **Port Occupancy**:
- Make sure ports 80, 8123, 5432, and 9042 are not occupied
3. **Data Persistence**:
- Data is stored in Docker volumes
- Deleting the container will not lose data
- Using `docker-compose down -v` will delete all data
4. **Configuration Modification**:
- After modifying the `.env` file, restart the service for the changes to take effect
- No need to rebuild the image
---
### 📚 More Documentation
- [CONFIGURATION.md](CONFIGURATION.md) - Detailed configuration instructions
- [DEPLOYMENT.md](DEPLOYMENT.md) - Complete deployment guide
## 📝 Usage Examples
### Smart Conversation Example
**Normal Chat**:
```
User: Feeling good today
AI: Great! Can you share what makes you feel so good? Do you want to record it so you can look back on these wonderful moments in the future?
```
**Historical Record Query (Automatic use of RAG)**:
```
User: What was I doing at this time last year?
AI: According to your records in March 2023, you were preparing for an important project and also recorded some thoughts on work stress...
```
**Tool Invocation (Automatic Tool Invocation)**:
```
User: Help me search for today's weather
AI: [Automatically calling the search tool] According to the search results, the weather is sunny today, temperature...
```
### Growth Diary Example
Users can record through the interface:
- Select mood: 😊 Happy
- Add tags: Work, Thinking
- Enter content: Finished an important project today, feeling very accomplished...
After saving, these records will be automatically stored in the vector database, and can be retrieved through intelligent dialogue later.
### Manus Task Assistant Example
**Example 1: Generate Learning Suggestion Document**
```
User: I want to learn about fitness, give me some suggestions, and return them in txt file format.
Manus Execution Process:
━━━ Step 1 ━━━
💭 Thinking: The user wants to learn about fitness and get some suggestions, and finally return it in txt format. First, it is necessary to collect effective suggestions on learning fitness, and then generate a txt file.
🔧 Tools called: searchWeb
━━━ Step 2 ━━━
💭 Thinking: Search results have been obtained, and relevant web page content needs to be crawled to obtain detailed information.
🔧 Tools called: scrapeWebPage
━━━ Step 3 ━━━
💭 Thinking: Enough information has been collected, and now it needs to be organized and a txt file generated.
🔧 Tools called: writeFile
━━━ Step 4 ━━━
💭 Thinking: The file has been successfully generated and the task is completed.
✅ Task completed, tools called: doTerminate
📁 Generated files:
1. Fitness Suggestions.txt [Click to download]
```
**Example 2: Generate PDF Report**
```
User: Help me search for today's news and organize it into a PDF format for return.
Manus Execution Process:
1. Search for news → 2. Crawl web page content → 3. Organize information → 4. Generate PDF → 5. Task completed
📁 Generated files: Today's News.pdf [Click to download]
```
### Sensitive Word Detection Example
```
User input: Content containing sensitive words
System response: [System Security Alert]: Your input contains sensitive content and the request has been intercepted.
Features:
- Zero API calls: Direct interception without consuming large model resources
- Real-time response: Millisecond-level detection speed
- Safe and reliable: Protect the system from inappropriate content
```
## 🎨 Product Features
1. **Intelligent Routing**: Automatically identifies user intentions, without user selection, the system automatically selects the most appropriate processing method
2. **Long-term Memory**: Long-term memory based on vector database, truly understanding the user's growth trajectory
3. **Personalization**: Provides personalized suggestions based on user history data, rather than generalities
4. **Integrated Experience**: Smart conversation, growth diary, and task assistant are seamlessly integrated
5. **Continuous Optimization**: Record accuracy rate and continuously optimize the intent recognition model
## 🔄 Functional Flow
### Complete Usage Flow
1. **Recording Stage**: Users record thoughts and moods in the "Growth Diary"
2. **Storage Stage**: Diaries are automatically stored in the vector database (RAG)
3. **Conversation Stage**: Users communicate with AI in "Smart Conversation"
4. **Retrieval Stage**: When a user asks about history, the system automatically retrieves relevant records through RAG
5. **Analysis Stage**: AI provides personalized analysis and suggestions based on historical data
### Intelligent Routing Flow
```
User input
↓
Intent Recognition (Rules/LLM)
↓
┌─────────┬──────────┬──────────┐
│Normal Chat │ RAG Query │ Tool Invocation │
└─────────┴──────────┴──────────┘
↓
Intelligent Reply
```
## 📄 License
This project is licensed under the [MIT License](LICENSE).
---
**RelaMind** - Record growth, understand yourself, and become a better you ✨
Connection Info
You Might Also Like
awesome-mcp-servers
A collection of MCP servers.
git
A Model Context Protocol server for Git automation and interaction.
Appwrite
Build like a team of hundreds
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
chatbox
User-friendly Desktop Client App for AI Models/LLMs (GPT, Claude, Gemini, Ollama...)
oh-my-opencode
Background agents · Curated agents like oracle, librarians, frontend...