Weasley DeepMind

io.github.potatohoney-p由 GitHub 账号 potatohoney-p 发布v1.0.0更新于 Oct 24, 2026

Secure, fragment-based long-term memory for MCP-compatible AI agents.

已验证STDIO仅桌面数据库知识与记忆

概览

AI 生成的概览

自托管长期记忆服务器,让 AI 助手通过 MCP 存储、关联并召回小型的带类型记忆片段。

可以做什么
  • 存储记忆片段,可单条或批量写入,并带有类型、来源、重要性和生命周期状态
  • 在 token 预算内按关键词、PostgreSQL GIN、图邻居和可选向量检索合并排序后召回上下文
  • 修改、遗忘和关联片段,并浏览记忆图谱
  • 对已存记忆进行反思与整合,并查看记忆统计
  • 查看片段历史、重建历史并检索调用轨迹
适用场景
适合希望助手跨会话保留上下文、又不想把整段对话历史塞回提示词的场景,前提是你愿意自行运行 PostgreSQL 数据库。也适合希望记忆数据留在自有基础设施上的团队。
运行要求
需要 Node.js 20.19 或更高版本,以及装有 pgvector 扩展的 PostgreSQL 15 或更高版本;Redis 7 为可选项。需要 DATABASE_URL 连接串,语义召回可选配 EMBEDDING_API_KEY。可通过 npx 以本地 stdio 进程运行,或作为仅监听本机的 HTTP 服务器运行并配合 bearer 访问密钥。
安装前请注意
DATABASE_URL 含数据库凭据,EMBEDDING_API_KEY 为嵌入服务密钥,请勿提交到版本库。stdio 模式信任本地宿主进程,需保护好宿主账号与数据库访问权限。记忆工具会写入、修改和删除已存数据。HTTP 模式在未配置 WEASLEY_DEEPMIND_ACCESS_KEY 时会拒绝请求,关闭认证仅限本机回环开发使用。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Weasley DeepMind,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[Weasley DeepMind]

Weasley DeepMind

Weasley DeepMind is a self-hosted memory server for AI agents. It stores small, typed memory fragments, links related evidence, and recalls the right context through MCP without forcing an entire conversation history back into every prompt.

It is part of the Weasley Open Source family and is released under Apache-2.0.

Why DeepMind

  • Useful recall, not a transcript dump. Keyword, PostgreSQL GIN, graph-neighbor, and optional pgvector search are merged and ranked within a token budget.
  • Memory with structure. Facts, decisions, procedures, preferences, episodes, and errors keep provenance, importance, links, and lifecycle state.
  • MCP-native. Use a local stdio process or the Streamable HTTP endpoint at /mcp.
  • Fail-closed HTTP security. The HTTP server rejects requests when no access key is configured. Authentication can only be disabled explicitly for local development.
  • Self-hosted data. PostgreSQL is the system of record. Redis and external embedding or LLM providers are optional.
  • Operationally ready. Migrations are serialized with a PostgreSQL advisory lock, secrets are redacted from logs, and updates refuse dirty Git checkouts.

Requirements

  • Node.js 20.19 or newer
  • PostgreSQL 15 or newer with the pgvector extension
  • Redis 7 (optional, for cache and low-latency keyword lookup)

For a reproducible offline check of correction/retraction recall and content-token budgets, run npm run --silent eval:recall with Node.js 24. This uses production recall code and synthetic storage, with no database or model required. See the offline recall evaluation for the negative control, report definitions and limits.

Install from npm

bash
npm install --global weasley-deepmind

Create a PostgreSQL database with pgvector, then configure the connection:

bash
export DATABASE_URL='postgresql://postgres:password@localhost:5432/weasley_deepmind'export WEASLEY_DEEPMIND_ACCESS_KEY='replace-with-a-long-random-secret'
weasley-deepmind migrateweasley-deepmind serve

The HTTP server listens on http://127.0.0.1:57332 by default. Its MCP endpoint is http://127.0.0.1:57332/mcp.

Add it to an MCP client

