xiaoyun-memory
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@xiaoyun-memory帮我搜一下记忆里关于香菜的记录"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
xiaoyun-memory
A small, local-first memory search service for Chinese text. It runs on Node's built-in node:sqlite, keeps everything on disk/in memory on your machine, and exposes three things:
an HTTP API (
/search,/get,/stats),a stdio MCP server (
memory_search,memory_get) so an agent can call it as a tool,a tiny schema you can point at your own table.
It was extracted from a personal assistant's memory pipeline. The interesting part is not FTS5 or RRF (both are well documented) — it is the glue: bigram tokenization for Chinese, candidate recall by FTS, optional vector recall, rank fusion, and a set of small guards that keep latency predictable.
Why bigram
SQLite's unicode61 tokenizer treats a run of Chinese characters as one token, so MATCH '天气' finds nothing unless the whole run matches. trigram needs at least three characters. A bigram index (天气 气很 很好 …) gives two-character recall with a modest size cost: on a 1.07M-character corpus it was ~7.3 MB and answered in ~0.2 ms, roughly 30× faster than a LIKE '%…%' scan.
Related MCP server: memory-agent
Quick start
node examples/seed.mjs demo.sqlite3
MEM_DB=./demo.sqlite3 MEM_PORT=3505 node src/server.mjs
curl "http://127.0.0.1:3505/search?q=香菜&limit=3"MCP:
MEM_API=http://127.0.0.1:3505 node src/mcp.mjsThe wrapper lazily starts src/server.mjs if the API is not up (local URLs only).
API
Method | Path | Notes |
GET |
| returns |
GET |
| one row, |
GET |
|
|
limit is clamped to 1..20. Query text is normalized (NFKC, zero-width characters removed) before tokenization.
Environment
Variable | Default | Meaning |
| — (required) | path to the SQLite file |
|
| HTTP listener |
| — | if set, require header |
| on |
|
|
| how often to sync the index with the table |
| off |
|
| — | directory with an ONNX export of a sentence-embedding model |
|
| if lexical top1 scores ≥ this, skip the vector pass |
| off |
|
|
| JSON rule table |
Schema
create table memories (
id text primary key,
kind text,
title text,
content text,
importance real default 0.5,
source text,
observed_at text,
sensitive integer default 0,
superseded_by text
);
create table mem_vectors (id text primary key, vec blob); -- optional, float32 LE, 512-dRows with superseded_by is not null are ignored everywhere.
Tests
npm test # node --test test/retrieval.test.mjs test/fts.test.mjsTests build a throwaway database in the OS temp dir, so they never touch your data.
More measurements: docs/notes/fts5-bigram.md, docs/notes/hybrid-eval.md, and docs/lessons.md.
What this is not
Not a database. It reads an existing SQLite file; writes are your job.
Not a hosted service. It binds to loopback by default.
Not a model. Vector recall is optional and expects you to bring a model directory.
License
MIT.
This server cannot be deployed
Maintenance
Related MCP Connectors
Persistent memory, hybrid search and a goal graph for AI agents, over stdio or remote HTTP.
Persistent memory for AI agents. Search, store, and recall across sessions.
Persistent memory for AI agents. Search and store durable facts, preferences and decisions.
MemoryOracle - 10 agent memory tools: vector store, recall, summarization, redaction.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to save, search, and manage local Chinese semantic memories on demand, with support for updating, merging, and Obsidian-style linking.4,578,622 npmMIT
- AlicenseAqualityBmaintenanceExposes tools that let an agent search a local Markdown-based memory store, fetch full cards by id, write new knowledge cards that are indexed immediately, and inspect or rebuild the SQLite index. All retrieval runs locally over Chinese-friendly full-text search with graded exact/prefix matching, so agents without a memory system can recall prior notes while existing Markdown files stay read-only.51MIT
- FlicenseNot gradedqualityAmaintenanceProvides persistent, cross-session memory for MCP-compatible AI tools, letting them store and share a unified local memory with Chinese-aware semantic search, typo correction, associative perception chains, and graph-based recall.154 npm3-
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to keep durable long-term memory on the user's own machine, writing sessions and messages into a local SQLite database and retrieving them via keyword, exact, or optional semantic search with surrounding context. Runs entirely offline over stdio, so no cloud service or API key is required to give an agent recall across sessions.1MIT