采用向量数据库实现长期记忆
Some checks failed
构建并部署 AI Agent 服务 / deploy (push) Has been cancelled

This commit is contained in:
2026-04-15 23:52:13 +08:00
parent de68916c5a
commit a92a220ff3
24 changed files with 1237 additions and 713 deletions

View File

@@ -4,32 +4,49 @@
# =============================================================================
# -----------------------------------------------------------------------------
# AI 模型 API 密钥(必需 - 请修改为真实值)
# AI 模型 API 密钥(必需 - 请填入真实值)
# -----------------------------------------------------------------------------
ZHIPUAI_API_KEY=your_zhipuai_api_key_here
ZHIPUAI_API_KEY=your_api_key_here
DEEPSEEK_API_KEY=your_deepseek_api_key_here
VLLM_LOCAL_KEY=token-abc123
LLAMACPP_API_KEY=token-abc123
# -----------------------------------------------------------------------------
# vLLM 服务配置
# llama.cpp 服务配置
# -----------------------------------------------------------------------------
# Docker 部署时,如果 vLLM 在宿主机运行,使用 FRP 穿透地址或宿主机 IP
# 如果 vLLM 也在 Docker 中,使用 Docker 服务名或容器 IP
VLLM_BASE_URL=http://115.190.121.151:18000/v1
# 主 LLM 服务 (Gemma-4-E2B GGUF) - 端口 8081
VLLM_BASE_URL=http://localhost:8081/v1
# Embedding 服务 (embeddinggemma-300M GGUF) - 端口 8082
VLLM_EMBEDDING_URL=http://localhost:8082/v1
# -----------------------------------------------------------------------------
# Mem0 记忆层配置
# -----------------------------------------------------------------------------
# ⭐ 注意Mem0 现在直接复用主 LLM 实例,无需单独配置
# Qdrant 向量数据库(远程服务器上的独立容器)
QDRANT_URL=http://115.190.121.151:6333
QDRANT_COLLECTION_NAME=mem0_user_memories
# -----------------------------------------------------------------------------
# 数据库配置
# -----------------------------------------------------------------------------
# Docker Compose 内部网络,使用服务名 'postgres'
DB_URI=postgresql://postgres:mysecretpassword@postgres:5432/langgraph_db?sslmode=disable
# PostgreSQL 连接字符串(远程服务器上的独立容器)
DB_URI=postgresql://postgres:mysecretpassword@115.190.121.151:5432/langgraph_db?sslmode=disable
# -----------------------------------------------------------------------------
# 前端配置(通过 docker-compose.yml 注入,此处仅作文档说明)
# 前端配置
# -----------------------------------------------------------------------------
# 注意API_URL 在 docker-compose.yml 中已配置为 http://backend:8001/chat
# 本地无需设置Docker 容器启动时会自动注入
# API_URL=http://backend:8001/chat
# Docker Compose 内部网络,使用服务名 'backend'
API_URL=http://backend:8001/chat
# 生产环境 - 仅显示关键信息
# -----------------------------------------------------------------------------
# 应用行为配置
# -----------------------------------------------------------------------------
MEMORY_SUMMARIZE_INTERVAL=10
ENABLE_GRAPH_TRACE=false
# -----------------------------------------------------------------------------
# 日志配置
# -----------------------------------------------------------------------------
LOG_LEVEL=WARNING
DEBUG=false