Madeleine

MCP文档知识

提供方 未标注

文档知识 stdio · 本地进程 未标注 社区 / 第三方 Claude DesktopClaudeCursorVS Code
查看接入方式

AI 智能体的非自主记忆:时间、地点、声音和 IoT 线索会主动唤起记忆

一句话选型结论

按资料字段整理

Madeleine 属于文档知识类 MCP 服务器,stdio · 本地进程,鉴权方式未标注,可直接接入 Claude Desktop、Claude、Cursor 等,有可直接执行的安装命令。接入前先确认权限范围;涉及写入、删除或付款的操作,建议先在测试环境验证。

分类文档知识 传输方式stdio · 本地进程 鉴权未标注 部署方式本地部署
GitHub 星标 未标注 仓库热度,无公开仓库时显示未标注
工具数 未标注 暴露给模型的工具数量
资源 / 提示词 0 / 0 资源与提示词模板数量
维护方 社区 / 第三方 核验等级 仅资料核对

工具与能力

文档知识
数量来自来源目录的标注,具体工具清单以官方文档为准
工具数量未标注暴露给模型可调用的工具个数
资源数量0可读取的资源条目
提示词数量0内置提示词模板数量

能力标签

支持客户端

适用场景

记忆

安装与配置

stdio · 本地进程 未标注
客户端在本机拉起子进程,数据不出本机
# 1. See the whole loop, offline (nothing is downloaded, nothing leaves your machine) uvx madeleine-mcp demo

这条命令只是入口,具体启动参数请按官方文档补齐,不要直接照搬到别的服务器。

  1. 1
    准备运行环境

    stdio 服务在本地起进程,需要先装好 Node.js 等运行时,再按安装命令拉取依赖。

  2. 2
    安装服务

    复制上面的安装命令执行;命令里带占位符的位置,换成自己的密钥或路径。

  3. 3
    写入客户端配置

    在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4
    验证是否可用

    连接成功后随便调一个只读工具,确认能返回结果,再接入正式流程。

典型使用场景

3 类
按分类与标签整理的常见用法,具体以官方文档为准
文档检索问答

在你的文档库里按问题找答案。

知识库读写

把新资料写进知识库,随用随取。

内容整理

把零散资料归纳成结构化笔记。

选择建议

选之前先看这几条
按条目字段给出的判断,不替你决定用不用

值得选的地方

  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已适配 Claude Desktop、Claude、Cursor,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好运行时(如 Node.js),换机器要重新装一遍。
  • 资料没标注工具数量,实际能力要装好后确认。
  • 版本更新与行为细节以官方仓库为准。

更适合

  • 需要在文档知识场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop、Claude 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地或自有环境跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

6 个同类
同分类里挑最接近的几条,字段以各自详情页为准
MCP 服务器工具数传输方式部署方式安装命令最后核验
Madeleine当前 未标注 stdio · 本地进程 本地部署 有 2026-11-20
dify 未标注 stdio · 本地进程 本地部署 有 2026-04-11
open-webui 未标注 stdio · 本地进程 本地部署 有 2026-04-11
JeecgBoot 未标注 stdio · 本地进程 本地部署 有 2026-04-11
Cherry Studio 未标注 未标注 未标注 无 2026-05-17
mempalace 未标注 stdio · 本地进程 本地部署 有 2026-04-11

服务器档案

文档知识
字段来自项目仓库与公开索引,中文说明由本站标注
提供方未标注上游标注的维护方 未标注
分类文档知识本站按上游分类展示
连接方式stdio · 本地进程客户端在本机拉起子进程,数据不出本机
鉴权方式未标注远程服务建议用最小权限凭据
维护方社区 / 第三方核验等级 仅资料核对
包名 / 运行时未标注 · 未标注本地安装时用到的包标识与运行时
部署类型本地部署上游给出的部署形态
最近核验2026-11-20上游最后核验时间

详细介绍

12.1 KB
来自项目仓库与上游目录的原文,未做删改

madeleine

Involuntary memory for AI agents. A place, an hour, a sound, a photo or a sensor reading
brings back a related memory on its own, without the agent having to ask. It works the way
the taste of a madeleine brought back Proust's childhood.

Local-first (SQLite) · MCP server + Python library · no telemetry

