草稿
[WIP]feat: expose retrieval config and structured observability #1
DoraA_Mengjie创建于 24 天前
[WIP]feat: expose retrieval config and structured observability #1
草稿
DoraA_Mengjie创建于 24 天前
DoraA_Mengjie
DoraA_Mengjie成员
24 天前

变更说明

这是基于 openEuler RAM-A PR11 (ae85f03) 的依赖 PR,用于补齐 RPM/MCP 服务的检索配置和运行时可观测性。

检索配置

  • 新增顶层 retrieval 配置,支持 modecandidate_kembedding_weightbm25_weight
  • 新增 retrieval.rerank,支持 provider、model、credential env、base URL、input_k、timeout 和 fail-open。
  • 启用 rerank 后实际构造并注入 reranker;关闭时不读取 rerank credential。
  • 图检索仍只由 features.graph_memorygraph_memory.retrieval 控制,避免出现第二个图记忆开关来源。

OpenRouter-compatible 规格

  • 支持 OpenRouter /rerank wire protocol,也支持兼容该协议的本地 HTTP rerank 服务。
  • api_key_env: null 时不发送 Authorization header,适用于部署在受信任网络内的无鉴权服务。
  • 文档明确请求/响应 schema;其他协议需要 adapter 或 gateway。

可观测性

  • 使用单行 JSON tracing 日志,并通过 RUST_LOG 控制级别。
  • HTTP request_id 贯穿 MCP tool、memory ingest/search、provider retry 和异步 graph build。
  • ingest 记录 normalize、episode/window、extract、validate、verify、vector persist、graph build 等阶段。
  • hybrid search 记录 query embedding、dense、BM25、fusion、graph augment、rerank 和 filter 等阶段。
  • case ingestion 记录 startup run、task_id、dataset_id、document_id、chunk count 和失败状态。
  • provider 重试记录 provider/model、attempt、backoff 和归一化 error kind,不记录 credential、query、memory text 或 response body。

兼容性

  • 未配置 retrieval 时继续使用 hybrid 0.7/0.3,rerank 默认关闭。
  • 旧 RPM 配置无需增加必填字段。
  • MCP 工具协议和默认图记忆行为不变。

验证

  • cargo fmt --all -- --check
  • cargo clippy -p memory-mcp -p memory-core -p memory-pipeline -p memory-cases --all-targets -- -D warnings
  • memory-mcp config、service、HTTP、auth、case client、xiaoO compatibility 测试
  • memory-core rerank 和 hybrid rerank 测试
  • memory-cases 65 个 lib 测试
  • memory-pipeline lib 测试
  • packaged JSON schema/语法校验及 git diff --check

依赖关系

本 PR 以 PR11 为基线。PR11 合入后应 rebase 到最新 openeuler/master,再将目标分支切换为 master

likedislike
合并受阻
DoraA_MengjieDoraA_Mengjie成员
23 天前 强制推送  18 个提交:61017ba7-build: configure Huawei Cloud Cargo mirror,831d5b7c-!9 build: configure Huawei Cloud Cargo mirror,02b86583-feat: add graph build pipeline,e801ae00-feat: add graph benchmark CLI options,1bf12e15-feat: enable graph mode in memory-bench,6b565e2f-feat: pass graph benchmark flags through evaluation runners,bd66c4a5-docs: document graph benchmark usage,9878a6c3-feat: wire graph memory benchmark evaluation,19c36fd5-feat: broaden default graph registry,476f3b4f-feat: add deterministic graph evidence retrieval,66bc6426-feat: add graph build audit and bounded concurrency,cc0551fd-feat: add source provenance and graph query planning,c5ddc6a2-feat: add bounded rank fusion for graph retrieval,9cb4c60a-feat: align atomic memory provenance for graph ingestion,e35d2848-feat: integrate graph memory with MCP service,bbf6ba5d-feat: align graph and rerank evaluation across datasets,ee049780-!11 feat: integrate graph memory into retrieval, MCP, and benchmark evaluation,16a50521-feat: configure retrieval and runtime observability
DoraA_MengjieDoraA_Mengjie成员
23 天前 强制推送  1 个提交:3e2793c6-feat: add RPM retrieval configuration and staged observability
DoraA_MengjieDoraA_Mengjie成员
22 天前 推送  1 个提交:11f51ca6-fix: address retrieval observability review feedback
DoraA_MengjieDoraA_Mengjie成员
22 天前 推送  1 个提交:50e7ce4c-fix: address PR 13 review findings
DoraA_MengjieDoraA_Mengjie成员
22 天前 推送  3 个提交:6c71e1a2-feat: integrate case library into ram-a-mem,5d6430ad-!10 feat: integrate case library into ram-a-mem,2fba880a-merge: resolve PR 13 conflicts with master