使用说明
@记忆mcp
一个受OpenMemory启发的Node.js最小可插拔内存管理库。支持本地SQLite存储、语义搜索(Qdrant)和OpenAI嵌入。没有网络服务器,没有前端,只有一个可编程的API。
特性
- 添加、列出、更新、删除记忆
- 语义搜索(Qdrant)
- 用户、应用程序和类别支持
- 本地SQLite(通过Prisma)
- TypeScript优先
入门指南
-
安装依赖项:
npm install -
初始化数据库:
npx prisma migrate dev --name init -
配置MCP:创建或更新您的MCP配置文件(例如。,
mcp_config.json)如下:{ "memoer-mcp": { "command": "npx", "args": ["memoer-mcp@latest"], "env": { "DATABASE_URL": "file:/Users/{your_username}/{any_folder_path}/memoer.db" //macOS example } } } -
在项目中使用库:
import { MemoerMCP } from "@memoer-mcp"; const memoer = new MemoerMCP(); // Example: Adding a memory await memoer.addMemory({ title: "My First Memory", content: "This is the content of my first memory.", category: "Personal" }); // Example: Listing memories const memories = await memoer.listMemories(); console.log(memories);
发展
- 在中编辑Prisma架构
prisma/schema.prisma - 跑
npx prisma generate变更后 - 源代码在
src/
这个库现在功能齐全,可以在您的项目中使用!
### MCP Configuration Example
In your `mcp_config.json`, you can configure the `memoer-mcp` command as follows:
```json
{
"memoer-mcp": {
"command": "npx",
"args": ["memoer-mcp@latest"],
"env": {
"DATABASE_URL": "file:/Users/{your_username}/{any_folder_path}/memoer.db" //macOS example
}
}
}
配置说明
- 命令:指定要运行的命令,在本例中为
npx执行memoer-mcp包裹。 - 参数:这是传递给命令的参数数组。在这里,它指定要运行的包。
- 环境:本节允许您设置应用程序所需的环境变量。这
DATABASE_URL指向SQLite数据库文件。
用法
通过此设置,您现在可以运行 memoer-mcp 从命令行或将其集成到应用程序中,如示例所示。此配置允许您使用 memoer-mcp 图书馆。
如果您还有其他问题或需要更多示例,请随时提问!
许可证
此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。
