This setup gives you:
- One central memory instance for user-level facts/preferences.
- One isolated memory instance per project for project context.
~/memory-core/ # central instance on 8787 (preferences, identity, facts)
project-a/ # project-specific instance on 8788 (project scopes only)
project-b/ # project-specific instance on 8789 (project scopes only)From this repository:
npm run dev:centralCentral defaults:
OPENCLAW_PORT=8787OPENCLAW_RUNTIME_DIR=~/memory-core/runtimeOPENCLAW_ALLOWED_SCOPE_PREFIXES=preferences,identity,facts
From this repository:
npm run dev:project-a
npm run dev:project-bProject defaults:
project-aruns on8788with runtime at./runtime/project-aproject-bruns on8789with runtime at./runtime/project-b- Both enforce project-only scopes via:
OPENCLAW_DEFAULT_SCOPE=projectOPENCLAW_ALLOWED_SCOPE_PREFIXES=project,<project-name>
docker compose -f docker-compose.hybrid.yml up -dcurl http://localhost:8787/health
curl http://localhost:8788/health
curl http://localhost:8789/healthEach health response includes:
instance_namedefault_scopeallowed_scope_prefixes
Build once first:
npm run build{
"mcpServers": {
"memorycore-central": {
"command": "node",
"args": ["dist/src/mcp.js"],
"cwd": "/path/to/Project-AI-MemoryCore",
"env": {
"OPENCLAW_INSTANCE": "central",
"OPENCLAW_RUNTIME_DIR": "/home/you/memory-core/runtime",
"OPENCLAW_DB_PATH": "/home/you/memory-core/runtime/openclaw.db",
"OPENCLAW_DEFAULT_SCOPE": "preferences",
"OPENCLAW_ALLOWED_SCOPE_PREFIXES": "preferences,identity,facts"
}
}
}
}{
"mcpServers": {
"memorycore-project-a": {
"command": "node",
"args": ["dist/src/mcp.js"],
"cwd": "/path/to/Project-AI-MemoryCore",
"env": {
"OPENCLAW_INSTANCE": "project-a",
"OPENCLAW_RUNTIME_DIR": "/path/to/project-a/.memorycore",
"OPENCLAW_DB_PATH": "/path/to/project-a/.memorycore/openclaw.db",
"OPENCLAW_DEFAULT_SCOPE": "project",
"OPENCLAW_ALLOWED_SCOPE_PREFIXES": "project,project-a"
}
}
}
}{
"mcpServers": {
"memorycore-project-b": {
"command": "node",
"args": ["dist/src/mcp.js"],
"cwd": "/path/to/Project-AI-MemoryCore",
"env": {
"OPENCLAW_INSTANCE": "project-b",
"OPENCLAW_RUNTIME_DIR": "/path/to/project-b/.memorycore",
"OPENCLAW_DB_PATH": "/path/to/project-b/.memorycore/openclaw.db",
"OPENCLAW_DEFAULT_SCOPE": "project",
"OPENCLAW_ALLOWED_SCOPE_PREFIXES": "project,project-b"
}
}
}
}- Start central memory first and store user preferences/facts there.
- Add project-specific instances and keep project context in those DBs only.
- In each project workspace, point MCP to that project instance config.
- Keep central MCP available for cross-project personal memory.