Skip to content

Add GoodMemory as a third backend (local HTTP bridge)#17

Open
hjqcan wants to merge 3 commits into
mem0ai:mainfrom
hjqcan:add-goodmemory-backend
Open

Add GoodMemory as a third backend (local HTTP bridge)#17
hjqcan wants to merge 3 commits into
mem0ai:mainfrom
hjqcan:add-goodmemory-backend

Conversation

@hjqcan

@hjqcan hjqcan commented Jul 5, 2026

Copy link
Copy Markdown

Adds GoodMemory — a local-first memory layer for AI products and coding agents — as a third backend next to Mem0 Cloud/OSS.

What's included

  • benchmarks/common/goodmemory_client.py: async client for GoodMemory's packaged HTTP bridge (npm i -g goodmemory && goodmemory-http-bridge, no Docker), exposing the same add / search / delete_user interface as Mem0Client.
  • --backend goodmemory (+ --goodmemory-host) wired into the LOCOMO, LongMemEval, and BEAM runners.
  • README "Option C" setup section.

Design notes

  • Auth: the bridge requires a bearer token by default (GOODMEMORY_HTTP_BRIDGE_TOKEN, picked up automatically) plus a per-request caller header — both handled inside the client.
  • Deterministic seeding: benchmark ingestion writes every turn verbatim (verified fact annotations + rules-only extraction), mirroring how GoodMemory's own benchmark harnesses seed conversations; assistant turns are stored as user-scoped facts with the original role preserved in the content, since assistant-authored writes are blocked by the product's write policy.
  • Run isolation: GoodMemory scopes state by user id (which embeds --project-name); the bridge intentionally has no bulk delete endpoint, so delete_user documents that and relies on fresh project names.

Testing

Smoke-tested end to end against a live local bridge: two-turn add → search round trip recalls the seeded facts (including the role-prefixed assistant turn), with token auth active.

Adds benchmarks/common/goodmemory_client.py - an async client for the
GoodMemory HTTP bridge (npm i -g goodmemory; goodmemory-http-bridge) exposing
the same add/search/delete_user interface as Mem0Client - and wires
--backend goodmemory (+ --goodmemory-host) into the LOCOMO, LongMemEval, and
BEAM runners.

Notes:
- Bearer-token auth (GOODMEMORY_HTTP_BRIDGE_TOKEN) and the bridge's
  per-request caller header are handled automatically.
- Benchmark seeding writes every turn deterministically (verified fact
  annotations + rules-only extraction), mirroring how GoodMemory's own
  benchmark harnesses ingest conversations; assistant turns are stored as
  user-scoped facts with the original role preserved in the content, since
  assistant-authored writes are blocked by the product write policy.
- Runs are isolated by scope (user ids embed the project name); the bridge
  has no bulk delete endpoint, so delete_user relies on fresh project names.
- Smoke-tested end to end against a live bridge (add -> search round trip).
hjqcan added 2 commits July 6, 2026 09:39
…tack

The bridge coerces any non-hybrid recall strategy (including auto) to a
rules-only lexical floor, which cannot surface semantically-relevant facts.
Default recall_strategy to hybrid so representative recall works out of the
box (override via GOODMEMORY_RECALL_STRATEGY), and document the bridge config
it needs: an embedding endpoint, the recommended retrieval preset (semantic
candidate union), and in-memory storage. Deterministic verbatim seeding is
unchanged (no LLM extractor required). Validated 4/4 on cross-topic recall
probes (the query-relevant fact ranks first).
@hjqcan

hjqcan commented Jul 13, 2026

Copy link
Copy Markdown
Author

Refreshed the GoodMemory adapter in commit 6e3b204 to preserve each runner's timestamp / observation_date as a UTC observation prefix before deterministic ingestion. This closes a temporal-fidelity gap affecting BEAM, LongMemEval, and LoCoMo.

Validation:

  • python -m unittest discover -s tests -v (3/3)
  • python -m py_compile for the adapter and all three runners
  • live smoke against the current GoodMemory HTTP bridge: write with Unix timestamp, recall returns [Observed at 2023-05-08T00:00:00Z] ...

The PR remains ready for maintainer review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant