据 AlphaMoat 统计,截至 2026-10,Lancedb Memory 累计下载 11,542 次、获 7 个星标,按累计下载量在本次参与排名的 10,914 个 AI 技能中排名第 2,383 位,在「AI 智能体」分类(1,632 个)中排名第 321 位。
列表默认按累计下载量排序,也可按星标排序;详情页排名按累计下载量计算。
| 平台 | 累计下载 | 星标 | 评论 |
|---|---|---|---|
| ClawHub ↗ | 6,685 | 7 | - |
| SkillHub ↗ | 1.2万 | 7 | — |
各平台的计数口径不同,统计时间不一致。
示例包含内容、分类、标签、重要性和元数据的保存、查询、更新、删除及统计。依赖 Python 与 LanceDB,并使用本地存储路径。语义检索调用的向量与嵌入配置仍需验证;敏感内容的同意、脱敏、保留和加密控制需额外实现,不能把示例视为已验证的完整记忆系统。
资料发布于 2026-10-27
以下是根据技能文档生成的示例,不代表实际运行结果。
2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。
| 月份 | 累计下载 | 环比 | 星标 |
|---|---|---|---|
| 2026-10 | 1.2万 | — | 7 |
| 2026-09 | 7,323 | — | 7 |
| 2026-08 | 6,647 | +2.5% | 7 |
| 2026-07 | 6,482 | +4.6% | 7 |
| 2026-06 | 6,198 | +3.6% | 7 |
| 2026-05 | 5,984 | — | 7 |
| 2026-03 | 5,234 | — | 7 |
以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。
#!/usr/bin/env python3 """ LanceDB integration for long-term memory management. Provides vector search and semantic memory capabilities. """ import os import json import lancedb from datetime import datetime
from typing import List, Dict, Any, Optional
from pathlib import Path
class LanceMemoryDB:
"""LanceDB wrapper for long-term memory storage and retrieval."""
def __init__(self, db_path: str = "/Users/prerak/clawd/memory/lancedb"):
self.db_path = Path(db_path)
self.db_path.mkdir(parents=True, exist_ok=True)
self.db = lancedb.connect(self.db_path)
# Ensure memory table exists
if "memory" not in self.db.table_names():
self._create_memory_table()
def _create_memory_table(self):
"""Create the memory table with appropriate schema."""
schema = [
{"name": "id", "type": "int", "nullable": False},
{"name": "timestamp", "type": "timestamp", "nullable": False},
{"name": "content", "type": "str", "nullable": False},
{"name": "category", "type": "str", "nullable": True},
{"name": "tags", "type": "str[]", "nullable": True},
{"name": "importance", "type": "int", "nullable": True},
{"name": "metadata", "type": "json", "nullable": True},
]
self.db.create_table("memory", schema=schema)
def add_memory(self, content: str, category: str = "general", tags: List[str] = None,
importance: int = 5, metadata: Dict[str, Any] = None) -> int:
"""Add a new memory entry."""
table = self.db.open_table("memory")
# Get next ID
max_id = table.to_pandas()["id"].max() if len(table) > 0 else 0
new_id = max_id + 1
# Insert new memory
memory_data = {
"id": new_id,
"timestamp": datetime.now(),
"content": content,
"category": category,
"tags": tags or [],
"importance": importance,
"metadata": metadata or {}
}
table.add([memory_data])
return new_id
def search_memories(self, query: str, category: str = None, limit: int = 10) -> List[Dict]:
"""Search memories using vector similarity."""
table = self.db.open_table("memory")
# Build filter
where_clause = []
if category:
where_clause.append(f"category = '{category}'")
filter_expr = " AND ".join(where_clause) if where_clause else None
# Vector search
results = table.vector_search(query).limit(limit).where(filter_expr).to_list()
return results
def get_memories_by_category(self, category: str, limit: int = 50) -> List[Dict]:
"""Get memories by category."""
table = self.db.open_table("memory")
df = table.to_pandas()
filtered = df[df["category"] == category].head(limit)
return filtered.to_dict("records")
def get_memory_by_id(self, memory_id: int) -> Optional[Dict]:
"""Get a specific memory by ID."""
table = self.db.open_table("memory")
df = table.to_pandas()
result = df[df["id"] == memory_id]
return result.to_dict("records")[0] if len(result) > 0 else None
def update_memory(self, memory_id: int, **kwargs) -> bool:
"""Update a memory entry."""
table = self.db.open_table("memory")
valid_fields = ["content", "category", "tags", "importance", "metadata"]
updates = {k: v for k, v in kwargs.items() if k in valid_fields}
if not updates:
return False
# Convert to proper types for LanceDB
if "tags" in updates and isinstance(updates["tags"], list):
updates["tags"] = str(updates["tags"]).replace("'", '"')
table.update(updates, where=f"id = {memory_id}")
return True
def delete_memory(self, memory_id: int) -> bool:
"""Delete a memory entry."""
table = self.db.open_table("memory")
current_count = len(table)
table.delete(f"id = {memory_id}")
return len(table) < current_count
def get_all_categories(self) -> List[str]:
"""Get all unique categories."""
table = self.db.open_table("memory")
df = table.to_pandas()
return df["category"].dropna().unique().tolist()
def get_memory_stats(self) -> Dict[str, Any]:
"""Get statistics about memory storage."""
table = self.db.open_table("memory")
df = table.to_pandas()
return {
"total_memories": len(df),
"categories": len(self.get_all_categories()),
"by_category": df["category"].value_counts().to_dict(),
"date_range": {
"earliest": df["timestamp"].min().isoformat() if len(df) > 0 else None,
"latest": df["timestamp"].max().isoformat() if len(df) > 0 else None
}
}
# Global instance
lancedb_memory = LanceMemoryDB()
def add_memory(content: str, category: str = "general", tags: List[str] = None,
importance: int = 5, metadata: Dict[str, Any] = None) -> int:
"""Add a memory to the LanceDB store."""
return lancedb_memory.add_memory(content, category, tags, importance, metadata)
def search_memories(query: str, category: str = None, limit: int = 10) -> List[Dict]:
"""Search memories using semantic similarity."""
return lancedb_memory.search_memories(query, category, limit)
def get_memories_by_category(category: str, limit: int = 50) -> List[Dict]:
"""Get memories by category."""
return lancedb_memory.get_memories_by_category(category, limit)
def get_memory_stats() -> Dict[str, Any]:
"""Get memory storage statistics."""
return lancedb_memory.get_memory_stats()
# Example usage
if __name__ == "__main__":
# Test the database
print("Testing LanceDB memory integration...")
# Add a test memory
test_id = add_memory(
content="This is a test memory for LanceDB integration",
category="test",
tags=["lancedb", "integration", "test"],
importance=8
)
print(f"Added memory with ID: {test_id}")
# Search for memories
results = search_memories("test memory")
print(f"Search results: {len(results)} memories found")
# Get stats
stats = get_memory_stats()
print(f"Memory stats: {stats}")把开发过程中的经验、错误与纠正记录为 Markdown 文件,供后续复用并晋升为工作区记忆。
用自然语言描述需求,在本地与远程技能市场里找技能并给出推荐的技能。
给 AI agent 用的浏览器自动化命令行技能。
把用户纠正与自我复盘沉淀成分层记忆、并按使用情况升降级的技能。
一份为 AI 代理规划主动跟进、工作记忆与复盘流程的工作区配置指南。
指导如何创建与更新有效 Claude 技能的写作指南。
在安装第三方技能之前,按清单审查来源、权限与危险模式的技能。
把盛唐诗人李白的诗学观、意象系统与口吻,蒸馏成 AI 可调用的角色包。
数据月份:2026-10 · 下载/星标数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。