Compare commits

..

2 Commits

Author SHA1 Message Date
hermes-bot
961cc218f1 add mem0 deployment notes 2026-05-30 13:51:25 +00:00
hermes-bot
5cd3ecd5e5 Add K3s containerd proxy config 2026-05-30 02:03:05 +00:00
2 changed files with 87 additions and 0 deletions

65
AI/mem0/deploy.md Normal file
View File

@@ -0,0 +1,65 @@
# mem0 自托管部署
## 镜像
```
ccr.ccs.tencentyun.com/tei_agent/mem0:latest
```
## 依赖服务tei namespace
| 服务 | 地址 | 用途 |
|---|---|---|
| PostgreSQL | 192.168.3.49:5432 | 关系数据存储 |
| Qdrant | qdrant:6333 | 向量存储 |
| TEI (BGE-M3) | tei:8080 | Embedder文本→向量 |
## 环境变量
### ConfigMap (mem0-env)
| 变量 | 值 | 说明 |
|---|---|---|
| DATABASE_URL | postgres://gitlab:gitlab@192.168.3.49:5432/mem0 | 连接字串 |
| APP_DB_NAME | mem0_app | 数据库名 |
| QDRANT_HOST | qdrant | Qdrant 服务地址 |
| QDRANT_PORT | 6333 | Qdrant 端口 |
| QDRANT_COLLECTION_NAME | mem0 | 集合名 |
| EMBEDDER_PROVIDER | tei | Embedder 使用 TEI |
| TEI_ENDPOINT | http://tei:8080 | TEI endpoint |
| LLM_PROVIDER | openai | LLM providerMiniMax 兼容 OpenAI 格式) |
| OPENAI_API_KEY | YOUR_MINIMAX_KEY | MiniMax API key |
| OPENAI_BASE_URL | https://api.minimax.chat/v1 | MiniMax API 地址 |
| AUTH_DISABLED | false | 启用认证 |
| MEM0_TELEMETRY | false | 关闭遥测 |
| REQUEST_LOG_RETENTION_DAYS | 30 | 日志保留天数 |
### Secret (mem0-secrets)
| 变量 | 说明 |
|---|---|
| JWT_SECRET | JWT 签名密钥 |
| ADMIN_API_KEY | 管理后台 API key |
| POSTGRES_PASSWORD | PostgreSQL 密码 |
## 部署清单
```yaml
# mem0 deployment + configmap + secret + service
```
## 前置要求
1. **pgvector 扩展** — PostgreSQL 需要安装 pgvector
2. **mem0_app 数据库** — 需要提前创建
3. **Qdrant collection** — mem0 启动时自动创建(首次调用时)
## 验证
```bash
kubectl get pods -n tei -l app=mem0
kubectl logs -n tei -l app=mem0 --tail=50
# 健康检查
curl http://mem0:8000/health
```

View File

@@ -60,6 +60,28 @@ git config --global http.proxy http://用户名:密码@东京服务器IP:3128
git config --global https.proxy http://用户名:密码@东京服务器IP:3128
```
### K3s (containerd) 配置
K3s 默认使用 containerd不走 systemd代理需要在 k3s service 环境变量中配置。
```bash
# 添加代理环境变量到 k3s service
mkdir -p /etc/systemd/system/k3s.service.d
cat > /etc/systemd/system/k3s.service.d/http-proxy.conf <<EOF
[Service]
Environment="HTTP_PROXY=http://用户名:密码@东京服务器IP:3128"
Environment="HTTPS_PROXY=http://用户名:密码@东京服务器IP:3128"
Environment="NO_PROXY=localhost,127.0.0.1,10.0.0.0/8,.svc,.cluster.local"
EOF
systemctl daemon-reload && systemctl restart k3s
```
验证:
```bash
crictl pull nginx
kubectl run nginx --image=nginx
```
### 取消代理(如需直连)
```bash
git config --global --unset http.proxy