mcpField
L
local-memory-search

local-memory-search

github.com/blackbasiliskAgent workflows073 installsUpdated 38w ago
Repository

About local-memory-search

An offline semantic search skill for OpenClaw memory files. It indexes local Markdown files with either LSA or sentence-transformers and can locate matching passages in their source files.

Key features

  1. 01Index MEMORY.md and memory/*.md locally
  2. 02Use LSA or sentence-transformers backends
  3. 03Search memory passages by query
  4. 04Show source files, line numbers, and context

Use cases

  1. 01Find configuration details in OpenClaw memory offline
  2. 02Locate matching passages and verify their source lines
  3. 03Refresh the search index after editing memory files

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/blackbasilisk/local-memory-search --skill local-memory-search

After installing, type/local-memory-searchin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

LICENSE
README.md
.gitignore
scripts/
jump_memory.py
index_memory.py
requirements-fastembed.txt
embed_backends.py
requirements-sentence-transformers.txt
requirements-core.txt
requirements-lsa.txt
requirements.txt
search_memory.py

Details

From the project README

Local Memory Search (offline)

This skill adds a local semantic search workflow for OpenClaw memory files:

  • MEMORY.md
  • memory/*.md

It builds a local vector index (FAISS) using a small sentence-transformers embedding model.

Requirements

  • Python 3.10+ in PATH (python --version)

Choose your backend (user choice)

A) Light (recommended): lsa (TF‑IDF + SVD)
  • No neural model
  • No HuggingFace downloads
  • Good “semantic-ish” matching (better than plain keyword search)
cd $env:USERPROFILE\.openclaw\workspace\skills\local-memory-search
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -U pip
.\.venv\Scripts\python.exe -m pip install -r .\scripts\requirements-lsa.txt
B) Heavy (best semantic): sentence-transformers (Torch)
  • True neural embeddings
  • Bigger install (torch) + model download
cd $env:USERPROFILE\.openclaw\workspace\skills\local-memory-search
python -m venv .venv
.\.venv\Scripts\python.exe -m pip install -U pip
.\.venv\Scripts\python.exe -m pip install -r .\scripts\requirements-sentence-transformers.txt

Build / refresh the index

Default (light LSA backend):

.\.venv\Scripts\python.exe .\scripts\index_memory.py --workspace "$env:USERPROFILE\.openclaw\workspace" --backend lsa

Heavy backend example:

.\.venv\Scripts\python.exe .\scripts\index_memory.py --workspace "$env:USERPROFILE\.openclaw\workspace" --backend sentence-transformers --model "sentence-transformers/all-MiniLM-L6-v2"

Default workflow: jump + quote (recommended)

This matches the recommended operational pattern:

  1. semantic jump to the best chunk
  2. open the source file
  3. print exact lines (with a little context)
# Minimal output (default): prints just the best-matching lines
.\.venv\Scripts\python.exe .\scripts\jump_memory.py --query "o365 timezone config" --top 1

# If you want provenance:
.\.venv\Scripts\python.exe .\scripts\jump_memory.py --query "o365 timezone config" --top 1 --show-source --show-line-numbers --context 2

Tip: for cleaner quotes, re-index with default overlap 0 (the default).

Search (semantic only)

.\.venv\Scripts\python.exe .\scripts\search_memory.py --query "o365 timezone config" --top 5

If your index was built with a different backend/model, search_memory.py will automatically use the index metadata. You can override:

.\.venv\Scripts\python.exe .\scripts\search_memory.py --backend fastembed --model "BAAI/bge-small-en-v1.5" --query "..."

Notes

  • Index is stored under: ~/.openclaw/credentials/local-memory-search/
  • Re-run indexing after you edit memory files.
  • This is a local alternative to OpenClaw's built-in memory_search tool.

Comments

Markdown supported