mcp-memory-bucket 0.12.6 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -0
- package/dist/client/assets/{index-B4HSkaso.js → index-CGe-JXLz.js} +161 -157
- package/dist/client/index.html +1 -1
- package/dist/src/memory/repository.js +32 -16
- package/dist/src/memory/tools.js +1 -1
- package/dist/src/remote/folderfoo-client.js +14 -0
- package/dist/src/remote/shared-items.js +258 -121
- package/dist/src/server.js +22 -4
- package/dist/src/shared/bucket-folder-tool.js +4 -0
- package/dist/src/shared/bucket-share-tool.js +30 -40
- package/dist/src/shared/search-tool.js +29 -2
- package/dist/src/skills/repository.js +16 -13
- package/dist/src/skills/tools.js +1 -1
- package/dist/src/store/chunker.js +112 -0
- package/dist/src/store/chunks.js +125 -0
- package/dist/src/store/db.js +46 -7
- package/dist/src/store/embeddings.js +138 -0
- package/dist/src/store/recall.js +228 -0
- package/dist/src/store/search.js +67 -29
- package/dist/src/store/spelling.js +54 -0
- package/dist/src/store/sync.js +13 -3
- package/dist/src/web/routes.js +78 -35
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -45,6 +45,53 @@ the outdated ones deprecated" becomes `skill_search("deploy")` to find
|
|
|
45
45
|
candidates, then `skill_bulk_update(names, { deprecated: true })` to flag
|
|
46
46
|
the stale ones in one call — no need to touch each file individually.
|
|
47
47
|
|
|
48
|
+
## Retrieval
|
|
49
|
+
|
|
50
|
+
`bucket_recall` is the retrieval entry point: it takes a plain-language
|
|
51
|
+
question and returns the most relevant *passages* — heading-level sections,
|
|
52
|
+
with their text — packed into a `max_tokens` budget, so an agent gets the
|
|
53
|
+
one section it needs instead of searching, then loading a whole document.
|
|
54
|
+
No LLM is involved anywhere in indexing or retrieval:
|
|
55
|
+
|
|
56
|
+
- **Chunking.** Each doc body is split along its markdown headings (code
|
|
57
|
+
fences kept intact, oversized sections cut at paragraph boundaries) and
|
|
58
|
+
every chunk remembers its heading path.
|
|
59
|
+
- **Keyword ranking.** SQLite FTS5 with BM25, at two levels: per chunk, and
|
|
60
|
+
per doc with column weights so a hit in a skill's name, a memory doc's
|
|
61
|
+
key or filename, tags, or trigger phrases outranks the same word deep in
|
|
62
|
+
a body.
|
|
63
|
+
- **Semantic ranking.** A small sentence-embedding model
|
|
64
|
+
(`Xenova/bge-small-en-v1.5`, ~33 MB) runs locally on CPU via
|
|
65
|
+
transformers.js and embeds each chunk in the background, so a paraphrase
|
|
66
|
+
with no shared keyword ("step back after a mistake" → an undo/redo skill)
|
|
67
|
+
still matches. Only chunks whose text changed are re-embedded.
|
|
68
|
+
- **Fusion.** The three ranked lists are merged by reciprocal rank fusion.
|
|
69
|
+
- **Typo correction.** A query word found nowhere in the corpus is matched
|
|
70
|
+
to the closest word that is (edit distance 1–2, by word length), so
|
|
71
|
+
"tooltp" finds the tooltip skill. `bucket_recall` reports the correction
|
|
72
|
+
in its first line.
|
|
73
|
+
|
|
74
|
+
The model downloads once, on first start, into
|
|
75
|
+
`<base dir>/.memory-bucket-models`; until it has finished (or if the machine
|
|
76
|
+
is offline, or the optional `@huggingface/transformers` dependency failed to
|
|
77
|
+
install) `bucket_recall` answers from keyword ranking alone and says so in
|
|
78
|
+
its first line. Environment variables:
|
|
79
|
+
|
|
80
|
+
| Variable | Effect |
|
|
81
|
+
| --- | --- |
|
|
82
|
+
| `MEMORY_BUCKET_EMBEDDINGS=off` | Never load a model; keyword ranking only. |
|
|
83
|
+
| `MEMORY_BUCKET_EMBED_MODEL` | A different transformers.js feature-extraction model, e.g. `Xenova/multilingual-e5-small` for non-English content. Changing it re-embeds every chunk. |
|
|
84
|
+
| `MEMORY_BUCKET_SEMANTIC_MIN_SIMILARITY` | Cosine similarity a doc needs to appear in the web UI's results on meaning alone (default `0.6`, tuned for the default model — other models score on a different scale). |
|
|
85
|
+
|
|
86
|
+
`skill_search` / `memory_search` / `bucket_search` remain the keyword tools
|
|
87
|
+
that return a list of *docs* (and take metadata filters). Bare words must all
|
|
88
|
+
match; if no doc contains all of them, the query is retried matching any,
|
|
89
|
+
then with typo correction. Explicit syntax (quotes, `AND`/`OR`/`NOT`,
|
|
90
|
+
`prefix*`) is always taken literally.
|
|
91
|
+
|
|
92
|
+
The web UI's search box uses the same keyword search and, for a plain-words
|
|
93
|
+
query, also lists docs that match by meaning alone.
|
|
94
|
+
|
|
48
95
|
## Run
|
|
49
96
|
|
|
50
97
|
### Via npx
|