説明なし

Lukas Goldschmidt e9d8b3a99a feat: add book knowledge helpers 1 ヶ月 前
dist 2469d7c81b Add knowledge RAG policy skill 1 ヶ月 前
skills 2469d7c81b Add knowledge RAG policy skill 1 ヶ月 前
.gitignore c458eea5e7 Add gitignore 1 ヶ月 前
PROJECT.md c573c3aed2 Init mem0 python plugin with knowledge tools 1 ヶ月 前
README.md d411dcadc7 Add README quickstart 1 ヶ月 前
index.js e9d8b3a99a feat: add book knowledge helpers 1 ヶ月 前
index.ts c573c3aed2 Init mem0 python plugin with knowledge tools 1 ヶ月 前
openclaw.plugin.json c573c3aed2 Init mem0 python plugin with knowledge tools 1 ヶ月 前
package-lock.json c573c3aed2 Init mem0 python plugin with knowledge tools 1 ヶ月 前
package.json c573c3aed2 Init mem0 python plugin with knowledge tools 1 ヶ月 前
test_memories.mjs 4f466a8d10 Add cleanup to test script 1 ヶ月 前
tsconfig.json c573c3aed2 Init mem0 python plugin with knowledge tools 1 ヶ月 前

README.md

openclaw-mem0-python

OpenClaw plugin that exposes the mem0 HTTP API as tools for conversational memory and a tool-driven knowledge base (RAG). Conversational memory can be injected by the hook; knowledge retrieval stays explicit via tool calls.

Features

  • Conversational memory: write/search/read recent.
  • Knowledge base tools: list books, describe a book, search within one book or across multiple books.

Install (local dev)

# link plugin into OpenClaw extensions (use workspace repo as source)
openclaw plugins install -l /home/lucky/.openclaw/workspace/openclaw-mem0-python

# enable if not already
openclaw plugins enable openclaw-mem0-python

# reload gateway
openclaw gateway restart

Configure

You can set defaults via environment or config:

  • MEM0_BASE_URL (default: http://192.168.0.200:8420)
  • MEM0_KNOWLEDGE_USER_ID (default: knowledge_base)

Tool surface

  • write({ text, userId? })
  • search({ query, userId?, limit? })
  • read({ userId?, limit? })

Knowledge tools:

  • listKnowledgeSources({ userId? })
  • describeKnowledgeBook({ sourceFile, userId? })
  • searchKnowledgeBook({ query, sourceFile, userId?, limit? })
  • searchKnowledgeBooks({ query, sourceFiles, userId?, limit? })
  • searchKnowledge({ query, userId?, limit? })
  • writeKnowledge({ text, userId? })

Quickstart (example flow)

1) List books:

await plugin.listKnowledgeSources();

2) Pick a book and inspect scope:

await plugin.describeKnowledgeBook({ sourceFile: "the-psychedelic-experience.pdf" });

3) Search inside that book:

await plugin.searchKnowledgeBook({
  sourceFile: "the-psychedelic-experience.pdf",
  query: "Timothy Leary quote",
  limit: 5,
});

Skill (Knowledge RAG Policy)

This repo bundles a policy skill that tells the LLM when to use knowledge tools:

  • Skill source: skills/knowledge-rag-policy/SKILL.md
  • Packaged file: dist/knowledge-rag-policy.skill

Install the skill (optional):

python3 /usr/lib/node_modules/openclaw/skills/skill-creator/scripts/package_skill.py \
  /home/lucky/.openclaw/workspace/openclaw-mem0-python/skills/knowledge-rag-policy \
  /home/lucky/.openclaw/workspace/openclaw-mem0-python/dist

Test (local)

node /home/lucky/.openclaw/workspace/openclaw-mem0-python/test_memories.mjs

This test writes/reads conversational memory, lists knowledge sources, describes the first book, searches it, then cleans up test memories.

Notes

  • describeKnowledgeBook uses /knowledge/search plus metadata filtering (metadata.source_file) to safely scope results to one book.
  • If your knowledge source names are PDFs, the tool also exposes a hintQuery derived from source_file (same approach as the dashboard).