The npm package includes a newline-delimited stdio transport. A generic MCP client configuration looks like this:

json
{  "mcpServers": {    "weasley-deepmind": {      "command": "npx",      "args": ["-y", "weasley-deepmind", "stdio"],      "env": {        "DATABASE_URL": "postgresql://postgres:password@localhost:5432/weasley_deepmind",        "WEASLEY_DEEPMIND_AUTO_MIGRATE": "true"      }    }  }}

For an already-running HTTP deployment, point the client at /mcp and send Authorization: Bearer <WEASLEY_DEEPMIND_ACCESS_KEY>.

Run the repository locally

bash
git clone https://github.com/potatohoney-p/weasley-deepmind.gitcd weasley-deepmindnpm cidocker compose -f docker-compose.dev.yml up -dcp .env.example.minimal .envnpm run migratenpm start

The development Compose file exposes PostgreSQL at localhost:35432 and Redis at localhost:36379. Update .env to match those ports before starting the server.

Core flow

mermaid
flowchart LR    Agent["AI agent"] --> MCP["stdio or Streamable HTTP"]    MCP --> Tools["remember · recall · reflect · context"]    Tools --> Rank["keyword + graph + vector ranking"]    Rank --> Postgres["PostgreSQL + pgvector"]    Rank -. optional cache .-> Redis["Redis"]

The main tool set includes remember, batch_remember, recall, forget, amend, link, reflect, context, memory_stats, memory_consolidate, graph_explore, fragment_history, reconstruct_history, and search_traces. Tool availability can be limited by API-key permissions and operating mode.

Configuration

VariablePurposeDefault
DATABASE_URLPostgreSQL connection URLderived from POSTGRES_*
WEASLEY_DEEPMIND_ACCESS_KEYRequired bearer secret for HTTP modenone; HTTP fails closed
WEASLEY_DEEPMIND_AUTH_DISABLEDExplicit loopback-only authentication opt-out; startup rejects non-loopback listenersfalse
WEASLEY_DEEPMIND_AUTO_MIGRATERun migrations before stdio startupfalse (server.json suggests true)
WEASLEY_DEEPMIND_HOMECLI cache and local state directory~/.weasley/deepmind
WEASLEY_DEEPMIND_HOSTHTTP listen address127.0.0.1
PORTHTTP port57332
REDIS_ENABLEDEnable Redis-backed featuresfalse
EMBEDDING_PROVIDERopenai, gemini, ollama, localai, cloudflare, transformers (optional install), or customopenai
EMBEDDING_API_KEYOptional embedding provider secretnone

See .env.example, configuration, and the installation guide for the complete matrix.

Local transformer embeddings are intentionally excluded from the default install so the core MCP server does not inherit an optional native-image dependency. Follow the pinned setup in docs/embedding-local.md before selecting EMBEDDING_PROVIDER=transformers.

CLI

text
weasley-deepmind serve       Start the HTTP MCP serverweasley-deepmind stdio       Start the local stdio MCP serverweasley-deepmind migrate     Apply pending database migrationsweasley-deepmind health      Check database, Redis, and embeddingsweasley-deepmind recall      Search memory from the terminalweasley-deepmind remember    Store a memory fragmentweasley-deepmind update      Preview or apply an update

Run weasley-deepmind --help or see the CLI reference for every command.

Security defaults

  • Keep the HTTP listener on loopback unless you have a trusted reverse proxy and an explicit origin allowlist.
  • Use a unique, high-entropy WEASLEY_DEEPMIND_ACCESS_KEY and never commit .env.
  • Stdio mode trusts the local MCP host process; protect the host account and database credentials accordingly.
  • Report vulnerabilities privately using the instructions in SECURITY.md.

Development

bash
npm cinpm testnpm run lintnpm run lint:migrationsnpm pack --dry-run

Architecture and operations details live in docs/architecture.en.md and docs/operations. Contributions are welcome through CONTRIBUTING.md.

License

Copyright 2026 Weasley Open Source.

Licensed under the Apache License 2.0. See NOTICE for attribution information.

来源:README.md,提交 762f5c7

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分