mcpField
W
Weasley DeepMind

Weasley DeepMind

Local
github.com/potatohoney-pMemory & Knowledge4Updated 13w ago

About Weasley DeepMind

Weasley DeepMind is a self-hosted memory server for AI agents that stores typed fragments and linked evidence. It retrieves ranked context within a token budget instead of replaying full conversation histories.

Key features

  1. 01Typed memory fragments with provenance
  2. 02Keyword, graph, and vector search
  3. 03Token-budgeted context recall
  4. 04Memory linking and lifecycle controls
  5. 05stdio and Streamable HTTP transports

Use cases

  1. 01Recall relevant context for an agent task
  2. 02Store decisions and procedures for later use
  3. 03Explore links between memory fragments
  4. 04Maintain self-hosted agent memory

MCP support

Exposes memory tools such as remember, recall, link, and context to MCP clients through local stdio or Streamable HTTP at `/mcp`. HTTP requests require an access key by default.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"potatohoney-p-weasley-deepmind": {
"command": "npx",
"args": [
"-y",
"weasley-deepmind"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>",
"WEASLEY_DEEPMIND_AUTO_MIGRATE": "<WEASLEY_DEEPMIND_AUTO_MIGRATE>",
"EMBEDDING_API_KEY": "<EMBEDDING_API_KEY>"
}
}
}
}
Run commandnpx -y weasley-deepmind
Environment variables to set
DATABASE_URLSecretPostgreSQL connection URL for a database with pgvector installed.
WEASLEY_DEEPMIND_AUTO_MIGRATEApply pending database migrations before starting the stdio server.
EMBEDDING_API_KEYSecretOptional embedding provider API key for semantic recall.

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmweasley-deepmind1.0.0

Tools

20

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
goalstringNoGoal of the episode fragment (episode type recommended)
typeenumYesFragment type. fact=fact, decision=decision, error=error, preference=user preference, procedure=procedure, relation=relationship, episode=episode (1000 characters). Types other than episode are truncated if they exceed 300 characters.fact | decision | error | preference | procedure | relation | episode
phasestringNoWork phase (e.g., planning, debugging, verification)
scopeenumNoStorage scope. permanent=long-term memory (default), session=session working memory (cleared when the session ends)permanent | session
topicstringYesTopic identifier for the fragment. Used as a topic filter during recall; TemporalLinker automatically creates temporal links between fragments with the same topic within ±24h. We recommend specifying a project name or domain (e.g., weasley-deepmind, authentication, deployment).
affectenumNoAffect tag (migration-034-v2.16.0-bundle). frustration=repeated failure/frustration, confidence=verification passed/conviction, surprise=unexpected result, doubt=uncertainty, satisfaction=resolution/satisfaction. Default is neutral. Invalid values are forced to neutral.neutral | frustration | confidence | surprise | doubt | satisfaction
caseIdstringNoWork/case identifier this fragment belongs to. If unset, it is automatically set to the current session_id. Recommended format: {debug|feat|incident}-{topic}-{YYYY-MM-DD}. When caseId is specified, resolutionStatus(open|resolved|abandoned) is also recommended (a caseIdHasResolutionStatus warning is issued if unset).
dryRunbooleanNoWhen set to true, changes are not actually applied and only the execution plan is returned. Preview quota and conflict-check results without creating a fragment.
sourcestringNoSource (session ID, tool name, etc.)
agentIdstringNoAgent ID (for RLS isolation)
contentstringYesContent to remember (1–3 sentences, 300 characters or fewer recommended). GOOD examples: - 'Improved user authentication API response time from 500ms to 120ms (changed ORM N+1 queries to a single JOIN query)' - 'Cause of login failure: timezone mismatch in JWT expiration validation → resolved by standardizing on UTC for both server and client' - 'User preference: do not use emoji in commit messages' - 'Order payment flow architecture decision: switched from synchronous REST to Kafka event-driven design (prioritizing guaranteed retries)' BAD examples (must be rewritten before saving): - 'It was slow, so I improved it' — subject, target, and values are unclear - 'Fixed the previous error' — the specific error cannot be identified - 'Automatic session summary: 3 tool calls, 2 fragments processed' — meta/self-reference, no facts - 'Modified the frontend and fixed the API too' — two independent topics; separate calls are needed - 'Handled as requested by the user in this conversation' — meta reference, no facts
outcomestringNoEpisode fragment outcome
isAnchorbooleanNoWhether to pin this important fragment. When true, it is excluded from importance decay and expiration deletion.
keywordsarrayNoSearch keywords (automatically extracted if not provided). 3–5 keywords are recommended. Including project names, host names, and topics improves search precision. If omitted, automatic extraction may be low quality and results may be missed.
linkedToarrayNoList of existing fragment IDs to link
sessionIdstringNoCurrent session ID. Used to group fragments from the same session into time-adjacent bundles.
workspacestringNoWorkspace name (e.g., 'weasley-deepmind', 'personal', 'client-acme'). If omitted, the key's default_workspace is applied. To save as global memory (retrievable from all workspaces), omit this and ensure the key does not contain default_workspace.
importancenumberNoImportance from 0 to 1 (defaults to the value for the type if not provided). Recommended: preference=0.9, error/procedure=0.8, decision=0.7, fact=0.6. Values of 0.5 or lower receive low priority in search, so set core information to at least 0.6.
supersedesarrayNoList of existing fragment IDs to supersede. The specified fragments will have valid_to set and their importance halved.
contextSummarystringNoSummary of the context/background in which this memory arose (1–2 sentences). Returned with recall to restore context.
idempotencyKeystringNoRetry-safe identifier. Repeated calls to remember with the same value within the same key_id scope return the existing fragment id without creating a new fragment. Intended to prevent duplicate client retries and network requests. Recommended format: {작업명}-{날짜}-{순번}
assertionStatusenumNoConfidence level of the fragment. Default: observed. inferred=inferred (not yet verified), verified=verified, rejected=discarded.observed | inferred | verified | rejected
resolutionStatusenumNoTask resolution statusopen | resolved | abandoned

Details

From the project 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)

Install from npm

npm install --global weasley-deepmind

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

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

weasley-deepmind migrate
weasley-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:

{
  "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

git clone https://github.com/potatohoney-p/weasley-deepmind.git
cd weasley-deepmind
npm ci
docker compose -f docker-compose.dev.yml up -d
cp .env.example.minimal .env
npm run migrate
npm 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

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

weasley-deepmind serve       Start the HTTP MCP server
weasley-deepmind stdio       Start the local stdio MCP server
weasley-deepmind migrate     Apply pending database migrations
weasley-deepmind health      Check database, Redis, and embeddings
weasley-deepmind recall      Search memory from the terminal
weasley-deepmind remember    Store a memory fragment
weasley-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

npm ci
npm test
npm run lint
npm run lint:migrations
npm 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.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.