Repository navigation
Feature benchmark - #41
Conversation
- Introduced `sweep_gate.py` for calibrating the flat-crowd gate with relevance and margin metrics. - Updated benchmark results in `benchmarks.md` reflecting new evaluations and improved performance metrics. - Enhanced comparison documentation with updated project landscape and feature matrix. - Added new demo GIF and images for visual representation of results. - Implemented paged context and conversation distillation features in documentation. - Improved stress testing scripts to include embedding options and resource profiling. - Added tests for cache invalidation after archiving and cleanup processes. - Updated launch checklist and roadmap to reflect recent developments and future plans.
- Simplified `generate_stress_charts.py` to load results from JSON files and plot charts accordingly. - Removed hardcoded data and integrated dynamic data loading for latency and seeding throughput. - Updated `stress_test.py` to support JSON output for benchmarking results and improved progress logging. - Deleted `update_readme_perf.py` as it was no longer necessary with the new chart generation approach. - Added tests for competitive benchmark result validation to ensure contract compliance.
…eatures - Implement tests for the Decision Safety Suite v2, including validation of decision safety metrics and battery files. - Introduce a new test suite for isolation and bulk deletion, ensuring read-path isolation and proper handling of expired memories. - Add tests for scoped views, verifying user and session isolation, shared memory access, and deletion behaviors. - Ensure comprehensive coverage for memory operations, including write, resolve, and forget functionalities across different isolation modes.
- Enhanced the feature matrix in comparison.md to clarify capability checks and measurement status for various projects, including updates on trap-query protection and local/offline capabilities. - Revised the competitive-benchmark-rfc.md to specify the requirements for adapter targeting and repository confirmation for active codebases, ensuring clarity on project maintainers' roles. - Improved the decision-safety-suite.md by clarifying the handling of raw message storage and deletion processes, emphasizing the absence of a separate transcript table and the implications for memory management.
- Added requirement for AGENT_MEMORY_API_KEY in CLI and examples. - Updated documentation to clarify API key usage and security practices. - Modified REST API example to include API key in requests. - Implemented authentication checks in API tests, ensuring proper handling of missing or invalid API keys. - Added tests for PostgreSQL identifier validation to prevent unsafe table names. - Enhanced scoped views to prevent unauthorized access to shared memories. - Introduced heuristics for prompt-injection detection and handling of untrusted sources in memory storage.
Cross-platform implementation and verificationThis PR adds Windows peak working-set telemetry via Local checks on macOS: PR checks currently show 12 successful and 3 pending. CI currently runs on Ubuntu only, so this does not yet verify native Windows or macOS execution. Follow-ups opened: #42 for deterministic platform RSS unit tests and #43 for Windows/macOS CLI smoke coverage. Issue audit: none of the existing open issues is fully completed by this PR, so none was closed. #24 has API-key authentication but not its JWT scope; #25 has SDK scoped views but not the requested tenant API routes/backend configuration/rate limits; #5 remains unimplemented and has been claimed by a contributor. The remaining open issues (#18–23, #26–27) request unrelated backend, retrieval, versioning, or streaming work. |
What this adds
Decision Safety Suite v2 — the decision-safety track becomes an ordered op script (
write / delete / delete_scope / advance_clock / query / query_as_of / inspect) instead of seed-then-query, because deletion, supersession, and injection all depend on write order.benchmarks/decision_safety/:deletion_durability,ttl_expiry,poisoned_write,state_invalidation,provenance_reassertion,point_in_time.runner.py), an adapter contract (adapters/base.py), and our own adapter.supportedis reportedunsupported, never scored as zero (partial≠supported); an op the adapter couldn't execute is excluded from numerator and denominator, with the count published.results/REPORT.md, plus raw per-op output.Designed in response to review feedback on mem0ai/mem0#7453. The Mem0 adapter deliberately refuses to run until its maintainers confirm the canonical self-hosted configuration, and declares no capabilities on their behalf.
Multi-tenancy —
MemoryEntry.scopeis a tier (user/project/…), not a tenant id, so many users in one store had no isolation primitive.Memory.scoped(user_id=…, session_id=…, shared=…)→ hierarchical reads (session → user → shared), writes confined to the view,forget_all()per tenant or per session.Memory.forget_where(...)— bulk delete by scope/type/tags/metadata/predicate, including archived and expired copies; requires an explicit filter orall=True.Memory.resolve(where=...)applies the filter during retrieval, before scoring.Two read-path bug fixes. Both had the same shape — the filter lived in the listing path, not the path the decision layer uses:
MultiAgentMemory.resolve()ignored its isolation mode, so anISOLATEDagent could have another agent's memory replayed verbatim whilelist()correctly showed nothing.ttl_expiry.What the suite found in our own SDK
Published before any comparison, in
benchmarks/decision_safety/results/REPORT.md:injection_write_rate1.00 in all three configurations, withbenign_write_rate1.00 /false_quarantine_rate0.00 — so the low replay rates in stricter configs are abstention, not filtering.invalidation_lag_writesisn/ain every config.point_in_timeunsupported, reported as such rather than scored.semanticdefault column scores 0.00 on every safety metric and ~0.00 on every paired recall metric — it refused 42 queries while holding candidates scoring up to 0.697 against a 0.70 gate. That column is the argument for the pairing rule.Grounding audit
Every externally-checkable claim in the changed docs was verified, and the following were wrong and are corrected in this PR:
letta-ai/lettaserver"letta-ai/lettanorletta-ai/letta-codeis archived; both are activedocs/competitive-benchmark-rfc.md❌add(..., expiration_date=…); expired memories are hiddendocs/comparison.md❌ cloud-firstdocs/comparison.md,README.md❌for seven systems❔ not measureddocs/comparison.md,README.mdttl,tombstones); it now declares none and records only cited observations with the source line and an open questionadapters/mem0_adapter.pyPagedMemorypersists its buffer into the same store on page-out /flush_to_recall()docs/decision-safety-suite.mdbenchmarks/longmemeval/REPORT.mdmake update-perfscripts/update_readme_perf.py, which doesn't existMakefileVerified correct and unchanged:
34/36 (94.4%)adversarial eval reproduces exactly, and both misses still fail safe to VERIFY rather than a wrong REPLAY.98.1%semantic /96.0%lexical Recall@5 and87.0%on _M all match their artifacts.longmemeval_s_cleaned.jsonSHA256 matches the value published in the result artifact.docs/comparison.mdare accurate and dated.REPORT.mdmatch the JSON artifacts; battery and metric names are consistent across the spec, runner, validator, schema, and artifacts; every relative doc link resolves.LongMemEval was re-run after the retriever changes (they touch
retriever.retrieve(), so "should be inert" wasn't good enough): all 45 accuracy metrics came back identical. The lexical artifact is replaced with that complete single run — same accuracy, now with p90/p99 and theexecutiontelemetry block, so the report's table comes from one artifact per column. A full semantic re-run is in progress to do the same for the semantic column; its p90/p99 and whole-run resource cells say so instead of carrying an unverifiable number.Checks
ruff check agent_memory/ mcp_server/ tests/— cleanmypy agent_memory/ mcp_server/— clean (enforced in CI; caught a shadowed-listannotation inscoped.py)pytest tests/— 383 passed, 17 skippedfakeredis— 13 passedbenchmarks/competitive/result.schema.jsonNot in this PR
No comparative result for any other system. The Mem0 adapter is a stub by design, a
mnemoadapter is welcome as a PR, and no comparative table gets published before the compared project's maintainers have reviewed their adapter.