Search your memories by meaning, not keywords. Uses vector embeddings to find relevant information even when you don't remember the exact words.
Built on ChromaDB for fast, private, local vector search.
# Index existing memories
python3 ~/.openclaw/semantic-memory/semantic_memory.py index
# Index all memory files (run after installing or to refresh)
python3 ~/.openclaw/semantic-memory/semantic_memory.py index
# Search memories by meaning
python3 ~/.openclaw/semantic-memory/semantic_memory.py search "what did we decide about the trading bot"
# Add a new memory
python3 ~/.openclaw/semantic-memory/semantic_memory.py add "Remember to check the OANDA bot logs daily"
# Show stats
python3 ~/.openclaw/semantic-memory/semantic_memory.py stats
.md files from ~/.openclaw/workspace/memory/, generates vector embeddings via Gemini API, stores in ChromaDBQuery: "GBP USD trades"
Results: Only exact matches for "GBP USD"
Query: "What pairs did we trade on OANDA?"
Results: Finds GBP/USD, EUR/USD, USD/JPY etc. even without exact phrase match
pip install chromadb)~/.openclaw/credentials/gemini.json as {"api_key": "YOUR_KEY"}Without Gemini key, uses simple text search as fallback.
Automatically indexes:
~/.openclaw/workspace/memory/*.md — Daily memory filesadd command~/.openclaw/semantic-memory/
├── semantic_memory.py # Main script
├── memory.log # Log file
└── data/ # ChromaDB storage
Add to cron for automatic indexing:
# Re-index daily at 4am
0 4 * * * python3 ~/.openclaw/semantic-memory/semantic_memory.py index
Or call from other skills to search memories:
import subprocess
result = subprocess.run(
['python3', '/home/umbrel/.openclaw/semantic-memory/semantic_memory.py',
'search', 'trading decisions'],
capture_output=True, text=True
)
Regular search: "找 exactly this word"
Semantic search: "找 this meaning"
Even if I don't remember "OANDA bot flip setting", I might find "bot was losing because FLIP was disabled" — semantic search bridges that gap.
chromadb — Vector database (installed with pip)gemini API key — For embeddings (optional)共 1 个版本