Install
openclaw skills install @ryantoleco/seem-skillAdvanced episodic memory system for multi-turn conversations. Store and retrieve structured conversation memories with fact graph, PPR retrieval, and three recall modes (Lite/Pro/Max). Supports hybrid retrieval (dense + sparse), dynamic memory integration, and fact deduplication.
openclaw skills install @ryantoleco/seem-skillStructured Episodic & Entity Memory for multi-turn conversations.
from seem_skill import SEEMSkill, SEEMConfig, RecallMode
config = SEEMConfig()
skill = SEEMSkill(config)
# Store conversation
memory_id = skill.store({
"text": "Lena asked about Scottish Terriers",
"speaker": "Alice"
})
# Recall (default: LITE mode — facts + episodic memory, no raw chunks)
result = skill.recall({"text": "What did Lena ask?"}, top_k=3)
# result = {"memories": [...], "facts": [...]}
# Recall with raw chunks
result = skill.recall({"text": "What did Lena ask?"}, mode=RecallMode.PRO)
# Recall with backfill
result = skill.recall({"text": "What did Lena ask?"}, mode=RecallMode.MAX)
| Mode | Facts | Episodic Memory | Raw Chunks | Backfill |
|---|---|---|---|---|
| Lite (default) | ✅ | ✅ (summary + events) | ❌ | ❌ |
| Pro | ✅ | ✅ | ✅ (top_k) | ❌ |
| Max | ✅ | ✅ | ✅ (top_k + backfill ≤ 2×top_k) | ✅ |
| Strategy | Method | Best For |
|---|---|---|
| DPR | Dense vector similarity | Simple keyword-matching queries |
| Hybrid RRF | Dense + BM25 sparse fusion | Mixed keyword + semantic queries |
| PPR | Personalized PageRank over knowledge graph | Multi-hop, entity-rich queries |
Default strategy is configured in config.py (currently ppr).
export LLM_API_KEY="sk-xxx"
export LLM_BASE_URL="https://api.deepseek.com"
export LLM_MODEL="deepseek-chat"
export MM_ENCODER_API_KEY="sk-xxx"
export MM_ENCODER_BASE_URL="https://api.siliconflow.cn/v1"
export MM_ENCODER_MODEL="Qwen/Qwen3-Embedding-8B"
All default settings are centralized in seem_skill/config.py:
LLM_CONFIG = {
"base_url": "https://api.deepseek.com",
"model": "deepseek-chat",
}
EMBEDDING_CONFIG = {
"base_url": "https://api.siliconflow.cn/v1",
"model": "Qwen/Qwen3-Embedding-8B",
}
Override defaults programmatically:
config = SEEMConfig(
llm_api_key="your-key",
llm_model="custom-model",
retrieve_strategy=RetrieveStrategy.PPR,
top_k_facts=10,
ppr_damping=0.6,
)
| Parameter | Default | Description |
|---|---|---|
retrieve_strategy | hybrid_rrf | DPR / Hybrid RRF / PPR |
top_k_chunks | 3 | Number of chunks to retrieve |
top_k_facts | 5 | Number of fact triples to retrieve |
top_k_candidates | 3 | Integration candidate count |
rrf_rank_constant | 30 | RRF smoothing constant |
ppr_damping | 0.5 | PPR teleport probability |
backfill_chunks | 5 | Max additional chunks per backfill |
enable_fact_graph | True | Build fact graph on store |
entity_similarity_threshold | 0.9 | Entity linking threshold |
enable_integration | True | Dynamic memory integration |
integration_window | 3 | Batch size for deferred integration |
python scripts/cli_memory.py store --text "Your message" --speaker user
python scripts/cli_memory.py store --dialogue-id "D1:1" --speaker "Alice" --text "Message"
python scripts/cli_memory.py recall --query "Your query" --mode lite
python scripts/cli_memory.py recall --query "Your query" --mode pro --strategy ppr --top-k 5
python scripts/cli_memory.py recall --query "Your query" --mode max --top-k-facts 10
python scripts/cli_memory.py facts # Show all fact triples
python scripts/cli_memory.py facts --entity 小米 # Filter by entity
python scripts/cli_memory.py display
python scripts/cli_memory.py display --dialogue-id "D1:1"
python scripts/cli_memory.py view
python scripts/cli_memory.py stats
python scripts/cli_memory.py clear --yes
Store Pipeline:
Recall Pipeline:
Graph Structure (NetworkX DiGraph):
entity, chunkentity_chunk (entity → chunk), fact (entity ↔ entity), synonymy (entity ↔ entity)SEEM/
├── SKILL.md # This file
├── README.md # Quick reference
├── config.py # Unified configuration (LLM + Embedding)
├── requirements.txt # Python dependencies
├── __init__.py # Package entry point
├── core/
│ ├── __init__.py
│ ├── seem_skill.py # Core implementation (SEEMSkill class)
│ ├── schema.py # Data structures (SEEMConfig, RecallMode, etc.)
│ ├── prompts.py # LLM prompts
│ └── utils.py # LLM client, embedding, BM25, cache
├── scripts/
│ └── cli_memory.py # CLI: store, recall, facts, display, view, stats, clear
├── data/ # Persistent storage (auto-created)
└── tests/
openai>=1.0.0 — LLM and embedding API clientnumpy>=1.21.0 — Vector operationsnetworkx>=3.0 — Knowledge graph, PPR, connected componentsscipy>=1.0 — Required by nx.pagerank()rank-bm25>=0.2.2 — BM25 sparse retrievalnltk>=3.8.0 — TokenizationError: Missing API keys
Set environment variables or update config.py:
export LLM_API_KEY="sk-xxx"
export MM_ENCODER_API_KEY="sk-xxx"
ModuleNotFoundError: No module named 'scipy'
pip install scipy networkx