Files
zhanghongyu_0626 bf8f271840 feat(redis): Update Redis configuration and enhance compatibility with Docker
- Changed Redis port mapping in `docker-compose.yml` from `6379:6379` to `6380:6379` to avoid conflicts with Windows Redis.
- Updated `.env.example` to reflect the new Redis URL (`redis://127.0.0.1:6380/0`), ensuring proper configuration for Docker users.
- Enhanced Redis client initialization in `database.py` and `redis_gateway.py` to utilize a new `_redis_kwargs` function for improved compatibility with Windows Redis 3.x and Docker Redis 7.
- Added a new PowerShell script `start-redis.ps1` to facilitate starting Redis in Docker, providing a seamless setup experience for developers.

This update significantly improves the Redis integration, ensuring a smoother development process and better compatibility across environments.
2026-09-09 20:19:55 +08:00

76 lines
2.4 KiB
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Application
APP_ENV=development
# MySQL
MYSQL_HOST=127.0.0.1
MYSQL_PORT=3306
MYSQL_DATABASE=jinrong_agent
MYSQL_CORE_DATABASE=jinrong_core
MYSQL_USER=root
MYSQL_PASSWORD=
# Redis(Docker:docker compose up -d redis · 宿主机 6380 → 容器 6379 · 避开 Windows Redis 3.x 占 6379)
REDIS_URL=redis://127.0.0.1:6380/0
# Neo4j
NEO4J_URI=bolt://localhost:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=
# Milvus Lite
# 注意:路径含中文会触发 Milvus Lite(faiss) 文件 IO 失败,Windows 中文用户目录请改纯英文绝对路径
MILVUS_URI=./data/milvus.db
# 客服 KB 第二套(fin_faq / fin_product / fin_policy 原料目录)
KB_ROOT_DIR=./data/kb_collections
# Ollama Embedding
OLLAMA_BASE_URL=http://127.0.0.1:11434
EMBED_MODEL=bge-m3
# DeepSeek LLM
DEEPSEEK_API_KEY=
DEEPSEEK_BASE_URL=https://api.deepseek.com
# JWT (T-01): production uses RS256 public key from IdP; empty path -> HS256 dev secret
# (HS256 is rejected at startup when APP_ENV != development)
JWT_PUBLIC_KEY_PATH=
JWT_DEV_SECRET=change-me-in-dev-only
JWT_ISSUER=https://idp.jinrong.internal
JWT_AUDIENCE=agent-gateway
# Risk thresholds (defaults = frozen rules, see docs/PRD/附-风控规则表.md)
# 注:RISK_ASSESSMENT_VALID_DAYS 已退役(AL-05 对齐 main 基准)——
# 风评有效期改由 jinrong_core.core_customer_risk.expires_at 数据驱动(FM-03)。
RISK_LARGE_AMOUNT=500000
RISK_DAILY_TOTAL=500000
RISK_FREQ_COUNT=3
RISK_PROBE_WINDOW_MINUTES=5
RISK_PROBE_COUNT=3
RISK_PROBE_AMOUNT=400000
RISK_SMALL_AMOUNT=10000
RISK_SMALL_COUNT=3
RISK_AML_DEFAULT_THRESHOLD=0.85
# 风控追加 v1.1(FR-8/9/10 · PRD §4A · C4~C6 共用)
# FR-8 RISK-006 集中度:R4+R5 市值占比 ≥ 该阈值即命中(0~1)
RISK_CONCENTRATION_THRESHOLD=0.80
# FR-9 RISK-007 时效升级:扫描周期(脚本参考)与两级超时小时数
RISK_ESCALATION_SCAN_MINUTES=15
RISK_ESCALATION_L1_HOURS=4
RISK_ESCALATION_L2_HOURS=24
# AML 单走短通道(1h/4h),与普通单分开计
RISK_ESCALATION_AML_L1_HOURS=1
RISK_ESCALATION_AML_L2_HOURS=4
# FR-10 RISK-008 代理人行为链:扫描周期与 A/B/C 三条件窗口与次数
RISK_AGENT_BEHAVIOR_SCAN_MINUTES=30
RISK_AGENT_BEHAVIOR_A_WINDOW_HOURS=24
RISK_AGENT_BEHAVIOR_A_COUNT=3
RISK_AGENT_BEHAVIOR_B_WINDOW_HOURS=72
RISK_AGENT_BEHAVIOR_B_COUNT=5
RISK_AGENT_BEHAVIOR_C_WINDOW_HOURS=24
RISK_AGENT_BEHAVIOR_C_COUNT=10
# Platform API (v0.1): false = raw L0 for mock Core; true = desensitize on Service exit
PLATFORM_RESPONSE_DESENSITIZE=false