From 8881daf592ccf423c2f99891870ddcc720de04c6 Mon Sep 17 00:00:00 2001 From: lixinyue <2569494688@qq.com> Date: Tue, 20 Jan 2026 10:16:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89MCP=E6=A1=86=E6=9E=B6?= =?UTF-8?q?=EF=BC=8C=E9=87=8D=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/core/config.py | 3 +- .../agent/config/problem_extension_config.py | 46 ------------------- .../langgraph_graph/nodes/write_nodes.py | 3 -- api/docker-compose.yml | 2 - 4 files changed, 1 insertion(+), 53 deletions(-) delete mode 100644 api/app/core/memory/agent/config/problem_extension_config.py diff --git a/api/app/core/config.py b/api/app/core/config.py index a31caab4..9600b551 100644 --- a/api/app/core/config.py +++ b/api/app/core/config.py @@ -147,8 +147,7 @@ class Settings: # Celery configuration (internal) CELERY_BROKER: int = int(os.getenv("CELERY_BROKER", "1")) CELERY_BACKEND: int = int(os.getenv("CELERY_BACKEND", "2")) - BROKER_URL: str = os.getenv("BROKER_URL", f"redis://:{REDIS_PASSWORD}@{REDIS_HOST}:{REDIS_PORT}/{CELERY_BROKER}") - RESULT_BACKEND: str = os.getenv("RESULT_BACKEND", f"redis://:{REDIS_PASSWORD}@{REDIS_HOST}:{REDIS_PORT}/{CELERY_BACKEND}") + REFLECTION_INTERVAL_SECONDS: float = float(os.getenv("REFLECTION_INTERVAL_SECONDS", "300")) HEALTH_CHECK_SECONDS: float = float(os.getenv("HEALTH_CHECK_SECONDS", "600")) MEMORY_INCREMENT_INTERVAL_HOURS: float = float(os.getenv("MEMORY_INCREMENT_INTERVAL_HOURS", "24")) diff --git a/api/app/core/memory/agent/config/problem_extension_config.py b/api/app/core/memory/agent/config/problem_extension_config.py deleted file mode 100644 index 73a6d779..00000000 --- a/api/app/core/memory/agent/config/problem_extension_config.py +++ /dev/null @@ -1,46 +0,0 @@ - -""" -Problem_Extension优化配置 - -在应用启动时应用这些优化配置 -""" - -# 优化配置 -PROBLEM_EXTENSION_CONFIG = { - # 缓存配置 - "cache_enabled": True, - "cache_ttl": 3600, # 1小时 - - # 超时配置 - "llm_timeout": 8.0, # 8秒超时 - "max_retries": 1, # 最多重试1次 - - # 批处理配置 - "max_questions_per_batch": 10, - "batch_timeout": 15.0, - - # 性能监控 - "monitoring_enabled": True, - "slow_query_threshold": 10.0, # 10秒为慢查询 - - # 连接池配置 - "client_pool_size": 3, - - # 简化模式 - "use_simplified_prompt": True, - "skip_history_for_simple_queries": True, -} - -def apply_optimizations(): - """应用优化配置""" - import os - - # 设置环境变量 - for key, value in PROBLEM_EXTENSION_CONFIG.items(): - env_key = f"PROBLEM_EXTENSION_{key.upper()}" - os.environ[env_key] = str(value) - - print("✅ Problem_Extension优化配置已应用") - -if __name__ == "__main__": - apply_optimizations() diff --git a/api/app/core/memory/agent/langgraph_graph/nodes/write_nodes.py b/api/app/core/memory/agent/langgraph_graph/nodes/write_nodes.py index 0202621e..8421d059 100644 --- a/api/app/core/memory/agent/langgraph_graph/nodes/write_nodes.py +++ b/api/app/core/memory/agent/langgraph_graph/nodes/write_nodes.py @@ -30,9 +30,6 @@ async def write_node(state: WriteState) -> WriteState: group_id=group_id, memory_config=memory_config, ) - print('-----------') - print(result) - print('-----------') logger.info(f"Write completed successfully! Config: {memory_config.config_name}") write_result= { diff --git a/api/docker-compose.yml b/api/docker-compose.yml index caf53534..8bc19f3a 100644 --- a/api/docker-compose.yml +++ b/api/docker-compose.yml @@ -26,8 +26,6 @@ services: container_name: worker env_file: - .env - environment: - # - MCP_SERVER_URL= volumes: - ./files:/files - /etc/localtime:/etc/localtime:ro