Semantic Memory for Openclaw

A local, vector-based semantic search skill for OpenClaw memories using ChromaDB and Gemini embeddings.

stigg86
v1.0.0
Jun 5, 2026
0
600
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install bud-semantic-memory

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install bud-semantic-memory using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Semantic Memory?

Semantic Memory is a developer-focused capability designed to upgrade how your local AI agent processes context. Instead of relying on strict, literal keyword matching that breaks when exact phrasing is forgotten, this skill introduces meaning-based query resolution. It parses local markdown files and performs cosine similarity lookups against calculated vector representations to locate highly relevant decisions, logs, and notes.

As one of the core Openclaw Skills, it addresses the common limitation of flat-file workspace searches. By generating local embeddings via the Gemini API and saving them to a local ChromaDB database, developers gain instant, secure, and semantic recall of historical context.

Semantic Memory Use Cases

  • Resolving development and configuration decisions even when exact project names or parameters are forgotten.
  • Retrieving historical trading logs, decision parameters, and instructions from previous agent sessions.
  • Improving system contextual awareness by allowing other custom Openclaw Skills to search agent memory programmatically.
  • Setting up automated workspace maintenance pipelines to keep the memory index up to date without manual actions.

How Semantic Memory Works

  1. Scanning: The tool scans the target directory (~/.openclaw/workspace/memory/) for all existing markdown files.
  2. Embedding: It processes the text content of these markdown documents and generates high-dimensional vector representations using the Gemini API.
  3. Storage: The vector embeddings and associated text metadata are stored locally inside a private ChromaDB collection.
  4. Cosine Similarity: When a query is made, the tool converts the request into a search vector and compares it against ChromaDB entries using cosine similarity.
  5. Ranking: Results are returned and displayed to the user or agent, ordered dynamically by semantic relevance.

Semantic Memory Setup

To install and configure Semantic Memory, one of the premier search-focused Openclaw Skills, follow these steps:

Prerequisites

Make sure Python 3.8+ and pip are installed on your machine.

Installation

Install the required vector database dependency:

pip install chromadb

Configuration

To enable semantic vector search, configure a Google Gemini API key:

  1. Obtain an API key from Google AI Studio.
  2. Save the API key to ~/.openclaw/credentials/gemini.json in the following structure:
{
  "api_key": "YOUR_GEMINI_API_KEY"
}

Note: If no Gemini key is provided, the skill automatically defaults to basic text search.

Building the Index

Generate the vector index for your existing memory database:

python3 ~/.openclaw/semantic-memory/semantic_memory.py index

Semantic Memory Data Schema & Taxonomy

File Structure

The skill organizes database configurations, executables, and embeddings in the following directory layout:

Path Description
~/.openclaw/semantic-memory/semantic_memory.py The core Python CLI executable for indexing, search, and memory management.
~/.openclaw/semantic-memory/memory.log Run logs tracking index status and query processes.
~/.openclaw/semantic-memory/data/ The local storage directory containing the ChromaDB collection.

Auto-Ingested Sources

The index pipeline automatically monitors and aggregates data from:

  • ~/.openclaw/workspace/memory/*.md: Your daily workspace logs and task files.
  • On-the-fly additions created using the CLI add command.

Semantic Memory Advanced Features

  • Cron Automation: Set up hands-free nightly rebuilding of your semantic indexes (e.g., 0 4 * * * python3 ~/.openclaw/semantic-memory/semantic_memory.py index).
  • Subprocess Integration: Easily interface with Semantic Memory from other custom Openclaw Skills to pull context in active script sessions.
  • Graceful Fallbacks: Features a robust backup mechanism that automatically reverts to traditional string matches if the Gemini API service is unreachable.
  • Direct Injection: Programmatically push new memories directly into the ChromaDB vector store using simple terminal commands without having to write separate files.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*