Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add OpenClaw plugin and documentation#3964

Merged
deshraj merged 1 commit intomainfrom
user/dyadav/add-openclaw
Feb 2, 2026
Merged

feat: add OpenClaw plugin and documentation#3964
deshraj merged 1 commit intomainfrom
user/dyadav/add-openclaw

Conversation

@deshraj
Copy link
Collaborator

@deshrajdeshraj commentedFeb 2, 2026
edited
Loading

Summary

  • Adds the@mem0/openclaw-mem0 plugin that provides long-term memory for OpenClaw agents
  • Auto-recall injects relevant memories before agent responses
  • Auto-capture stores important facts after each turn
  • Supports both Mem0 Cloud (platform) and self-hosted (open-source) modes
  • Includes 5 agent tools (memory_search,memory_list,memory_store,memory_get,memory_forget)
  • Adds integration documentation to the docs site under Integrations > Agent Frameworks

Add the @mem0/openclaw-mem0 plugin that provides long-term memory for OpenClaw agents:- Auto-recall injects relevant memories before agent responses- Auto-capture stores important facts after each turn- Supports both Mem0 Cloud (platform) and self-hosted (open-source) modes- Includes 5 agent tools for explicit memory operationsAlso adds integration documentation to the docs site.Co-authored-by: Cursor <cursoragent@cursor.com>
// ============================================================================
// Types
// ============================================================================

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

interfaces and types can go into a types.ts for better modularity and readibility

page_size?: number;
}

interface MemoryItem {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

memory item can also contain run_id

}

interface SearchOptions {
user_id: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

entities can be extracted in a single type and then extended in this type

}

interface ListOptions {
user_id: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Same as above

private async _init(): Promise<void> {
const { default: MemoryClient } = await import("mem0ai");
const opts: Record<string, string> = { apiKey: this.apiKey };
if (this.orgId) opts.org_id = this.orgId;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This is kind off redundant

if (options.enable_graph) opts.enable_graph = options.enable_graph;
if (options.output_format) opts.output_format = options.output_format;

const result = await this.client.add(messages, opts);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This can be done async to unblock the execution

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Event loop will handle this

// Default Custom Instructions & Categories
// ============================================================================

const DEFAULT_CUSTOM_INSTRUCTIONS = `Your Task: Extract and maintain a structured, evolving profile of the user from their conversations with an AI assistant. Capture information that would help the assistant provide personalized, context-aware responses in future interactions.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Prompts can go into a separate prompts file

- Raw code snippets (capture the intent/decision, not the code itself)
- Information the user explicitly asks not to remember`;

const DEFAULT_CUSTOM_CATEGORIES: Record<string, string> = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This can also go into a constants file

// ============================================================================
// Config Schema
// ============================================================================

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Same as above

);
}

return new PlatformProvider(cfg.apiKey!, cfg.orgId, cfg.projectId);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Again sending org id and project id is redundant

// ============================================================================
// Provider Factory
// ============================================================================

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This can go into a factory.ts

// Tools
// ========================================================================

api.registerTool(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

a tools.ts would have been better suited here

@deshraj
Copy link
CollaboratorAuthor

Thanks Saket. Will incorporate these in the follow up PR. Right now, trying to meet the deadline.

@whysosaket
Copy link
Member

Thanks Saket. Will incorporate these in the follow up PR. Right now, trying to meet the deadline.

Sounds good! Approved

deshraj reacted with heart emoji

@deshrajdeshraj merged commit3d3e875 intomainFeb 2, 2026
4 checks passed
@deshrajdeshraj deleted the user/dyadav/add-openclaw branchFebruary 2, 2026 18:04
garciaba79 pushed a commit to garciaba79/mem0 that referenced this pull requestFeb 12, 2026
@Zlo7
Copy link
Contributor

@deshraj thanks for the OpenClaw plugin! I discovered an issue with the auto-recall feature and wanted to bring it to your attention.

Issue: Auto-recall silently fails due to property name mismatch

  • Problem: Hook returns{ systemContext: ... } but OpenClaw expects{ prependContext: ... }
  • Result: Memories are fetched but never injected into prompts
  • Fix: One-line property rename

I've submitted:

The fix is minimal and maintains all your original functionality. Would appreciate your review when you have a moment! I realize this is a pretty large repo so it isn't critical for mem0 overall, but I believe it's critical for the OpenClaw plugin.

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

Reviewers

@whysosaketwhysosaketwhysosaket approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@deshraj@whysosaket@Zlo7

Comments


[8]ページ先頭

©2009-2026 Movatter.jp