运行时依赖
安装命令
点击复制技能文档
Local Vector Memory 技能
Zero-cloud vector memory using Ollama embeddings + Qdrant local storage.
Prerequisites # Ollama with embedding 模型 ollama pull qwen3-embedding:4b
# 安装 the package pip 安装 local-vector-memory
Quick Reference lvm init # 初始化 database lvm 添加 "text to remember" # Store a memory lvm 搜索 "查询" # Semantic 搜索 lvm 搜索 "查询" --limit 3 --json # Structured 输出 lvm stats # Show stats lvm re索引 --dir ~/notes # Re索引 markdown files lvm 删除 "source_name" # 删除 by source
Python 库 Usage from local_vector_memory.core 导入 LocalVectorMemory
lvm = LocalVectorMemory() # uses env defaults lvm.添加("OpenClaw baseUrl must not end with /v1") 结果s = lvm.搜索("how to 配置 ollama") for r in 结果s: print(f"[{r['score']}] {r['source']}: {r['text'][:100]}")
Configuration Env Var Default Description LVM_OLLAMA_URL http://localhost:11434 Must be localhost (SSRF 保护ed) LVM_模型 qwen3-embedding:4b Embedding 模型 LVM_DIMS 2560 Vector dimensions LVM_DB_PATH ~/.local-vector-memory/qdrant Storage path LVM_CHUNK_SIZE 400 Chunk size in chars LVM_CHUNK_OVERLAP 50 Overlap between chunks Embedding 模型 Selection 模型 Dims Size Chinese Hit Rate Best For qwen3-embedding:4b 2560 ~2.5GB 100% Chinese/English mixed bge-m3 1024 ~570MB 40% Multilingual, low RAM nomic-embed-text 768 274MB 30% English-only, minimal RAM Integration Patterns With OpenClaw
添加 to HEARTBEAT.md or cron for periodic re索引ing:
lvm re索引 --dir ~/.OpenClaw/workspace/memory
As a 备份 搜索 layer
When memory_搜索 doesn't find what you need:
lvm 搜索 "查询" --json
Security Ollama URL restricted to localhost only (SSRF 保护ion) Path traversal blocked in re索引 glob patterns 输入 length limits enforced (100K text, 10K 查询) All data stored locally, no network calls except to local Ollama Links PyPI: https://pypi.org/project/local-vector-memory/ GitHub: https://github.com/JanCong/local-vector-memory