-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.env.example
More file actions
64 lines (56 loc) · 2.55 KB
/
Copy path.env.example
File metadata and controls
64 lines (56 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# =============================================================
# Enterprise AI Procurement Agent Platform — 环境变量模板
# 复制为 .env 后填写。所有变量均有默认值(见 config.py),
# 但 LLM_API_KEY 是运行 Agent 的硬性前提。
# =============================================================
# ---- LLM(DeepSeek,OpenAI 兼容协议)----
LLM_API_KEY=sk-你的-DeepSeek-密钥
LLM_BASE_URL=https://api.deepseek.com
LLM_MODEL=deepseek-chat
LLM_TEMPERATURE=0.1
# 单次 LLM 调用超时(秒)。Agent 一次请求可能串行调用 8~12 次 LLM,
# 所以单次不能太松,否则整体延迟失控(面试点:为什么 Agent 的 LLM 超时比普通聊天机器人紧)
LLM_TIMEOUT=60
# ---- Embedding(硅基流动,OpenAI 兼容协议)----
EMBEDDING_API_KEY=sk-你的-硅基流动-密钥
EMBEDDING_BASE_URL=https://api.siliconflow.cn/v1
EMBEDDING_MODEL=BAAI/bge-large-zh-v1.5
EMBEDDING_DIM=1024
# Rerank 模型(可选,未配置时自动降级为本地分数重排)
RERANK_MODEL=BAAI/bge-reranker-v2-m3
# ---- PostgreSQL ----
# 主连接:app_role(建表、种子数据、文档写入)
DATABASE_URL=postgresql+asyncpg://app_role:app_password@localhost:5432/enterprise_agent
# 只读连接:agent_readonly —— execute_sql tool 专用。
# 三层只读防御的第三层:数据库权限兜底(见 tools.py 注释)
DATABASE_READONLY_URL=postgresql+asyncpg://agent_readonly:readonly_password@localhost:5432/enterprise_agent
DB_POOL_SIZE=10
DB_MAX_OVERFLOW=10
DB_POOL_TIMEOUT=30
DB_POOL_RECYCLE=1800
# ---- Redis(Agent 会话状态)----
REDIS_URL=redis://localhost:6379/0
# 会话 TTL:30 分钟不活动自动过期(面试点:为什么是 30 分钟)
SESSION_TTL_SECONDS=1800
# 注入 Planner 的历史摘要最多保留几轮(面试点:token 控制)
MAX_HISTORY_TURNS=5
# ---- Langfuse(LLM tracing,增强依赖)----
# 默认关闭:不配置 key 也能跑(tracing 挂了绝不影响 Agent 主链路,
# 见 backend/app/monitoring/langfuse.py 的设计注释)
LANGFUSE_ENABLED=false
LANGFUSE_PUBLIC_KEY=
LANGFUSE_SECRET_KEY=
# 自托管时改为你的实例地址(如 http://localhost:3000)
LANGFUSE_HOST=https://cloud.langfuse.com
# ---- Agent 图 ----
# 最大工具执行迭代次数——防无限循环的硬兜底(面试点:LLM 路由 + 代码兜底)
MAX_ITERATIONS=6
# 整个 Agent 请求的超时(秒)——超时强制终止并返回已有结果
AGENT_TIMEOUT_SECONDS=120
# ---- RAG ----
CHUNK_SIZE=500
CHUNK_OVERLAP=50
RETRIEVAL_TOP_K=5
# ---- 应用 ----
DEBUG=false
LOG_LEVEL=INFO