feat:完善长期记忆控制台导入链路与联调测试
summary:\n- 扩展长期记忆控制台导入、调优与删除相关 UI/接口,补充中文化展示与任务细粒度状态管理\n- 强化 memory API 与后端路由能力,补齐导入任务、图谱检索、配置与运行态相关字段\n- 新增与增强前后端测试,覆盖导入多文件类型、检索、调优、删除及图谱查询关键路径 description:\n- dashboard: 重构 knowledge-base 页面与 memory-api,统一任务队列、分块分页、来源删除恢复、调优闭环交互\n- backend: 扩展 webui memory 路由与 A_Memorix 内核检索逻辑,完善服务侧能力与配置 schema\n- tests: 增加 webui 集成测试和 kernel 单测,提升导入/检索/调优/删除全流程回归保障
This commit is contained in:
@@ -168,6 +168,10 @@ async def _graph_get(limit: int) -> dict:
|
||||
return await memory_service.graph_admin(action="get_graph", limit=limit)
|
||||
|
||||
|
||||
async def _graph_search(query: str, limit: int) -> dict:
|
||||
return await memory_service.graph_admin(action="search", query=query, limit=limit)
|
||||
|
||||
|
||||
async def _graph_get_node_detail(
|
||||
node_id: str,
|
||||
*,
|
||||
@@ -390,9 +394,20 @@ async def _memory_config_get() -> dict:
|
||||
|
||||
|
||||
async def _memory_config_get_raw() -> dict:
|
||||
raw_payload_getter = getattr(a_memorix_host_service, "get_raw_config_with_meta", None)
|
||||
if callable(raw_payload_getter):
|
||||
raw_payload = raw_payload_getter()
|
||||
else:
|
||||
raw_payload = {
|
||||
"config": a_memorix_host_service.get_raw_config(),
|
||||
"exists": bool(a_memorix_host_service.get_config_path().exists()),
|
||||
"using_default": False,
|
||||
}
|
||||
return {
|
||||
"success": True,
|
||||
"config": a_memorix_host_service.get_raw_config(),
|
||||
"config": str(raw_payload.get("config", "") or ""),
|
||||
"exists": bool(raw_payload.get("exists", False)),
|
||||
"using_default": bool(raw_payload.get("using_default", False)),
|
||||
"path": str(a_memorix_host_service.get_config_path()),
|
||||
}
|
||||
|
||||
@@ -649,6 +664,14 @@ async def get_memory_graph(limit: int = Query(200, ge=1, le=5000)):
|
||||
return await _graph_get(limit)
|
||||
|
||||
|
||||
@router.get("/graph/search")
|
||||
async def search_memory_graph(
|
||||
query: str = Query(..., min_length=1),
|
||||
limit: int = Query(50, ge=1, le=200),
|
||||
):
|
||||
return await _graph_search(query, limit)
|
||||
|
||||
|
||||
@router.get("/graph/node-detail")
|
||||
async def get_memory_graph_node_detail(
|
||||
node_id: str = Query(..., min_length=1),
|
||||
|
||||
Reference in New Issue
Block a user