4caf115ec93b5e41edbe7662257da0c21449f498
TrulyMEM - OpenClaw Adapter
Give AI true long-term memory capability - OpenClaw framework adapter version
🤖 AI Self-Installation Guide
This section is for AI Agents, guiding them how to self-install this Skill to OpenClaw
Installation Steps
Step 1: Locate Skill Directory
OpenClaw Skill precedence: /.agents/skills/ > ~/.agents/skills/ > ~/.openclaw/skills/
Copy the skills/ directory to a high-priority location:
# Method 1: User-level installation (recommended)
cp -r skills/ ~/.agents/skills/graph_memory
# Method 2: System-level installation
sudo cp -r skills/ /.agents/skills/graph_memory
Step 2: Verify Installation
Invoke Skill in OpenClaw:
Remember: I like programming and am learning TypeScript
AI should receive a confirmation message.
Step 3: Use the Skill
After installation, AI can use these commands:
| Command | Function |
|---|---|
commit |
Commit memories |
recall |
Retrieve memories |
purge |
Delete memories |
introspect |
Inspect status |
persona_update/clear |
Persona management |
task_create/set_state/delete |
Task management |
Introduction
This project ports TrulyMEM's graph memory capability to TypeScript for the OpenClaw framework.
As an OpenClaw Skill module, it provides graph memory functionality:
- recall: Retrieve memories
- commit: Commit memories
- purge: Delete memories
- introspect: Inspect status
- persona_update/clear: Persona management
- task_create/set_state/delete: Task management
Directory Structure
ts/
├── src/runtime/core/
│ ├── graph_memory/ # Graph memory core module
│ │ ├── types.ts # Type definitions
│ │ ├── graph_database.ts # Graph database
│ │ ├── memory_service.ts # Memory service
│ │ └── index.ts # Module exports
│ └── tools/
│ └── builtin/
│ └── graph_memory_tool.ts # Tool implementation
│
├── package.json # Project config
└── tsconfig.json # TypeScript config
skills/ # OpenClaw Skill definitions
└── graph_memory/
├── SKILL.md # Memory operations
├── persona/SKILL.md # Persona management
└── task/SKILL.md # Task management
Using in OpenClaw
Method 1: As Module (for Developer Integration)
Step 1: Copy Source Code
Copy the ts/ directory to your OpenClaw project:
yourOpenClawProject/
└── src/
└── runtime/
└── core/
└── graph_memory/ # Copy from ts/src/runtime/core/
Step 2: Compile TypeScript
cd ts/
npm install
npm run build
Compiled files output to ts/dist/ directory.
Step 3: Import in Code
import { createGraphMemoryTool } from './runtime/core/tools/builtin/graph_memory_tool';
// Create tool instance
const tool = createGraphMemoryTool('my-session-id');
// Commit memory example
const commitResult = await tool.handler({
action: 'commit',
params: {
triplets: [
{ subject: '用户', relation: '喜欢', object: '编程' },
{ subject: '用户', relation: '正在学习', object: 'TypeScript' }
]
}
}, context);
// Recall memory example
const recallResult = await tool.handler({
action: 'recall',
params: {
queryIntent: '用户 编程'
}
}, context);
Method 2: Use Skill (Recommended for AI Agent)
Step 1: Place Skill Files
Copy skills/ directory to OpenClaw's Skill directory:
cp -r skills/ ~/.agents/skills/graph_memory
Step 2: Invoke Skill
Use directly in OpenClaw:
Use graph_memory to remember: I like programming and am learning TypeScript
Available Skills
| Skill Name | Function | Use Case |
|---|---|---|
graph_memory |
Memory CRUD | Read/write/delete memories |
graph_memory_persona |
Persona management | Set AI persona |
graph_memory_task |
Task management | Create/update tasks |
API
GraphMemoryTool
const tool = new GraphMemoryTool(sessionId?: string);
Actions
| Action | Description | Parameters |
|---|---|---|
recall |
Retrieve memories | queryIntent, seedEntities, sessionFilter |
commit |
Commit memories | triplets, sessionId, turnId |
purge |
Delete memories | criteria, mode |
introspect |
Inspect status | - |
persona_update |
Update persona | attributes, mode |
persona_clear |
Clear persona | confirm |
task_create |
Create task | task_id, description, info_nodes |
task_set_state |
Set task state | task_id, state |
task_delete |
Delete task | task_id |
Examples
Commit Memory
{
"action": "commit",
"params": {
"triplets": [
{ "subject": "用户", "relation": "喜欢", "object": "TypeScript" },
{ "subject": "用户", "relation": "正在学习", "object": "OpenClaw" }
]
}
}
Recall Memory
{
"action": "recall",
"params": {
"queryIntent": "用户 学习"
}
}
Create Task
{
"action": "task_create",
"params": {
"task_id": "Task_学习TypeScript",
"description": "学习 TypeScript 并完成项目",
"info_nodes": ["文档链接", "教程链接"]
}
}
License
Description
Languages
Python
63.5%
HTML
33.5%
Shell
1.6%
CSS
0.8%
C++
0.3%
Other
0.3%