vector-memory
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVector Memory Skill
Vector Memory Skill
This skill provides vector-based semantic memory storage using embeddings for intelligent recall by meaning.
该技能通过嵌入技术提供基于向量的语义记忆存储,实现基于语义的智能召回。
When to Use
适用场景
- You need semantic search (find memories by meaning, not keywords)
- You want to retrieve similar documents or conversations
- You're building an agent that needs context-aware memory
- You need to cluster or group related memories
- 需要语义搜索(按语义而非关键词查找记忆)
- 希望检索相似文档或对话
- 正在构建具备上下文感知记忆的Agent
- 需要对相关记忆进行聚类或分组
Capabilities
功能特性
- vstore: Store text with automatic embedding generation
- vsearch: Search memories by semantic similarity
- vdelete: Remove a memory by ID
- vlist: List all stored memories
- vsimilar: Find memories similar to a given ID
- vclear: Clear all memories
- vstore:存储文本并自动生成嵌入向量
- vsearch:按语义相似度搜索记忆
- vdelete:通过ID删除记忆
- vlist:列出所有已存储的记忆
- vsimilar:查找与指定ID相似的记忆
- vclear:清空所有记忆
How It Works
工作原理
- Text is converted to embeddings using OpenAI's API
- Embeddings are stored in JSON with metadata
- Search uses cosine similarity to find semantically related memories
- No external vector database required - pure JSON storage
- 通过OpenAI API将文本转换为嵌入向量
- 嵌入向量与元数据一起存储在JSON中
- 搜索通过余弦相似度查找语义相关的记忆
- 无需外部向量数据库,采用纯JSON存储
Environment Variables
环境变量
Required:
- - For generating embeddings
OPENAI_API_KEY
Optional:
- - Embedding dimensions (default: 1536 for text-embedding-ada-002)
VECTOR_MEMORY_DIM
必填项:
- - 用于生成嵌入向量
OPENAI_API_KEY
可选项:
- - 嵌入向量维度(默认:text-embedding-ada-002模型为1536)
VECTOR_MEMORY_DIM
Usage Examples
使用示例
javascript
// Store a memory with semantic embedding
vstore('Meeting notes: Discussed Q1 roadmap and budget allocation')
// Returns: "Stored memory with ID: mem_abc123"
// Search by meaning (not keywords)
vsearch('What did we talk about regarding money?')
// Returns: Memories about budget, funding, financial discussions
// Find similar memories
vsimilar('mem_abc123')
// Returns: Semantically similar memories
// List all memories
vlist()
// Returns: List of stored memories with metadata
// Clear all
vclear()
// Returns: "Cleared all vector memories"javascript
// 存储带有语义嵌入的记忆
vstore('Meeting notes: Discussed Q1 roadmap and budget allocation')
// 返回:"已存储记忆,ID: mem_abc123"
// 按语义搜索(而非关键词)
vsearch('What did we talk about regarding money?')
// 返回:与预算、资金、财务讨论相关的记忆
// 查找相似记忆
vsimilar('mem_abc123')
// 返回:语义相似的记忆
// 列出所有记忆
vlist()
// 返回:包含元数据的已存储记忆列表
// 清空所有记忆
vclear()
// 返回:"已清空所有向量记忆"Features
特性
- Semantic search:Find by meaning, not keywords
- Similarity scoring: Results ranked by relevance score
- Automatic embeddings: No manual vector generation needed
- Metadata support: Store timestamps and tags with memories
- Pure JSON: No external database dependencies
- 语义搜索:按语义而非关键词查找
- 相似度评分:结果按相关度评分排序
- 自动嵌入:无需手动生成向量
- 元数据支持:可随记忆存储时间戳和标签
- 纯JSON存储:无外部数据库依赖