Most agent memory is voluntary: the agent decides to search, writes a query, and gets
results. madeleine adds the other pathway. Every memory is stored with the sensory
fingerprint
present when it was encoded: where, when, what was said, seen or heard.
Incoming cues from webhooks, phones, smart homes and wearables are matched against those
fingerprints all the time. When enough channels line up, the memory is queued as an
involuntary recollection, and the agent receives it with its next prompt. This is
encoding specificity applied to agents (concepts).

60-second quickstart```bash

1. See the whole loop, offline (nothing is downloaded, nothing leaves your machine)

uvx madeleine-mcp demo


The demo remembers three moments. Then a cue arrives that carries only a place and a time of
day: 30 m from grandmother's house, on a Sunday afternoon. The matching memory surfaces by
itself, is delivered through the MCP tool `pending_recollections`, and does not fire again for
a repeated cue:```
[madeleine 0.80 via geo+time] Sunday afternoons in grandmother's kitchen: lime-blossom tea and a madeleine (2019-04-14)
  channel similarity geo=0.97, time=1.00; salience x1.16, age decay x0.70
``````bash
# 2. Give Claude Code the tools
claude mcp add madeleine -- uvx madeleine-mcp serve
  1. Let involuntary recollections reach every prompt. Add this to .claude/settings.json:```json
    {"hooks": {"UserPromptSubmit": [{"hooks": [
    {"type": "command", "command": "uvx madeleine-mcp hook claude-code", "timeout": 10}
    ]}]}}

The hook works even if your client ignores MCP notifications. See
examples/claude_code for options such as `--sense-prompt`,
which treats what you type as a cue too.

### Other MCP clients

The server is a standard stdio MCP server (`uvx madeleine-mcp serve`), so any MCP client can
use the seven tools. **Involuntary** delivery on every prompt (step 3 above) is built for
Claude Code; in other clients the agent receives recollections by calling
`pending_recollections`, which the server's instructions ask it to do at the start of each
turn.

Claude Desktop, Cursor, VS Code, OpenCode, Docker

Claude Desktop (`claude_desktop_config.json`) and Cursor (`~/.cursor/mcp.json`):```json
{"mcpServers": {"madeleine": {"command": "uvx", "args": ["madeleine-mcp", "serve"]}}}

VS Code (.vscode/mcp.json):```json
{"servers": {"madeleine": {"type": "stdio", "command": "uvx", "args": ["madeleine-mcp", "serve"]}}}


OpenCode (`opencode.json`):```json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {"madeleine": {"type": "local", "command": ["uvx", "madeleine-mcp", "serve"], "enabled": true}}
}

Docker (memories persist in the madeleine-data volume):```bash
docker build -t madeleine-mcp https://github.com/fabianimv/madeleine.git
docker run -i --rm -v madeleine-data:/data madeleine-mcp # stdio MCP server


> **Semantic text needs the `[text]` extra.** The base install is small and offline. Without
> the extra, text is matched *lexically* by a hashing embedder, so "car" and "automobile"
> count as unrelated. For real sentence embeddings (this pulls in PyTorch):
>
>```bash
> claude mcp add madeleine -- uvx --from 'madeleine-mcp[text]' madeleine-mcp serve
> ```
>
> Images (`[image]`, open_clip) and sound (`[audio]`, LAION CLAP) are opt-in the same way.
> `[all]` installs everything. Models download lazily on first use, never at import.

## How it works```mermaid
flowchart LR
    subgraph Sources
      HA[Home Assistant] -->|webhook| HTTP
      IOS[iOS Shortcuts] -->|webhook| HTTP
      AG[Agent] -->|MCP tools| MCP
    end
    HTTP[HTTP API /cues] --> ENG
    MCP[MCP server] --> ENG
    subgraph ENG[engine]
      direction TB
      CH["channels<br/>adapter → embedder → similarity"] --> FU["fusion<br/>base · coverage · salience · decay"]
      FU --> RF{"push?<br/>threshold + refractory"}
    end
    ENG <--> DB[(SQLite + sqlite-vec)]
    RF -->|enqueue| Q[(recollection queue)]
    Q -->|drain| HOOK[Claude Code hook]
    Q -->|drain / notify| MCP
  • Channels are pluggable senses. Each one has an adapter (raw signal → normalised
    observation), an embedder (observation → vector) and a similarity function (→ [0, 1]).
    Built in: text, time (hour, weekday and season, all cyclical), geo (distance on the
    sphere), biometric, image, audio. smell is a documented stub for future e-noses.
  • Recall combines per-channel similarity over the channels the cue and the memory share,
    adjusts for how much of the cue is covered, boosts salient memories, and decays with age
    down to a floor, so decades-old memories stay reachable. The formula is short and
    explainable; every result says which channels matched
    (ADR 0001).
  • Two modes. Pull: the agent asks (recall). Push: a cue arrives (sense, POST /cues)
    and memories that clear the threshold are queued without anyone asking.
  • Habituation. A memory that fired stays quiet for a refractory period (default 6 h).
    Walking past the same café all afternoon reminds you of it once.
  • Context alone never fires. "It's 9 am" matches every memory made at 9 am, so time
    (and biometric) can strengthen a match but never cause one.

