Use this repo if you want an OpenClaw assistant that:
- survives session resets
- retrieves personal context before answering when needed
- does not confuse generic topic questions with facts about the user
- can gradually build a durable knowledge base through structured interviews and normal conversation
This section is the main guide. If you just want to install and run the system, follow these steps in order.
Run:
curl -fsSL https://openclaw.ai/install.sh | bashThen complete the normal OpenClaw first-run flow.
Inside OpenClaw, connect:
- any GPT-5.x model
- provider: OpenAI Codex OAuth
Recommended baseline for this template:
- OpenClaw runtime
- OpenAI Codex OAuth provider
- GPT-5.x model
Before using the setup prompts, open a terminal and run:
openclaw gateway runThen open the chat UI in your browser:
http://127.0.0.1:18789
Use that UI chat for the staged prompts below.
Do not replace anything before OpenClaw has completed its normal setup.
The intended order is:
- install OpenClaw
- make sure the assistant starts normally
- let the default workspace files appear
- only then replace/adapt them using this repo
Open the workspace-template/ folder from this repo.
Copy/adapt these files into your real OpenClaw workspace:
workspace-template/AGENTS.mdworkspace-template/STARTUP.mdworkspace-template/MEMORY.mdworkspace-template/KB_CONFIG.mdworkspace-template/memory/README.md- optionally
workspace-template/SOUL.md - optionally
workspace-template/USER.md
A common OpenClaw workspace path is:
/home/$USER/.openclaw/workspace
If your installation uses another workspace path, use your actual OpenClaw workspace location instead.
- if the generated OpenClaw file is only a generic placeholder, full replacement is usually fine
- if the generated file already contains user-specific material you want to keep, merge carefully instead of blindly overwriting
Open:
workspace-template/KB_CONFIG.md
Replace:
REPLACE_THIS_WITH_THE_ACTUAL_ABSOLUTE_PATH_TO_YOUR_CANONICAL_KB
with your real absolute KB path.
Examples:
/home/your-user/personal-kb/opt/personal-kb/vault/srv/assistant-memory/main-vault
This file should become the startup-visible source of truth for where canonical memory lives.
Use vault-template/ as a starting point.
You can:
- copy it directly
- modify it
- rename sections
- expand or shrink the structure
Suggested top-level sections:
00-system/10-identity/20-preferences/30-projects/40-people/50-decisions/60-context/70-daily/80-summaries/90-archive/
This canonical KB is the source of truth. Your search indexes are not the source of truth.
This repo does not force one architecture.
You can use:
- local-only retrieval
- split-device retrieval
- cloud embeddings
- managed vector DB
- hybrid local/cloud setup
If you want the minimum working setup, start with:
- canonical markdown notes
- keyword search only
- manual or scripted reindex after note changes
See:
scripts/minimal-retrieval-starter.md
Reference files:
schemas/sqlite_mock.sqlschemas/metadata-example.jsonscripts/retrieve_context_example.pyscripts/queue_reindex_example.pyscripts/process_reindex_queue_example.pyscripts/reindex_notes.shscripts/embedding_options.md
These are examples, not production guarantees.
This repo supports a chat-driven staged setup.
Use the prompts in this order inside the OpenClaw UI chat at http://127.0.0.1:18789.
Open:
prompts/01-startup-prompt.md
Copy the block under:
Prompt to paste into chat
Paste it into the chat.
Wait for one of these lines:
STAGE COMPLETE: PREFLIGHT CHECKSTAGE BLOCKED: PREFLIGHT CHECK
Only continue when the stage is complete.
Open:
prompts/02-technical-setup-prompt.md
Copy the block under:
Prompt to paste into chat
Paste it into the chat.
Wait for one of these lines:
STAGE COMPLETE: TECHNICAL SETUPSTAGE BLOCKED: TECHNICAL SETUP
Only continue when the stage is complete.
Open:
prompts/03-startup-validation-prompt.md
Copy the block under:
Prompt to paste into chat
Paste it into the chat.
Wait for one of these lines:
STAGE COMPLETE: STARTUP VALIDATIONSTAGE BLOCKED: STARTUP VALIDATION
Only continue when the stage is complete.
Open:
prompts/04-initial-interview-prompt.md
Copy the block under:
Prompt to paste into chat
Paste it into the chat.
Expected result:
- the assistant starts the foundational interview
- ends the kickoff with:
STAGE COMPLETE: FOUNDATIONAL INTERVIEW STARTED
Open:
prompts/05-post-setup-self-check-prompt.md
Use this if you want a final readiness summary.
Also read:
docs/prompt-integration.md
After setup, test these exact prompts:
Tell me about castles in Germany
Expected:
- normal informational answer
- no automatic personal-memory update
I plan to go to Germany, tell me about castles there
Expected:
- informational + personal handling
- retrieval of user context if useful
- possible memory capture of travel intent
I care a lot about battery life in phones
Expected:
- reusable preference capture if not already known
Verify manually that the assistant:
- reads workspace startup files
- reads
KB_CONFIG.md - can identify the canonical KB path
See also:
scripts/test-cases.mdscripts/check_behavior.md
If the assistant treats Test A and Test B the same way, your setup is wrong.
Once Prompt 4 is used, the assistant should begin structured context collection.
What the interview should cover first:
- communication style
- current life context
- projects
- plans
- constraints
- decision rules
- important devices/tools
Main maintenance rules:
- update existing notes before creating duplicates
- save reusable facts, not transcripts
- keep local memory compressed
- reindex after meaningful changes
- check for stale index entries after deletes/moves
- refresh summaries occasionally
Helpful files:
docs/maintenance.mddocs/update-workflow.mddocs/retrieval-workflow.mddocs/prompt-integration.mdscripts/test-cases.md
If you are doing the setup manually, open these files in this order:
README.mdQUICKSTART.mdINSTALL.mdworkspace-template/AGENTS.mdworkspace-template/STARTUP.mdworkspace-template/KB_CONFIG.mdprompts/01-startup-prompt.mdprompts/02-technical-setup-prompt.mdprompts/03-startup-validation-prompt.mdprompts/04-initial-interview-prompt.md- optional:
prompts/05-post-setup-self-check-prompt.md docs/prompt-integration.mdscripts/test-cases.md
workspace-template/AGENTS.mdworkspace-template/STARTUP.mdworkspace-template/MEMORY.mdworkspace-template/KB_CONFIG.mdworkspace-template/memory/README.md- optional:
workspace-template/SOUL.md - optional:
workspace-template/USER.md
prompts/01-startup-prompt.mdprompts/02-technical-setup-prompt.mdprompts/03-startup-validation-prompt.mdprompts/04-initial-interview-prompt.md- optional:
prompts/05-post-setup-self-check-prompt.md
- everything inside
vault-template/
Without a structured KB, assistants often:
- lose context after resets
- repeat onboarding questions
- answer too generically
- mix temporary details with durable user facts
A good KB gives the assistant a way to:
- re-anchor on cold start
- retrieve the right context when needed
- save reusable facts cleanly
- keep startup behavior predictable
This template assumes 3 layers.
Durable source of truth. Examples:
- markdown vault
- note tree
- structured text files
Built from the canonical KB. Examples:
- SQLite FTS
- FAISS
- pgvector
- cloud vector DB
- hybrid retrieval stack
Small startup/compatibility layer. Examples:
AGENTS.mdSTARTUP.mdMEMORY.mdKB_CONFIG.md- recent local capture files
Important rule: The operational layer should not become a second full biography.
One of the key rules in this system:
- generic topic request != personal fact
Example:
Tell me about castles in Germany-> answer onlyI plan to go to Germany, tell me about castles there-> answer + consider personalized retrieval + possible memory update
.
├── prompts/
├── docs/
├── schemas/
├── scripts/
├── workspace-template/
├── vault-template/
├── README.md
├── QUICKSTART.md
├── INSTALL.md
└── PRE_PUBLISH_CHECKLIST.md
QUICKSTART.mdINSTALL.mddocs/openclaw-specific-setup.mddocs/workspace-startup-guidelines.mddocs/prompt-integration.mdscripts/test-cases.md
MIT — see LICENSE.md.