Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 21 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
[![CI - Lint, Tests & Adapter Build](https://github.com/matrixorigin/memory_benchmarks/actions/workflows/aml-ci.yml/badge.svg?branch=main)](https://github.com/matrixorigin/memory_benchmarks/actions/workflows/aml-ci.yml)

Public memory benchmarks, an Agent Memory Leaderboard (AML) Add/Search adapter,
and a dedicated dev deployment for [Memoria](https://github.com/matrixorigin/memoria).
and deployment templates for [Memoria](https://github.com/matrixorigin/memoria).

This repository helps the team evaluate how well Memoria retrieves evidence from
conversation histories. It prepares public datasets, writes the original history
through `/add`, queries `/search`, and records retrieval metrics and run checkpoints.
It also owns the adapter and its Aliyun dev deployment pipeline.
Deployment templates are included; live environments have their own release process.

**Default mode: retrieval diagnostics.** LoCoMo and LongMemEval-S also support
optional local Answer/Eval. Native evaluator parity, coding scores and official
Expand All @@ -22,8 +22,9 @@ AML leaderboard scores remain separate acceptance work. See the
| Try the deployed API | Adapter access key | [API quick start](#try-the-deployed-api) |
| Run a benchmark in Actions | Workflow access; configured adapter access key | [Run a benchmark](#run-a-benchmark) |
| Develop the adapter locally | Python 3.12+, uv, running Memoria, master key | [Local development](#local-development) |
| Reproduce a fixed deployment | Pinned mb/Memoria versions and configured backend | [Deployment and reproduction](deploy/README.md#本地复现) |
| Deploy or update services | Configured deployment Secrets and Variables | [Deployment](#deploy-or-update-services) |
| Understand the design | No runtime credentials | [Competition design](agent_memory_leaderboard/docs/competition-plan.md) |
| Understand the design | No runtime credentials | [Architecture](#how-it-works) and [adapter guide](agent_memory_leaderboard/README.md) |

## How it works

Expand Down Expand Up @@ -115,9 +116,8 @@ not automatically clean it up.
| `GET /docs` | Interactive request/response documentation |

Healthy probes alone do not validate authentication, model calls, or retrieval
quality. The dev deployment and seven-check live API integration smoke passed on
2026-10-06; the [acceptance record](agent_memory_leaderboard/docs/competition-plan.md#当前交付状态)
contains the actual revisions and remaining validation scope.
quality. Verify these paths against the intended environment before a benchmark;
this guide does not certify a particular deployment or official evaluation run.

For the complete field contract and Python example, see
[public integration](deploy/README.md#接入已部署的-addsearch). For retry and error
Expand Down Expand Up @@ -170,8 +170,9 @@ not consume official AML Full quota.

See the [benchmark workflow guide](agent_memory_leaderboard/benchmarks/CI.md)
for data provenance, metric definitions, timeout and resume behavior.
Recorded self-run results and their limitations are available in
[baseline reports](agent_memory_leaderboard/benchmarks/baselines/README.md).
Keep environment-specific baseline reports, checkpoints and run notes under the
Git-ignored `var/` directory. Record the code, dataset and configuration used; do
not treat local results as official AML scores.

### Interpreting the metrics

Expand Down Expand Up @@ -245,17 +246,14 @@ local integration smoke, benchmark commands, and a Memoria Docker Compose overla

## Deploy or update services

QA services are managed in **moi-gitops**, stack `idc`: the `aml-qa` unit owns the
adapter and the `memoria` unit owns shared Memoria. See the
[QA deployment handbook](https://github.com/matrixorigin/moi-gitops/blob/main/docs/handbooks/qa-aml-adapter.md).
The old Aliyun direct-deployment workflow has been removed. This repository's
active CI/benchmark workflows do not deploy to Aliyun or require its cluster,
SQL or Memoria administration credentials. Legacy deployment code and its
[reference guide](deploy/README.md) remain for historical reference.
See the [deployment reference](deploy/README.md) for the template layout,
configuration boundaries and Add/Search integration. The active workflows in
this repository run checks and optional QA benchmarks; they do not deploy an
application. Shared environments use their existing reviewed release process.

The adapter image build → moi-gitops image-update PR workflow is follow-up work.
ACR still hosts the application images, and the configured qwen-plus answer/judge
service still uses DashScope. These dependencies are separate from hosting QA.
Deployment plans, environment-specific acceptance records and internal run notes
are local operator material, rather than public usage documentation. Keep them
under Git-ignored `var/private-docs/`; do not link public guides to local files.

## Workflows at a glance

Expand All @@ -268,13 +266,13 @@ service still uses DashScope. These dependencies are separate from hosting QA.

```text
memory_benchmarks/
├── .github/workflows/ # Offline CI, dev deployment, manual benchmark
├── .github/workflows/ # Offline CI and manual benchmark
├── agent_memory_leaderboard/
│ ├── src/ # Adapter, journal, HTTP client, shared benchmark program
│ ├── benchmarks/ # Parsers, preparation, entrypoints and CI guide
│ ├── scripts/ # Local launchers and Actions preparation/reporting
│ ├── tests/ # Adapter and benchmark tests using simulated backends
│ ├── docs/ # Maintained design and review references
│ ├── docs/ # Public feature and experiment guides
│ └── compose.adapter.yaml # Overlay for Memoria Docker Compose
└── deploy/
├── chart/ # Helm resources for Memoria and adapter
Expand All @@ -289,9 +287,9 @@ when obtaining or sharing its data.

## Design and contribution

The maintained [competition design](agent_memory_leaderboard/docs/competition-plan.md)
records architecture, decisions, verified delivery status, and remaining work.
Detailed guides own operational instructions; this README is the project entrypoint.
The architecture overview above and the public adapter, deployment and benchmark
guides describe supported behavior. Keep internal plans, live acceptance records
and experiment outputs in Git-ignored local storage.

Explain the design, validation evidence, and effect on API behavior or evaluation
comparability in each PR. Preserve provenance and user isolation, keep gold data
Expand Down
14 changes: 14 additions & 0 deletions agent_memory_leaderboard/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,17 @@ var/
benchmarks/*/*/data/
benchmarks/*/*/results/
state/*.json

# Local retry journals and their SQLite sidecars.
*.db
*.db-journal
*.db-wal
*.db-shm
*.sqlite
*.sqlite-journal
*.sqlite-wal
*.sqlite-shm
*.sqlite3
*.sqlite3-journal
*.sqlite3-wal
*.sqlite3-shm
32 changes: 10 additions & 22 deletions agent_memory_leaderboard/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,13 @@ It checks adapter liveness, not Memoria/database/embedding readiness.
`GET /ready` checks journal readability and the upstream Memoria health endpoint,
without writing memories or invoking a model. It is a dependency-availability
check, not evidence that Add/Search or the embedding provider works correctly.
The deployment target is the Aliyun dev unit cluster, using a dedicated Memoria
backend and database login. Local evaluation remains available.
See [competition design](docs/competition-plan.md) for runtime scope and workload
budgets. The offline CI checks code and builds the adapter image without
publishing or deploying it. Memoria source builds run only in the dev deployment
workflow when updating Memoria in source mode, including preview. Adapter-only
updates and existing-image mode skip Memoria builds.
The [dev deployment workflow](../deploy/README.md) defaults to building Memoria
from its `main` branch; another branch, tag, commit, or existing image can be selected.
It publishes the selected images and deploys both services by digest through an
independent Pulumi stack, recording the actual source commit for each source build.
Public access requires DNS; the existing cert-manager ClusterIssuer automatically
issues and renews the TLS Secret.

The Aliyun dev endpoint is deployed at `https://aml.cn-dev.matrixone.tech`.
See the [deployment steps and Actions inputs](../deploy/README.md#发布流程) and
[public curl/Python integration examples](../deploy/README.md#接入已部署的-addsearch).
Public clients need only the adapter API key; they do not need Memoria master,
database, or Kubernetes credentials.
For local development, configure a running Memoria service and use the adapter's
loopback endpoint. Hosted environments supply their own endpoint, capacity and
release configuration; see the [deployment reference](../deploy/README.md).
The offline CI checks code and builds the adapter without deploying it. The
manual QA benchmark calls its configured QA service and does not select or
update a deployment. Public clients use only the adapter key; database,
Kubernetes and Memoria administration credentials stay with the operators.

## Contract verification

Expand All @@ -90,9 +78,9 @@ For submission, use public endpoint URLs without embedded credentials; the
localhost examples below are for development. Enable authentication for Full.
Configure proxy/load-balancer request timeouts for the documented 30-minute
request window. `MEMORIA_TIMEOUT_SECONDS` controls each upstream call (default
120 seconds), not the total Add duration. The deployed dev endpoint has passed
the project's live integration smoke; official platform Smoke and long-request
validation remain pending. See the [current acceptance status](docs/competition-plan.md#当前交付状态).
120 seconds), not the total Add duration. A local smoke, a deployment health
check and an official AML Smoke are separate checks; keep their run records and
version bindings outside the public usage guide.

Concurrent Add/Search requests can queue native Memoria calls without changing
synchronous Add semantics. Set `MEMORIA_MAX_CONCURRENCY=1` and
Expand Down
32 changes: 12 additions & 20 deletions agent_memory_leaderboard/benchmarks/CI.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ benchmark 请求 QA 当前部署的 Add/Search;Summary 与 JSON 记录环境
旧阿里云部署 workflow 已移除。QA 使用 `aml-qa-benchmark`
只串行本仓库的 QA 评测;moi-gitops 在另一个仓库,同名 concurrency group 也不能跨仓库互斥。
QA 评测前需要协调共享 Memoria 与 GitOps 发布;本 workflow 不宣称已自动冻结它们。
QA gateway 初始限制一个活跃业务请求、每秒一个后端业务请求,完整历史可能明显慢于 dev。
实际入口和后端限制以目标环境当前配置为准;运行前核对容量,不能从历史配置推断本轮能力。
并发组不阻止其他本地客户端、AML 官方任务或手工操作;GitHub 默认只保留一个 pending
运行,新 pending 可能替换旧 pending,不应同时排队多个部署/评测任务。

## Summary 与完整报告

已完成运行的安全聚合指标与解释见[固定基线](baselines/README.md)。完整断点仍在
对应 Actions artifact;Git 中的聚合报告不包含数据正文、回答或可恢复的 private cache。
具体运行的基线、版本和验收记录保存在 Git 忽略的本地 `var/` 目录或受控运行记录中。
公开文档仅说明如何生成和解释报告,不绑定某次环境验收结果。

Summary 包含状态、评测进程耗时、写入分块数、已处理/已查询/跳过的问题数、空结果、
有证据标签的问题数、召回率、Search P50/P95、按数据集 category 分组的结果及版本。
Expand Down Expand Up @@ -144,24 +144,17 @@ Summary 单列 eligible/scored/pending、评分覆盖率及两类失败题
缺失时不写入记忆。准备步骤不读取模型凭据。工作流安装锁定的 evaluation extra;
适配器镜像不需要此 extra,也不需要重新部署。

当前开发配置(2026-10-07):回答和裁判的 MODEL 均为 `qwen-plus`,两个 BASE_URL
均为 `https://dashscope.aliyuncs.com/compatible-mode/v1`,分别配置上述两个 API_KEY
Secrets,复用已有百炼凭据。GitHub 配置已保存并回读确认;尚未验证本次凭据的模型
调用或执行新契约基准。密钥不进入仓库或日志。
根据所选模型服务填写上述 Variables 和 Secrets。示例配置不代表某个仓库已经配置凭据,
也不代表模型调用或完整评测已通过验证。密钥不进入仓库或日志。

运行 `AML benchmark` 时选择 `main`、`dataset=locomo`、`mode=answer-eval`、
运行 `QA memory benchmark` 时选择 `main`、`dataset=locomo`、`mode=answer-eval`、
`histories=1`、`top_k=100`,`runtime_label` 可留空。模型设置在 benchmark 进程中生效,
不需要重新构建或部署 Memoria/适配器。qwen-plus 为提供商可更新别名,跨日期比较
不能假定底层权重相同;长期可比实验需选择并记录可用快照版本。回答与裁判同模型的
分数用于本地迭代,不能作为独立裁判或官方评分等价性的证明。

正式 AML 的 Answer/Eval 由平台固定,我们的配置不会替换平台模型。官方 Full checklist
写 Open-source Methods 的 Add 期望使用 `gpt-4o-mini`,商业产品无 Add/Search 模型限制;
FAQ 仍写学术榜 embedding 为 `text-embedding-v4`、LLM 组件为 `gpt-4o-mini`、reranker
不限制。两套组别名称的对应及纯存储 Add/上海 bge-m3 资格需向官方确认;不能用本地
qwen-plus 配置推断正式参评合规。
依据:[AML 文档](https://agentmemories.ai/zh-cn/docs)、
[赛事 FAQ](https://agentmemoryleaderboard.ai/competition/)。
正式 AML 的回答与评分由平台提供,本地配置不会替换平台模型。参赛组别和模型要求
以[官方文档](https://agentmemoryleaderboard.ai/docs)为准,本地运行结果不证明正式参评合规。

全部输入(指令、角色、问题、选项/问题日期、证据)按固定 `o200k_base` 编码加
256 token 余量进行本地预算计数,上限 117760;保留完整记录的排名前缀。它不是所有
Expand Down Expand Up @@ -210,7 +203,7 @@ Answer/Eval 的 private cache 也受同一保留期约束,不能随报告公
报告按现有保留策略记录清理期限;120 分钟步骤被强制终止、runner 未执行 finally 时,
最终报告步骤补写未设置的保留期限,不延长已有期限。
Artifact 过期不清理 Memoria、用户库、journal 或历史快照;物理清理需要独立运维方案。
正式评测前执行发布冻结及保留管理流程,见[比赛方案](../docs/competition-plan.md)。
正式评测前与环境维护者协调发布冻结、版本记录和保留管理,见[部署参考](../../deploy/README.md)。

该 workflow 消耗我们自己的 embedding、数据库和 Actions 资源,不消耗 AML 官方 Full
配额。请求串行发送;限制 histories 和执行时长不等于完整的全局 QPS/token 预算。
Expand All @@ -224,10 +217,9 @@ Artifact 过期不清理 Memoria、用户库、journal 或历史快照;物理
| 作答(仅 answer-eval) | `BENCHMARK_ANSWER_API_KEY` | `AML_BENCHMARK_ANSWER_API_KEY` |
| 判分(仅 answer-eval) | `BENCHMARK_JUDGE_API_KEY` | `AML_BENCHMARK_JUDGE_API_KEY` |

本地完整 QA 配置保存在私有 `var/evaluation-qa.env`(当前独立 worktree 下),权限 0600、
Git 忽略;模型名和 base URL 也已配置。GitHub 的上述三个 Secret 已配置,模型变量沿用
qwen-plus / DashScope。本地真实 QA 最小链路已通过;GitHub-hosted runner 的端到端执行
需在本 PR 合入后首次运行验证,Secret 已存在不等于运行已验证。
本地配置可保存在 Git 忽略的 `var/evaluation-qa.env`,使用仅当前用户可读写的权限;
模型名称、地址和凭据由操作者自行配置。不要将凭据是否存在写成链路验证结论,
也不要把本地 private cache 或内部验收记录加入仓库。

离线 CI 不使用任何业务 key。评测不需要 KUBECONFIG、Pulumi token、数据库密码、
Memoria master key 或 embedding key;这些由 QA 后端和 GitOps 持有。当前服务运行于
Expand Down
2 changes: 1 addition & 1 deletion agent_memory_leaderboard/benchmarks/EVALUATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ flow, but the complete official judge prompts and a reproducible implementation
were not found in the documentation checked on 2026-10-07. The prompts in
`src/judges/` come from the public benchmark repositories, not from AML.
See the [official documentation](https://agentmemories.ai/zh-cn/docs) and
[competition readiness plan](../docs/competition-plan.md#正式参评前的工作).
[deployment reference](../../deploy/README.md).

## LongMemEval answer reader

Expand Down
Loading
Loading