LightAgent icon indicating copy to clipboard operation
LightAgent copied to clipboard

Proposal: support ClawMem as an optional long-term memory backend

Open EricZequan opened this issue 7 months ago • 4 comments

Summary ClawMem looks like a plausible optional long-term memory backend for LightAgent users who want durable, inspectable memory beyond the current built-in defaults.

What ClawMem is ClawMem is durable, searchable memory for OpenClaw agents: it records conversations, extracts key facts, injects relevant context before future sessions, and keeps memory inspectable and editable by users. Primary reference: https://clawmem.ai/

Why this project is involved LightAgent's README explicitly highlights memory support, custom long-term memory per user, native support for mem0, MCP support, tool integration, and self-learning agents. That makes LightAgent a natural place to discuss an optional external memory backend.

Problem or gap LightAgent already supports long-term memory, but there does not appear to be a documented ClawMem-backed option for users who want durable memory with an inspectable issue/repo style record outside the runtime.

Requested change Would maintainers be open to one of these shapes?

  • Support for ClawMem as an optional long-term memory backend alongside mem0
  • A documented external adapter or plugin
  • A docs example that shows how to connect LightAgent memory flows to ClawMem

User value / maintainer relevance This could give LightAgent users another optional memory backend without changing the default experience, especially for users who want inspectable memory artifacts and cross-session recall.

Evidence and prior art

  • README says LightAgent supports custom long-term memory and natively supports mem0.
  • README says each agent has scene memory and can self-learn from user conversations.
  • README says LightAgent supports MCP and custom tool integration.

Explicit non-goals

  • Not asking to remove or replace mem0
  • Not asking to force a ClawMem dependency into the default setup
  • Not asking for a broad architectural rewrite before validating a narrow adapter path

Links

  • ClawMem: https://clawmem.ai/
  • IntegrationFinder issue: https://github.com/clawmem-ai/IntegrationFinder/issues/42

EricZequan avatar Apr 07 '26 04:04 EricZequan

This fits the direction for optional memory adapters, but it should stay outside the core dependency set. A good first implementation shape would be:\n\n- implement a small ClawMem adapter that satisfies LightAgent’s existing MemoryProtocol (store(data, user_id) and retrieve(query, user_id));\n- keep ClawMem as an optional extra or docs-only dependency, not required by default install;\n- document namespace/provenance behavior so it works with MemoryPolicy;\n- add one focused example and tests with a fake adapter, avoiding live network calls in CI.\n\nThis can be handled as a P1 integration once the guardrails/memory policy line has settled. PRs are welcome if they keep this optional and lightweight.

wxai-space avatar Jun 01 '26 11:06 wxai-space

I can take a small first pass on this.

Proposed scope for the first PR:

  • add a lightweight ClawMemMemoryAdapter example that satisfies LightAgent's existing MemoryProtocol (store(data, user_id) / retrieve(query, user_id));
  • keep ClawMem completely optional, with no required dependency added to the core package;
  • use an injectable/fake client in tests so CI does not make live network calls or require secrets;
  • preserve MemoryScope-compatible metadata (user_id, source, scope, agent_name) so the adapter works with MemoryPolicy;
  • add a short doc showing how the adapter maps LightAgent memory records to ClawMem knowledge items.

I'll avoid changing the default memory behavior or the mem0 path. The first PR will be example/docs/tests focused, and we can decide later whether a packaged optional extra is worth adding.

helloJamest avatar Jul 08 '26 01:07 helloJamest

进度更新:#74 已合并,现已提供依赖无关的 ClawMemMemoryAdapter 示例、接入文档和 fake-client 测试,应用可以通过 MemoryProtocol 对接 ClawMem 风格客户端,核心包没有新增强制依赖。

本 Issue 暂不关闭,继续跟踪后续是否需要官方可选后端、真实 SDK/HTTP/MCP 兼容矩阵以及生产级集成测试。

wxai-space avatar Jul 10 '26 09:07 wxai-space

Closing this as completed for the requested optional integration shape. #74 added a dependency-free ClawMemMemoryAdapter example, documentation, and fake-client tests without changing the default memory path or adding a required core dependency. A packaged SDK/HTTP/MCP compatibility matrix can be proposed later as a focused follow-up if there is concrete production demand.

wxai-space avatar Jul 28 '26 16:07 wxai-space