evrmem
by @zhzgao
Local Chinese semantic memory search and storage using text2vec embeddings and ChromaDB, supporting RAG-based context augmentation for AI agents.
clawhub install evrmemπ About This Skill
evrmem Skill
Name
evrmem
Description
Local Chinese Vector Memory System. Provides semantic memory search and storage for AI agents using local Chinese embedding models (text2vec) and ChromaDB. Supports RAG-based context augmentation.
When to Use
Use this skill when the user asks to:
Prerequisites
Install evrmem and initialize:
pip install evrmem
evrmem init
For China users (mirror):
set HF_ENDPOINT=https://hf-mirror.com # Windows
or
export HF_ENDPOINT=https://hf-mirror.com # Linux/Mac
evrmem init
Core Workflow
1. Semantic Search (Most Common)
from qmd.core.vector_db import vector_dbresults = vector_db.search("React form warning", top_k=5)
for r in results:
print(f"[{r['distance']:.3f}] {r['content'][:80]}")
Or via CLI:
evrmem search "React form warning"
evrmem search "deployment issue" --project myproject
2. Add Memory
memory_id = vector_db.add_memory(
"React StrictMode causes Form.useForm warning",
metadata={"project": "mes-demo", "tags": "react,antd"}
)
Or via CLI:
evrmem add "Important finding about X" --project myproject --tags react,bug
3. Structured Query
# Query by project
evrmem query --project mes-demoQuery by tag
evrmem query --tag reactList all projects
evrmem query --list-projectsList all tags
evrmem query --list-tags
4. RAG Retrieval
result = vector_db.rag("how to fix the form warning", top_k=3)
print(result["context"])
Or via CLI:
evrmem rag "how to fix the form warning"
evrmem rag "how to fix the form warning" --prompt
5. Statistics
evrmem stats
Configuration
Create ~/.evrmem/config.yaml:
vector_db:
persist_directory: "~/.evrmem/data/qmd_memory"embedding:
model_name: "shibing624/text2vec-base-chinese"
device: "cpu" # or "cuda"
cache_folder: "~/.evrmem/models"
rag:
top_k: 5
min_similarity: 0.5
logging:
level: "WARNING"
Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| EVREM_DATA_DIR | Data directory | ~/.evrmem/data/qmd_memory |
| EVREM_MODEL_NAME | HuggingFace model name | shibing624/text2vec-base-chinese |
| EVREM_LOCAL_MODEL | Local model path (highest priority) | - |
| EVREM_DEVICE | Device for inference | cpu |
| EVREM_TOP_K | Default retrieval count | 5 |
| EVREM_MIN_SIM | Minimum similarity threshold | 0.5 |
| EVREM_LOG_LEVEL | Logging level | WARNING |
| EVREM_LOCAL_FILES_ONLY | Disable network access | false |
| HF_ENDPOINT | HuggingFace mirror endpoint | - |
Response Format
When reporting search results, use this format:
## evrmem Search ResultsQuery: "user query"
Results: N memories found
| Score | Project | Content |
|-------|---------|---------|
| 0.723 | mes-demo | React StrictMode causes Form.useForm warning... |
| 0.681 | docs | Deployment script timeout issue... |
Top Match
Project: mes-demo | Tags: react,antd> React StrictMode causes Form.useForm warning...
When adding memory:
## Memory SavedID: abc123
Project: mes-demo
Tags: react
Content: React StrictMode causes Form.useForm warning...
Use evrmem search "React StrictMode" to retrieve later.
Installation for Agent
If evrmem is not installed:
import subprocess
subprocess.run(["pip", "install", "evrmem"], check=True)
Initialize on first use (downloads ~400MB model)
subprocess.run(["evrmem", "init"], check=True)
For China users, set mirror before init:
import os
os.environ["HF_ENDPOINT"] = "https://hf-mirror.com"
subprocess.run(["evrmem", "init"], check=True)
Edge Cases
HF_ENDPOINT=https://hf-mirror.com before evrmem initpip install "numpy<2" --force-reinstall~/.evrmem/models to offline machine, set EVREM_LOCAL_FILES_ONLY=trueevrmem query --list-projects--top-k or lower EVREM_MIN_SIM thresholdEVREM_DEVICE=cuda if GPU availableβ‘ When to Use
βοΈ Configuration
Create ~/.evrmem/config.yaml:
vector_db:
persist_directory: "~/.evrmem/data/qmd_memory"embedding:
model_name: "shibing624/text2vec-base-chinese"
device: "cpu" # or "cuda"
cache_folder: "~/.evrmem/models"
rag:
top_k: 5
min_similarity: 0.5
logging:
level: "WARNING"