Flx/develop config (#77)

* 修改BUG,读取接口的end_user_id获取不准确修复,statements检索内容为空需要给空列表

* 反思的默认部分检索替换为partial

* 反思的默认部分检索替换为partial

* 反思的默认部分检索替换为partial
This commit is contained in:
lixinyue11
2026-01-12 18:46:07 +08:00
committed by GitHub
parent 5b05009123
commit 17318d8205
5 changed files with 10 additions and 10 deletions

View File

@@ -54,9 +54,9 @@ async def get_reflexion_data(host_id: uuid.UUID) -> List[Any]:
Returns: Returns:
符合反思范围的记忆数据列表。 符合反思范围的记忆数据列表。
""" """
if REFLEXION_RANGE == "retrieval": if REFLEXION_RANGE == "partial":
return await get_data(host_id) return await get_data(host_id)
elif REFLEXION_RANGE == "database": elif REFLEXION_RANGE == "all":
return [] return []
else: else:
raise ValueError(f"未知的反思范围: {REFLEXION_RANGE}") raise ValueError(f"未知的反思范围: {REFLEXION_RANGE}")

View File

@@ -173,9 +173,10 @@ class MemoryConfigValidation(BaseModel):
chunker_strategy: str = Field(default="RecursiveChunker", min_length=1, max_length=100) chunker_strategy: str = Field(default="RecursiveChunker", min_length=1, max_length=100)
reflexion_enabled: bool = Field(default=False) reflexion_enabled: bool = Field(default=False)
reflexion_iteration_period: int = Field(default=3, ge=1, le=100) reflexion_iteration_period: int = Field(default=3, ge=1, le=100)
reflexion_range: Literal["retrieval", "all"] = Field(default="retrieval") reflexion_range: Literal["partial", "all"] = Field(default="partial")
reflexion_baseline: Literal["time", "fact", "time_and_fact"] = Field(default="time") reflexion_baseline: Literal["TIME", "FACT", "HYBRID"] = Field(default="TIME")
llm_params: Dict[str, Any] = Field(default_factory=dict) llm_params: Dict[str, Any] = Field(default_factory=dict)
embedding_params: Dict[str, Any] = Field(default_factory=dict) embedding_params: Dict[str, Any] = Field(default_factory=dict)
config_version: str = Field(default="2.0", min_length=1, max_length=10) config_version: str = Field(default="2.0", min_length=1, max_length=10)

View File

@@ -292,8 +292,8 @@ class ConfigUpdateExtracted(BaseModel): # 更新记忆萃取引擎配置参数
iteration_period: Optional[Literal["1", "3", "6", "12", "24"]] = Field( iteration_period: Optional[Literal["1", "3", "6", "12", "24"]] = Field(
"3", description="反思迭代周期,单位小时" "3", description="反思迭代周期,单位小时"
) )
reflexion_range: Optional[Literal["retrieval", "database"]] = Field( reflexion_range: Optional[Literal["partial", "all"]] = Field(
"retrieval", description="反思范围:部分/全部" "partial", description="反思范围:部分/全部"
) )
baseline: Optional[Literal["TIME", "FACT", "TIME-FACT"]] = Field( baseline: Optional[Literal["TIME", "FACT", "TIME-FACT"]] = Field(
"TIME", description="基线:时间/事实/时间和事实" "TIME", description="基线:时间/事实/时间和事实"

View File

@@ -529,7 +529,6 @@ class MemoryAgentService:
workflow_duration = time.time() - start workflow_duration = time.time() - start
logger.info(f"Read graph workflow completed in {workflow_duration}s") logger.info(f"Read graph workflow completed in {workflow_duration}s")
# Extract final answer # Extract final answer
final_answer = "" final_answer = ""
for messages in outputs: for messages in outputs:

View File

@@ -205,8 +205,8 @@ class MemoryConfigService:
chunker_strategy=memory_config.chunker_strategy or "RecursiveChunker", chunker_strategy=memory_config.chunker_strategy or "RecursiveChunker",
reflexion_enabled=memory_config.enable_self_reflexion or False, reflexion_enabled=memory_config.enable_self_reflexion or False,
reflexion_iteration_period=int(memory_config.iteration_period or "3"), reflexion_iteration_period=int(memory_config.iteration_period or "3"),
reflexion_range=memory_config.reflexion_range or "retrieval", reflexion_range=memory_config.reflexion_range or "partial",
reflexion_baseline=memory_config.baseline or "time", reflexion_baseline=memory_config.baseline or "Time",
loaded_at=datetime.now(), loaded_at=datetime.now(),
# Pipeline config: Deduplication # Pipeline config: Deduplication
enable_llm_dedup_blockwise=bool(memory_config.enable_llm_dedup_blockwise) if memory_config.enable_llm_dedup_blockwise is not None else False, enable_llm_dedup_blockwise=bool(memory_config.enable_llm_dedup_blockwise) if memory_config.enable_llm_dedup_blockwise is not None else False,