简单内存扩展 MCP 服务器
MCP 服务器用于扩展代理的上下文窗口/内存。在编写大型功能或氛围代码,需要存储/调用进度、关键时刻、更改或任何值得记住的内容时非常有用。只需让代理存储记忆并在需要时调用,或者让代理以合适的方式完全管理其内存(例如通过游标规则)。
用法
启动服务器
可用工具
上下文项目管理
store_context_item
- 在命名空间中存储带有键的值retrieve_context_item_by_key
- 按键获取值delete_context_item
- 删除键值对
命名空间管理
create_namespace
创建新的命名空间delete_namespace
- 删除命名空间和所有内容list_namespaces
- 列出所有命名空间list_context_item_keys
- 列出命名空间中的键
语义搜索
retrieve_context_items_by_semantic_search
- 按含义查找项目
语义搜索实现
- 使用 E5 模型将查询转换为向量
- 文本自动拆分成块以便更好地匹配
- 计算查询和存储块之间的余弦相似度
- 按阈值过滤结果并按相似度排序
- 返回具有完整项目值的最佳匹配项
发展
.env
语义搜索
该项目包含使用 Hugging Face 的 E5 嵌入模型的语义搜索功能。这使您能够根据上下文项的含义(而非仅仅根据精确的关键字匹配)来查找上下文项。
设置
语义搜索功能需要 Python 依赖项,但运行以下命令时会自动安装这些依赖项: npm run start
嵌入模型
我们使用intfloat/multilingual-e5-large-instruct
笔记
大部分都是在写 Vibe 代码的时候开发的,所以别期待太多 :D。不过它确实能用,而且我觉得它很有用。欢迎大家贡献代码或提出改进建议。
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.Last updated -12,1671,631TypeScriptMIT License
- -securityAlicense-qualityAn MCP server that bridges AI agents with GUI automation capabilities, allowing them to control mouse, keyboard, windows, and take screenshots to interact with desktop applications.Last updated -PythonMIT License
- -securityFlicense-qualityA MCP server that allows AI assistants to interact with the browser, including getting page content as markdown, modifying page styles, and searching browser history.Last updated -5TypeScript
- -securityAlicense-qualityA Model Context Protocol server that provides AI agents with persistent memory capabilities through Mem0, allowing them to store, retrieve, and semantically search memories.Last updated -2PythonMIT License