Use when you have a written implementation plan to execute in a separate session with review checkpoints
npx skills add Zaytas/openclaw-skill-rag-memory
Or install specific skill: npx add-skill https://github.com/Zaytas/openclaw-skill-rag-memory
# Description
RAG memory system with Qdrant vector search β indexes workspace files, session transcripts, and AI-generated summaries for semantic retrieval. Use when OpenClaw needs semantic recall across workspace documents or session history, when setting up or maintaining a Qdrant-backed memory pipeline, or when enriching prompts with retrieved context.
# SKILL.md
name: rag-memory
description: RAG memory system with Qdrant vector search β indexes workspace files, session transcripts, and AI-generated summaries for semantic retrieval. Use when OpenClaw needs semantic recall across workspace documents or session history, when setting up or maintaining a Qdrant-backed memory pipeline, or when enriching prompts with retrieved context.
RAG Memory
Use this skill when you need semantic retrieval from OpenClaw workspace files, session transcripts, or structured summaries.
Query workflow
- Ensure
QDRANT_URL,EMBED_API_KEY(orGEMINI_API_KEY), and any path overrides are set. - Prefer
scripts/recall.mjsfor operator-facing queries because it combines vector search with a markdown grep fallback. - Use a focused natural-language query first.
- Add filters only when needed:
--limit N--channel discord|signal|webchat--source-type file|summary|transcript--no-vectorfor grep-only fallback--jsonfor machine-readable output
Example:
node openclaw-rag-memory/scripts/recall.mjs "what changed in the deployment plan" --limit 5 --source-type summary
Indexing workflow
- Use
scripts/index-memory.mjsto embed markdown workspace content. - Use
scripts/index-transcripts.mjsto embed session transcript chunks. - Use
scripts/find-unsummarized.mjsandscripts/summarize-worker.mjsto prepare and process summary jobs. - Use
scripts/embed-summaries.mjsto embed validated summary JSON. - Use
scripts/enrich-prompt.mjswhen a sub-agent prompt should include recalled context.
Resources
All bundled executables live in scripts/.
# README.md
OpenClaw RAG Memory
A portable RAG memory package for OpenClaw that indexes workspace files, session transcripts, and AI-generated session summaries into Qdrant for semantic retrieval.
What it is
This repository packages the memory scripts behind an OpenClaw RAG workflow. It is designed to live inside an OpenClaw workspace and provide searchable long-term context using Qdrant vector search plus Gemini embeddings.
Architecture
The memory index is built from three layers:
- File chunks β Markdown files from the workspace are chunked, embedded, and stored as
sourceType=file. - Session summaries β AI-generated structured summaries are embedded as
sourceType=summary. - Transcript chunks β Session transcripts are chunked directly from OpenClaw session logs and stored as
sourceType=transcript.
This gives you both broad semantic recall and precise conversational retrieval.
Prerequisites
- OpenClaw installed and writing session logs
- A reachable Qdrant instance
- A Gemini API key for embeddings
- Optional: an Anthropic API key if you want to use
summarize-sessions.mjs - Node.js 20+ with native
fetch
Repository layout
openclaw-rag-memory/
βββ README.md
βββ SKILL.md
βββ config.example.mjs
βββ LICENSE
βββ .gitignore
βββ scripts/
βββ recall.mjs
βββ index-memory.mjs
βββ index-transcripts.mjs
βββ embed-summaries.mjs
βββ summarize-worker.mjs
βββ summarize-sessions.mjs
βββ find-unsummarized.mjs
βββ query-memory.mjs
βββ enrich-prompt.mjs
βββ validate-summaries.mjs
βββ nightly-index.sh
βββ nightly-cron-prompt.md
Runtime state, logs, and generated inputs are written under runtime/ and are intentionally ignored by git.
Installation
- Copy this repository into your OpenClaw workspace, for example:
bash cp -R openclaw-rag-memory ~/.openclaw/workspace/ - Review
config.example.mjsand decide how you want to supply configuration. - Export the required environment variables before running scripts:
bash export QDRANT_URL=http://localhost:6333 export COLLECTION_NAME=memory export EMBED_MODEL=models/gemini-embedding-001 export EMBED_API_KEY=your_gemini_api_key export WORKSPACE=$HOME/.openclaw/workspace export OPENCLAW_HOME=$HOME/.openclaw - Run the scripts from the workspace or call them by absolute path.
Configuration
The scripts read configuration from environment variables.
Core settings:
QDRANT_URLβ Qdrant base URL. Default:http://localhost:6333COLLECTION_NAMEβ Qdrant collection name. Default:memoryEMBED_MODELβ embedding model name. Default:models/gemini-embedding-001EMBED_API_KEYβ Gemini API key for embeddingsWORKSPACEβ OpenClaw workspace path. Defaults to the parent of this repoOPENCLAW_HOMEβ OpenClaw home directory. Defaults to the parent ofWORKSPACEAGENT_IDSβ comma-separated agent ids to scan. Default:main,discord-botSUMMARY_API_KEYβ optional summarization API key forsummarize-sessions.mjsSUMMARY_MODELβ summarization model id
The included config.example.mjs is a documented template showing the full set of tunable values used across the scripts.
Script reference
scripts/recall.mjsβ unified recall helper that combines Qdrant vector search with local markdown grep fallbackscripts/index-memory.mjsβ indexes workspace markdown files into Qdrantscripts/index-transcripts.mjsβ indexes OpenClaw session transcript chunks into Qdrantscripts/embed-summaries.mjsβ embeds structured summary JSON into Qdrantscripts/summarize-worker.mjsβ manages the summarize/validate/embed queue for prepared session inputsscripts/summarize-sessions.mjsβ legacy end-to-end summarizer that generates and embeds summaries directlyscripts/find-unsummarized.mjsβ discovers eligible sessions and writes compact inputs for summarizationscripts/query-memory.mjsβ CLI semantic query tool for raw Qdrant retrievalscripts/enrich-prompt.mjsβ augments a task prompt with relevant recalled contextscripts/validate-summaries.mjsβ validates structured summary JSON before embeddingscripts/nightly-index.shβ deterministic nightly pipeline wrapperscripts/nightly-cron-prompt.mdβ prompt text for a cron/automation agent that should only run deterministic indexing
Typical workflow
Initial indexing
node openclaw-rag-memory/scripts/index-memory.mjs --full
node openclaw-rag-memory/scripts/index-transcripts.mjs --full
Recall
node openclaw-rag-memory/scripts/recall.mjs "release notes policy" --limit 5
Summarization queue
node openclaw-rag-memory/scripts/find-unsummarized.mjs
node openclaw-rag-memory/scripts/summarize-worker.mjs --status
Nightly pipeline setup
Use the deterministic wrapper for unattended indexing:
bash openclaw-rag-memory/scripts/nightly-index.sh
The nightly wrapper:
- Indexes workspace markdown files
- Indexes transcript chunks
- Discovers sessions that need summarization input
- Writes a log under
runtime/logs/
If you use an external cron or automation agent, pair it with scripts/nightly-cron-prompt.md so summarization remains a separate step.
License
MIT. See LICENSE.
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.