Single-file AI memory with memvid-cli for persistent knowledge storage and retrieval using text-embedding-3-large (3072 dimensions). Use when storing learnings, searching past context, managing session memory, or implementing long-term memory for AI agents. Triggers include "remember", "recall", "search memory", "store this", "what did we learn", or any task requiring persistent memory across sessions.
Ships in data. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Organized interface for memvid-cli - single-file AI memory with hybrid search, entity extraction, and persistent storage.
What is Memvid?
.mv2 file containing all data, indexes, and embeddingsMemory File Location:
./memory.mv2 (project root, same level as .git)
Embedding Model:
text-embedding-3-large (3072 dimensions) via -m openai-large
OPENAI_API_KEY is automatically loaded from .mcp-credentials.json via:
source ~/.config/opencode/scripts/load-mcp-credentials-safe.sh
This happens automatically in OpenCode workflows.
Semantic Search (uses embeddings):
memvid find ./memory.mv2 --query "your search query" --mode sem --top-k 10 -m openai-large
Lexical Search (keyword-based, fast):
memvid find ./memory.mv2 --query "exact keywords" --mode lex --top-k 10
Auto Mode (automatic selection):
memvid find ./memory.mv2 --query "your query" --mode auto --top-k 10
Search Modes:
--mode sem: Vector/semantic search (meaning-based)--mode lex: BM25 lexical search (keyword-based)--mode auto: Automatic selectionWith Embeddings (recommended):
echo '{"title":"Topic Name","label":"procedure","text":"Full description of what was learned"}' | memvid put ./memory.mv2 --embedding -m openai-large
Quick Text (with label):
echo "Key insight about topic" | memvid put ./memory.mv2 --label fact --embedding -m openai-large
From File:
memvid put ./memory.mv2 --input document.pdf --embedding -m openai-large
Labels (use Graphiti convention):
procedure: Workflows and multi-step processespreference: Coding patterns and preferencesfact: Key insights, gotchas, important detailsCheck entity state (O(1) lookup via Memory Cards):
memvid state ./memory.mv2 "EntityName"
Returns structured facts about the entity (employer, role, relationships, etc.).
memvid stats ./memory.mv2
Shows:
memvid ask ./memory.mv2 --question "What did we decide about authentication?" --use-model openai
Returns sourced answers with citations.
memvid timeline ./memory.mv2
View chronological history of stored memories.
Search for relevant context:
source ~/.config/opencode/scripts/load-mcp-credentials-safe.sh
memvid find ./memory.mv2 --query "[task description]" --mode sem --top-k 10 -m openai-large
Store learnings:
source ~/.config/opencode/scripts/load-mcp-credentials-safe.sh
echo '{"title":"[Topic]","label":"procedure","text":"[What was learned]"}' | memvid put ./memory.mv2 --embedding -m openai-large
After 2 failed fixes, search for similar past issues:
memvid find ./memory.mv2 --query "error debugging failed fix" --mode sem --top-k 5 -m openai-large
When to Store:
When to Skip:
Storage Optimization:
# Vector compression (16x storage savings)
memvid put ./memory.mv2 --input file.pdf --embedding --vector-compression -m openai-large
# Extract entities and relationships
memvid enrich ./memory.mv2 --engine rules
Creates Memory Cards for O(1) entity lookups.
# Start recording session
memvid session start ./memory.mv2 --name "task-name"
# End session
memvid session end ./memory.mv2
# Replay with different parameters
memvid session replay ./memory.mv2 --session abc123 --top-k 10
# Rebuild indexes and reclaim space
memvid doctor ./memory.mv2 --vacuum --rebuild-time-index --rebuild-lex-index
# Store research findings
echo '{"title":"API Authentication Research","label":"procedure","text":"Investigated JWT vs OAuth. Chose JWT for stateless microservices. Refresh token stored in httpOnly cookie, access token in memory. 15min expiry."}' | memvid put ./memory.mv2 --embedding -m openai-large
# Document bug fix
echo '{"title":"React Hydration Error Fix","label":"fact","text":"Hydration errors caused by useLayoutEffect on SSR. Solution: use useEffect or check typeof window !== undefined before DOM access."}' | memvid put ./memory.mv2 --embedding -m openai-large
# Store decision
echo '{"title":"Database Choice Decision","label":"preference","text":"Chose PostgreSQL over MongoDB for e-commerce. Strong ACID guarantees needed for transactions. Referential integrity critical for orders/inventory."}' | memvid put ./memory.mv2 --embedding -m openai-large
# Search for past decisions
memvid find ./memory.mv2 --query "why did we choose postgresql database" --mode sem --top-k 5 -m openai-large
Error: Lock failure
Error: OPENAI_API_KEY not found
source ~/.config/opencode/scripts/load-mcp-credentials-safe.shError: Capacity exceeded
--vector-compression or upgrade planWarning: Uncompressed vectors
--vector-compression flag (16x smaller)--mode lex)--mode sem)--vector-compression)memvid doctor monthly)Tier 1 (<30 lines):
Tier 2 (30-100 lines):
Tier 3 (100+ lines):
Tier 4 (Critical/Deployment):
| Task | Command |
|---|---|
| Search semantically | memvid find memory.mv2 --query "X" --mode sem --top-k 10 -m openai-large |
| Search keywords | memvid find memory.mv2 --query "X" --mode lex --top-k 10 |
| Store with embedding | echo '{"title":"X","label":"Y","text":"Z"}' | memvid put memory.mv2 --embedding -m openai-large |
| Entity lookup | memvid state memory.mv2 "EntityName" |
| Ask question | memvid ask memory.mv2 --question "X" --use-model openai |
| Check stats | memvid stats memory.mv2 |
| View timeline | memvid timeline memory.mv2 |
| Enrich entities | memvid enrich memory.mv2 --engine rules |
| Maintenance | memvid doctor memory.mv2 --vacuum --rebuild-time-index |
./memory.mv2 (same level as .git)-m openai-large maps to text-embedding-3-large (3072 dimensions)memory.mv2 to .gitignore to keep learnings local--vector-compression to fit ~3000 documents in 50MBWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/data:memvidfrom data
npx claudepluginhub dxta/claude-code-skills --plugin data2 skills in this plugin