Memory Semantic Search
Standalone semantic search over workspace .md files. Uses an OpenAI-compatible embedding API and SQLite for vector storage. No external dependencies beyond Python 3 stdlib + the embedding API.
Setup
Set these environment variables (or pass as CLI args):
export EMBEDDING_API_KEY="sk-xxx"
export EMBEDDING_API_BASE="https://api.openai.com/v1" # any OpenAI-compatible endpoint
export EMBEDDING_MODEL="text-embedding-3-small" # optional, this is the default
Usage
Index workspace
python3 scripts/index.py /path/to/workspace
Options:
--force— full reindex (clear existing data)--db PATH— custom SQLite path (default:memory_search.sqlitein skill dir)--api-base,--api-key,--model— override env vars
Incremental: only new/changed chunks are embedded. Deleted files are cleaned up automatically.
Search
python3 scripts/search.py "your query here"
Options:
--top-k N— number of results (default: 5)--min-score F— minimum cosine similarity threshold (default: 0.3)--json— output as JSON--db,--api-base,--api-key,--model— same as index
Typical agent workflow
- Run
index.pyon the workspace (once, or after file changes) - Run
search.py "query"to find relevant snippets - Use
readtool to load full context from the returned file paths and line numbers
