Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,7 @@ DOCUMENT_CHUNK_OVERLAP=200
EMBEDDING_MAX_TEXT_LENGTH=3072

DOCKER_BACKEND_DOCKERFILE=Dockerfile.backend.cuda

# Hugging Face configurations
# Hugging face China mirror website endpoint: https://hf-mirror.com
HF_ENDPOINT=https://huggingface.co
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ data/sqlite/*
data/uploads/*
data/progress/*
lpm_frontend/node_modules
lpm_frontend/yarn.lock

# L2 Model Storage
resources/model/output/merged_model/*
Expand Down
168 changes: 115 additions & 53 deletions Makefile

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ Star and join us, and you will receive all release notifications from GitHub wit

| Memory (GB) | Docker Deployment (Windows/Linux) | Docker Deployment (Mac) | Integrated Setup (Windows/Linux) | Integrated Setup (Mac) |
|--------------|-----------------------------|-------------------|--------------------------|----------------|
| 8 | ~0.8B (example) | ~0.4B (example) | ~1.0B (example) | ~0.6B (example) |
| 16 | 1.5B (example) | 0.5B (example) | ~2.0B (example) | ~0.8B (example) |
| 32 | ~2.8B (example) | ~1.2B (example) | ~3.5B (example) | ~1.5B (example) |
| 8 | ~0.5B | ~0.5B | ~1.5B | ~0.5B |
| 16 | 1.5B | 0.5B | ~3.0B | ~0.5B |
| 32 | ~3B | ~1.5B | ~3B | ~1.5B |

> **Note**: Models below 0.5B may not provide satisfactory performance for complex tasks. And we're continuously improving cross-platform support - please [submit an issue](https://github.com/mindverse/Second-Me/issues/new) for feedback or compatibility problems on different operating systems.

Expand Down
Binary file modified dependencies/graphrag-1.2.1.dev27.tar.gz
Binary file not shown.
Binary file modified dependencies/graphrag-modified.tar.gz
Binary file not shown.
142 changes: 142 additions & 0 deletions docs/Configuration Guide for CN zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# 中国大陆地区环境下的项目配置指南

本文档提供了在中国大陆地区使用国内网络环境进行项目配置的方法,适用于 Docker 和非 Docker 用户。

## 非 Docker 用户配置

非 Docker 用户可以直接使用以下命令进行配置:

```bash
make setup-cn
```

## Docker 用户配置

Docker 用户需要修改 Docker 的配置文件,以使用国内镜像源。以下是不同操作系统的配置方法:

### Mac 系统

#### 方法一:通过 Docker Desktop 界面配置

1. 点击桌面顶部菜单栏的 Docker 图标
2. 选择 "Settings" 或 "首选项"
3. 点击 "Docker Engine" 选项卡
4. 将以下配置复制到配置编辑器中(注意保留其他已有配置):

```json
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"experimental": false,
"registry-mirrors": [
"https://docker.1ms.run",
"https://docker.xuanyuan.me"
]
}
```

5. 点击 "Apply & Restart" 按钮应用更改并重启 Docker

#### 方法二:直接修改配置文件

1. 打开终端
2. 使用文本编辑器打开 Docker 配置文件:

```bash
mkdir -p ~/.docker
nano ~/.docker/daemon.json
```

3. 将以下内容复制到文件中:

```json
{
"registry-mirrors": [
"https://docker.1ms.run",
"https://docker.xuanyuan.me"
]
}
```

4. 保存文件(在 nano 中按 Ctrl+O,然后按 Enter,再按 Ctrl+X 退出)
5. 重启 Docker Desktop

### Linux 系统

1. 创建或编辑 Docker 配置文件:

```bash
sudo mkdir -p /etc/docker
sudo nano /etc/docker/daemon.json
```

2. 将以下内容复制到文件中:

```json
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"experimental": false,
"registry-mirrors": [
"https://docker.1ms.run",
"https://docker.xuanyuan.me"
]
}
```

3. 保存文件并重启 Docker 服务:

```bash
sudo systemctl daemon-reload
sudo systemctl restart docker
```

### Windows 系统

1. 右键点击任务栏中的 Docker 图标
2. 选择 "Settings"
3. 点击左侧菜单中的 "Docker Engine"
4. 也可以直接修改配置文件,位置通常在:`C:\Users\<用户名>\.docker\daemon.json`
5. 将以下配置复制到配置编辑器中(注意保留其他已有配置):

```json
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"experimental": false,
"registry-mirrors": [
"https://docker.1ms.run",
"https://docker.xuanyuan.me"
]
}
```

6. 点击 "Apply & Restart" 按钮应用更改并重启 Docker

## 验证配置

配置完成后,可以通过以下命令验证镜像源是否生效:

```bash
docker info
```

在输出信息中应该能看到 "Registry Mirrors" 部分列出了你配置的镜像源。

## 常见问题

1. 如果遇到权限问题,请确保你有足够的权限修改 Docker 配置文件。

2. 配置完成后如果 Docker 无法启动,请检查配置文件格式是否正确,确保 JSON 格式有效。
142 changes: 142 additions & 0 deletions docs/Configuration Guide for CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# Project Configuration Guide for Environments in mainland China

This document provides methods to configure the project using domestic network resources in mainland China, applicable for both Docker and non-Docker users.

## Non-Docker User Configuration

Non-Docker users can directly use the following command for configuration:

```bash
make setup-cn
```

## Docker User Configuration

Docker users need to modify the Docker configuration file to use mirrors in China. Below are configuration methods for different operating systems:

### Mac System

#### Method 1: Configure through Docker Desktop UI

1. Click on the Docker icon in the top menu bar
2. Select "Settings" or "Preferences"
3. Click on the "Docker Engine" tab
4. Copy the following configuration to the configuration editor (note to preserve any existing configurations):

```json
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"experimental": false,
"registry-mirrors": [
"https://docker.1ms.run",
"https://docker.xuanyuan.me"
]
}
```

5. Click the "Apply & Restart" button to apply changes and restart Docker

#### Method 2: Directly edit the configuration file

1. Open Terminal
2. Open the Docker configuration file with a text editor:

```bash
mkdir -p ~/.docker
nano ~/.docker/daemon.json
```

3. Copy the following content to the file:

```json
{
"registry-mirrors": [
"https://docker.1ms.run",
"https://docker.xuanyuan.me"
]
}
```

4. Save the file (in nano, press Ctrl+O, then Enter, then Ctrl+X to exit)
5. Restart Docker Desktop

### Linux System

1. Create or edit the Docker configuration file:

```bash
sudo mkdir -p /etc/docker
sudo nano /etc/docker/daemon.json
```

2. Copy the following content to the file:

```json
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"experimental": false,
"registry-mirrors": [
"https://docker.1ms.run",
"https://docker.xuanyuan.me"
]
}
```

3. Save the file and restart the Docker service:

```bash
sudo systemctl daemon-reload
sudo systemctl restart docker
```

### Windows System

1. Right-click on the Docker icon in the taskbar
2. Select "Settings"
3. Click on "Docker Engine" in the left menu
4. You can also directly modify the configuration file, typically located at: `C:\Users\<username>\.docker\daemon.json`
5. Copy the following configuration to the configuration editor (note to preserve any existing configurations):

```json
{
"builder": {
"gc": {
"defaultKeepStorage": "20GB",
"enabled": true
}
},
"experimental": false,
"registry-mirrors": [
"https://docker.1ms.run",
"https://docker.xuanyuan.me"
]
}
```

6. Click the "Apply & Restart" button to apply changes and restart Docker

## Verify Configuration

After configuration, you can verify if the mirror sources are effective with the following command:

```bash
docker info
```

In the output information, you should be able to see the "Registry Mirrors" section listing the mirror sources you configured.

## Common Issues

1. If you encounter permission issues, please ensure you have sufficient permissions to modify the Docker configuration file.

2. If Docker fails to start after configuration, check if the configuration file format is correct and ensure the JSON format is valid.
35 changes: 35 additions & 0 deletions env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Application Configuration
APP_NAME=second-me
APP_VERSION=1.0.0
APP_WORD="Hello from Second Me"
LOCAL_APP_PORT=8000

# Database Configuration
DB_FILE=data/sqlite/lpm.db
DB_POOL_SIZE=5
DB_POOL_RECYCLE=3600

# Directory Configuration
BASE_DIR=/app
USER_DATA_PIPELINE_DIR=data/pipeline

# Vector Store Settings
CHROMA_PERSIST_DIRECTORY=data/chroma_db
CHROMA_COLLECTION_NAME=documents

# Service URLs
KERNEL2_SERVICE_URL=http://127.0.0.1:8000
REGISTRY_SERVICE_URL=http://registry:8080

# Email Configuration
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your-email@gmail.com
SMTP_PASSWORD=your-app-specific-password
SMTP_USE_TLS=True
SENDER_EMAIL=your-email@gmail.com
NOTIFICATION_EMAIL=your-notification-email@example.com

# Training Configuration
DOCUMENT_CHUNK_SIZE=1000
DOCUMENT_CHUNK_OVERLAP=200
4 changes: 2 additions & 2 deletions lpm_frontend/src/app/dashboard/playground/chat/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ export default function PlaygroundChat() {
}, [loadInfo, modelType]);
const originSettings = useMemo(() => {
return {
enableL0Retrieval: true,
enableL1Retrieval: true,
enableL0Retrieval: false,
enableL1Retrieval: false,
enableHelperModel: false,
selectedModel: 'ollama',
apiKey: 'http://localhost:11434',
Expand Down
2 changes: 1 addition & 1 deletion lpm_frontend/src/app/dashboard/train/memories/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default function TrainPage() {
};

const handleDeleteMemory = async (id: string, name: string) => {
const res = await deleteMemory(name);
const res = await deleteMemory(id);

if (res.data.code === 0) {
setMemories((prev) => {
Expand Down
2 changes: 1 addition & 1 deletion lpm_frontend/src/components/OnboardingTutorial/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function OnboardingTutorial({ onComplete, onClose }: OnboardingTu
image: '/images/step_3.png'
},
{
title: 'Join AI Network',
title: 'Export your Second Me',
description:
'Explore interactions between your Second Me and other AI entities in the network.',
image: '/images/step_4.png'
Expand Down
Loading