← 返回
未分类 中文

Local Vector Memory

Store, search, and manage local vector memories using Ollama embeddings with Qdrant, supporting Chinese and English text without cloud dependencies.
使用 Ollama 嵌入配合 Qdrant,实现本地向量记忆的存储、搜索与管理,支持中英文文本,无云端依赖。
jancong jancong 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 340
下载
💾 1
安装
1
版本
#latest

概述

Local Vector Memory Skill

Zero-cloud vector memory using Ollama embeddings + Qdrant local storage.

Prerequisites

# Ollama with embedding model
ollama pull qwen3-embedding:4b

# Install the package
pip install local-vector-memory

Quick Reference

lvm init                    # Initialize database
lvm add "text to remember"  # Store a memory
lvm search "query"          # Semantic search
lvm search "query" --limit 3 --json  # Structured output
lvm stats                   # Show stats
lvm reindex --dir ~/notes   # Reindex markdown files
lvm delete "source_name"    # Delete by source

Python Library Usage

from local_vector_memory.core import LocalVectorMemory

lvm = LocalVectorMemory()  # uses env defaults
lvm.add("OpenClaw baseUrl must not end with /v1")
results = lvm.search("how to configure ollama")
for r in results:
    print(f"[{r['score']}] {r['source']}: {r['text'][:100]}")

Configuration

Env VarDefaultDescription
-------------------------------
LVM_OLLAMA_URLhttp://localhost:11434Must be localhost (SSRF protected)
LVM_MODELqwen3-embedding:4bEmbedding model
LVM_DIMS2560Vector dimensions
LVM_DB_PATH~/.local-vector-memory/qdrantStorage path
LVM_CHUNK_SIZE400Chunk size in chars
LVM_CHUNK_OVERLAP50Overlap between chunks

Embedding Model Selection

ModelDimsSizeChinese Hit RateBest For
----------------------------------------------
qwen3-embedding:4b2560~2.5GB100%Chinese/English mixed
bge-m31024~570MB40%Multilingual, low RAM
nomic-embed-text768274MB30%English-only, minimal RAM

Integration Patterns

With OpenClaw

Add to HEARTBEAT.md or cron for periodic reindexing:

lvm reindex --dir ~/.openclaw/workspace/memory

As a backup search layer

When memory_search doesn't find what you need:

lvm search "query" --json

Security

  • Ollama URL restricted to localhost only (SSRF protection)
  • Path traversal blocked in reindex glob patterns
  • Input length limits enforced (100K text, 10K query)
  • 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

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 14:35 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

design-media

GPT Image 2 API

jancong
通过OpenAI gpt-image-2模型生成和编辑图片。通用CLI,支持任意AI代理(Hermes、Claude Code、Codex、OpenClaw等)。
★ 0 📥 567
ai-agent

Agent Browser

rez0
用于 AI 代理的浏览器自动化 CLI。当用户需要与网站交互(包括浏览页面、填写表单、点击按钮、截图等)时使用。
★ 866 📥 347,035
ai-agent

self-improving agent

pskoett
记录自身发现以实现自我改进的技能
★ 4,166 📥 939,540