Sending cues```bash

madeleine serve --transport http # REST + MCP (streamable HTTP at /mcp/) on 127.0.0.1:8765
curl -s localhost:8765/cues -H 'content-type: application/json' \
-d '{"lat": 48.30195, "lon": 1.24650, "signals": [{"channel": "text", "value": "smell of lime-blossom tea"}]}'


| Route | Purpose |
|---|---|
| `POST /cues` | Generic cue: `signals`, `at`, `geohash` or `lat`/`lon`, `tags`, `source` |
| `POST /cues/{generic,home_assistant,ios_shortcuts}` | Payloads straight from those tools (examples) |
| `POST /memories`, `POST /recall`, `GET`/`PATCH`/`DELETE /memories/{id}` | Same as the MCP tools |
| `GET /recollections/pending` · `POST /recollections/drain` | Peek / take queued involuntary recollections |

Ready-made integrations: Home Assistant (arriving home,
media starts playing, wearable sensors), iOS Shortcuts
("Arrive at location" personal automation), curl.

**MCP surface:**
* Tools: `remember`, `recall`, `sense`, `pending_recollections`, `get_memory`, `update_memory`,
  `forget`.
* Resource: `recollections://pending`, with `resources/updated` notifications when something
  surfaces. These notifications also work across processes that share the database.

## Privacy and security defaults

* **Local-first.** Everything lives in one SQLite file (`~/.madeleine/madeleine.db`, owner-only
  permissions). There is no telemetry and no cloud.
* **Raw media is not kept.** Image and audio bytes are embedded and then discarded. Only
  vectors and metadata are stored, unless you pass `store_raw=True` (per call or
  `MADELEINE_STORE_RAW=1`).
* **No local file access by default.** Clients must send media bytes. Allowing file paths
  takes `madeleine serve --allow-file-uris`.
* **HTTP binds to 127.0.0.1.** Host and Origin checks block DNS rebinding. Set
  `MADELEINE_API_TOKEN` to require a bearer token. Binding to another interface without a
  token is refused unless you pass `--insecure-no-auth`.
* **`forget` deletes everywhere**: memory, vectors, raw bytes, trigger history and queued
  recollections, with SQLite `secure_delete` on.
* **Recollections are data, not instructions.** The hook wraps them in delimiters and labels
  them as such. Anyone who can write memories can still put text in your agent's context, so
  keep write access to yourself. See SECURITY.md.

## Benchmark (and where it fails)

