enhanced-memoryEnhanced memory search with hybrid vector+keyword scoring, temporal routing, filepath scoring, adaptive weighting, pseudo-relevance feedback, salience scoring, and knowledge graph cross-references. Replaces the default memory search with a 4-signal fusion retrieval system. Use when searching memories, indexing memory files, building cross-references, or scoring memory salience. Requires Ollama with nomic-embed-text model.
Install via ClawdBot CLI:
clawdbot install JamesEBall/enhanced-memoryDrop-in enhancement for OpenClaw's memory system. Replaces flat vector search with a 4-signal hybrid retrieval pipeline that achieved 0.782 MRR (vs ~0.45 baseline vector-only).
# Install Ollama and pull the embedding model
ollama pull nomic-embed-text
# Index your memory files (run from workspace root)
python3 skills/enhanced-memory/scripts/embed_memories.py
# Optional: build cross-reference graph
python3 skills/enhanced-memory/scripts/crossref_memories.py build
Re-run embed_memories.py whenever memory files change significantly.
scripts/search_memory.py β Primary SearchHybrid 4-signal retrieval with automatic adaptation:
python3 skills/enhanced-memory/scripts/search_memory.py "query" [top_n]
Signals fused:
Automatic behaviors:
scripts/enhanced_memory_search.py β JSON-Compatible SearchSame pipeline with JSON output format compatible with OpenClaw's memory_search tool:
python3 skills/enhanced-memory/scripts/enhanced_memory_search.py --json "query"
Returns {results: [{path, startLine, endLine, score, snippet, header}], ...}.
scripts/embed_memories.py β IndexingChunks all .md files in memory/ plus core workspace files (MEMORY.md, AGENTS.md, etc.) by markdown headers and embeds them:
python3 skills/enhanced-memory/scripts/embed_memories.py
Outputs memory/vectors.json. Batches embeddings in groups of 20, truncates chunks to 2000 chars.
scripts/memory_salience.py β Salience ScoringSurfaces stale/important memory items for heartbeat self-prompting:
python3 skills/enhanced-memory/scripts/memory_salience.py # Human-readable prompts
python3 skills/enhanced-memory/scripts/memory_salience.py --json # Programmatic output
python3 skills/enhanced-memory/scripts/memory_salience.py --top 5 # More items
Scores importance Γ staleness considering: file type (topic > core > daily), size, access frequency, and query gap correlation.
scripts/crossref_memories.py β Knowledge GraphBuilds cross-reference links between memory chunks using embedding similarity:
python3 skills/enhanced-memory/scripts/crossref_memories.py build # Build index
python3 skills/enhanced-memory/scripts/crossref_memories.py show <file> # Show refs for file
python3 skills/enhanced-memory/scripts/crossref_memories.py graph # Graph statistics
Uses file-representative approach (top 5 chunks per file) to reduce O(nΒ²) to manageable comparisons. Threshold: 0.75 cosine similarity.
All tunable constants are at the top of each script. Key parameters:
| Parameter | Default | Script | Purpose |
|-----------|---------|--------|---------|
| VECTOR_WEIGHT | 0.4 | search_memory.py | Weight for vector similarity |
| KEYWORD_WEIGHT | 0.25 | search_memory.py | Weight for keyword overlap |
| FILEPATH_WEIGHT | 0.25 | search_memory.py | Weight for filepath matching |
| TEMPORAL_BOOST | 3.0 | search_memory.py | Multiplier for date-matching files |
| PRF_THRESHOLD | 0.45 | search_memory.py | Score below which PRF activates |
| SIMILARITY_THRESHOLD | 0.75 | crossref_memories.py | Min similarity for cross-ref links |
| MODEL | nomic-embed-text | all | Ollama embedding model |
To use a different embedding model (e.g., mxbai-embed-large), change MODEL in each script and re-run embed_memories.py.
To replace the default memory search, point your agent's search tool at these scripts. The scripts expect:
memory/ directory relative to workspace root containing .md filesmemory/vectors.json (created by embed_memories.py)All scripts use only Python stdlib + Ollama HTTP API. No pip dependencies.
AI Usage Analysis
Analysis is being generated⦠refresh in a few seconds.
Captures learnings, errors, and corrections to enable continuous improvement. Use when: (1) A command or operation fails unexpectedly, (2) User corrects Clau...
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
Search and analyze your own session logs (older/parent conversations) using jq.
Typed knowledge graph for structured agent memory and composable skills. Use when creating/querying entities (Person, Project, Task, Event, Document), linking related objects, enforcing constraints, planning multi-step actions as graph transformations, or when skills need to share state. Trigger on "remember", "what do I know about", "link X to Y", "show dependencies", entity CRUD, or cross-skill data access.
Ultimate AI agent memory system for Cursor, Claude, ChatGPT & Copilot. WAL protocol + vector search + git-notes + cloud backup. Never lose context again. Vibe-coding ready.
Headless browser automation CLI optimized for AI agents with accessibility tree snapshots and ref-based element selection