|
|
1 місяць тому | |
|---|---|---|
| dist | 1 місяць тому | |
| skills | 1 місяць тому | |
| .gitignore | 1 місяць тому | |
| PROJECT.md | 1 місяць тому | |
| README.md | 1 місяць тому | |
| index.js | 1 місяць тому | |
| index.ts | 1 місяць тому | |
| openclaw.plugin.json | 1 місяць тому | |
| package-lock.json | 1 місяць тому | |
| package.json | 1 місяць тому | |
| test_memories.mjs | 1 місяць тому | |
| tsconfig.json | 1 місяць тому |
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.
# 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
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)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? })This repo bundles a policy skill that tells the LLM when to use knowledge tools:
skills/knowledge-rag-policy/SKILL.mddist/knowledge-rag-policy.skillInstall 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
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.
describeKnowledgeBook uses /knowledge/search plus metadata filtering (metadata.source_file) to safely scope results to one book.hintQuery derived from source_file (same approach as the dashboard).