`madeleine bench` runs a synthetic benchmark: 500 memories across 3 cities, 300 cues with
known ground truth, distractors and hard negatives. It is reported for both text backends.
Full tables, methodology and blind spots are in docs/benchmarks.md.```bash
madeleine bench                                        # offline hash text backend
madeleine bench --text-backend sentence-transformers   # semantic, needs the [text] extra
hash (offline, default) semantic ([text], MiniLM)
pull R@1 / R@10 0.69 / 0.81 0.74 / 0.82
precision of involuntary fires 0.69 0.70
positive cues that fire their memory 0.53 0.67
false-trigger rate on negatives 0.00 0.00

By cue category (hit rate = how often the right memory surfaced on its own):

cue category hash: hit rate semantic: hit rate semantic: precision
place + hour 0.81 0.81 0.56
text paraphrase only 0.21 0.67 1.00
text + place + hour 0.67 0.76 0.76
exact same photo / sound 1.00 1.00 1.00
slightly altered photo / sound 0.00 0.00 –
memory several years old 0.40 0.60 0.64
negatives (distractors, time-only, same place + other topic) 0 fires 0 fires

Latency with 500 memories, in pure Python: sense p50 11 ms / p95 23 ms with the hash
backend, p50 32 ms / p95 63 ms with the semantic one (CPU).

Honest limitations

  • Involuntary recall is tuned to be conservative: no negative cue fired, but a third (semantic)
    to half (hash) of positive cues still do not fire their memory.
  • Both text backends are calibrated on the benchmark generator (seed 1; results are seed 0,
    and seeds 2 and 3 agree). Without that, the hash backend under-scored paraphrases and MiniLM
    over-scored unrelated sentences. The data is synthetic English text, so real-world numbers
    will differ.
  • Altered media never matches in this benchmark, which uses the hash embedder for images and
    sound. That needs the CLIP and CLAP extras, whose similarity rescaling has only been
    calibrated on synthetic inputs.
  • Place + hour cues saturate (3 fires per cue), and only 56 % of those fall in the strict
    "same place, same hour ±1 h" ground truth.
  • The fusion is a hand-designed formula, not a learned one. There is no multi-user auth and no
    UI. The olfactory channel is a stub.
  • Hour-of-day uses each timestamp's own UTC offset. Send local offsets (+02:00), or "evening"
    means UTC evening.

Configuration

Env var Default Meaning
MADELEINE_DB ~/.madeleine/madeleine.db SQLite path (:memory: allowed)
MADELEINE_TEXT_BACKEND auto auto (sentence-transformers if installed), sentence-transformers, hash
MADELEINE_CHANNELS all built-ins Comma-separated enabled channels
MADELEINE_STORE_RAW off Persist raw media bytes
MADELEINE_ALLOW_LOCAL_FILES off Let media signals reference local files
MADELEINE_API_TOKEN unset Bearer token for the HTTP API (and the hook's --url mode)
MADELEINE_ALLOWED_HOSTS loopback Extra Host/Origin names accepted by the HTTP server

CLI: madeleine serve · remember · sense · recall · pending · show · edit · forget · demo · bench · hook claude-code
(madeleine --help).

As a Python library```python

from madeleine.config import load_config
from madeleine.core.serde import context_from_fields
from madeleine.engine import create_engine

engine = create_engine(load_config(db_path="memories.db", text_backend="hash"))
now = engine.now()
engine.remember("Ana proposed at the Eiffel Tower",
context=context_from_fields(now=now, lat=48.8584, lon=2.2945, salience=0.9))
cue = engine.build_cue(context=context_from_fields(now=now, lat=48.8585, lon=2.2946))
for rec in engine.sense(cue): # involuntary: fires on place (+ time) alone
print(rec.to_prompt_line())
```

Write your own sense with an Adapter, an Embedder and a similarity function
(docs/channels.md). ImageBind is deliberately not a dependency
because its license is CC-BY-NC, but you can plug it in yourself as an Embedder.

Development

See CONTRIBUTING.md. Run uv sync once, then before every commit:
uv run pytest, uv run ruff check src tests, uv run mypy. The architecture is in
ARCHITECTURE.md and the design decisions are in docs/adr.

License

Apache-2.0. See LICENSE.

常见问题

8 问
答案由本站依据条目字段整理,不引用上游原文
Madeleine 怎么安装?

在客户端按下面的安装命令接入:# 1. See the whole loop, offline (nothing is downloaded, nothing leaves your machine) uvx madeleine-mcp demo。装完在客户端配置里引用同一个包或端点。

Madeleine 怎么在 Claude Desktop、Claude、Cursor 里配置?

它的传输方式是stdio · 本地进程,在客户端的 MCP 配置里填好启动命令和参数,保存后完全退出客户端再打开,配置才会生效。

Madeleine 收费吗?

本站不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Madeleine 需要 API Key 吗?

资料没有标注鉴权方式,是否需要密钥取决于服务本身,接入前按官方文档确认。

Madeleine 支持哪些客户端?

资料标注支持 Claude Desktop、Claude、Cursor、VS Code、Codex、Zed;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

Madeleine 能提供哪些能力?

资料显示能力标签包括 记忆。具体工具清单以官方文档为准。

Madeleine 需要什么运行环境?

属于本地进程,需要在本机装好运行环境。

Madeleine 是本地还是远程?

它是本地进程(stdio),由客户端在本机拉起。传输方式为stdio · 本地进程。

热门专题

按标签挑服务器
全部专题 →

服务器信息以作者仓库与官方文档为准;分类、传输方式与鉴权方式的中文说明为中文整理,最近核验 2026-11-20。