@cerefox/memory 1.5.0 → 1.6.1
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/AGENT_GUIDE.md +13 -4
- package/AGENT_QUICK_REFERENCE.md +14 -3
- package/README.md +3 -2
- package/dist/bin/cerefox.js +318 -136
- package/dist/frontend/assets/{index-C1JXZA9m.css → index-Dm_zCch4.css} +1 -1
- package/dist/frontend/assets/{index-D9z5yV9u.js → index-OqloGFwv.js} +2 -2
- package/dist/frontend/assets/index-OqloGFwv.js.map +1 -0
- package/dist/frontend/index.html +2 -2
- package/dist/server-assets/_shared/ef-meta/index.ts +3 -3
- package/dist/server-assets/_shared/mcp-tools/get-help-content.ts +4 -4
- package/dist/server-assets/_shared/mcp-tools/get-help.ts +15 -1
- package/dist/server-assets/_shared/mcp-tools/index.ts +3 -0
- package/dist/server-assets/_shared/mcp-tools/set-document-metadata.ts +133 -0
- package/dist/server-assets/db/migrations/0023_set_document_metadata.sql +16 -0
- package/dist/server-assets/db/rpcs.sql +116 -1
- package/dist/server-assets/db/schema.sql +1 -1
- package/docs/guides/cli.md +54 -1
- package/docs/guides/connect-agents.md +11 -8
- package/docs/guides/operational-cost.md +1 -1
- package/package.json +1 -1
- package/dist/frontend/assets/index-D9z5yV9u.js.map +0 -1
package/AGENT_GUIDE.md
CHANGED
|
@@ -15,7 +15,7 @@ It is not a message bus -- it is curated, versioned, searchable memory backed by
|
|
|
15
15
|
|
|
16
16
|
You'll be using **one** of these — whichever your user (or the harness) has configured:
|
|
17
17
|
|
|
18
|
-
1. **MCP tools (default)** — 12 named tools (`cerefox_search`, `cerefox_ingest`, …, `cerefox_get_help`) exposed by either a local MCP server (`@cerefox/memory` via npm, run as `cerefox mcp`) or the remote `cerefox-mcp` Edge Function. Tool names and parameters are documented in **The
|
|
18
|
+
1. **MCP tools (default)** — 12 named tools (`cerefox_search`, `cerefox_ingest`, …, `cerefox_get_help`) exposed by either a local MCP server (`@cerefox/memory` via npm, run as `cerefox mcp`) or the remote `cerefox-mcp` Edge Function. Tool names and parameters are documented in **The 13 Tools** below. This is the recommended path for purpose-built agent clients.
|
|
19
19
|
2. **Shell CLI (Bash tool)** — the same operations exposed as a local `cerefox …` command (the TypeScript CLI from `@cerefox/memory`, resource-verb shape — e.g. `cerefox document get`, `cerefox project list`), invoked via your Bash tool. Used when your user prefers not to install/configure an MCP server. The semantics are identical; only the surface differs. See **Using Cerefox via the CLI** near the bottom of this guide for the MCP-tool → CLI-command mapping and the small list of behavioural differences.
|
|
20
20
|
|
|
21
21
|
If you're not sure which mode you're in: check whether `cerefox_search` shows up in your tool list. If yes, use MCP. If no, ask your user where the Cerefox checkout lives — they'll have told you, typically in `CLAUDE.md`, `AGENTS.md`, or an equivalent project memory file.
|
|
@@ -34,7 +34,7 @@ The tool is intentionally MCP-only so an agent that has been dropped into Cerefo
|
|
|
34
34
|
|
|
35
35
|
---
|
|
36
36
|
|
|
37
|
-
## The
|
|
37
|
+
## The 13 Tools
|
|
38
38
|
|
|
39
39
|
### cerefox_search
|
|
40
40
|
|
|
@@ -654,6 +654,13 @@ Each of these comes from a real agent session, and each is easy to make.
|
|
|
654
654
|
not catch it if your replacement text is longer than what it replaced, since
|
|
655
655
|
there is then no net loss to report.
|
|
656
656
|
|
|
657
|
+
- **To change only tags, use `cerefox_set_document_metadata`, never `cerefox_ingest`.**
|
|
658
|
+
Ingest replaces the whole document, so re-sending it to set one tag carries the
|
|
659
|
+
full transcription risk for no reason. The metadata tool merges: the keys you
|
|
660
|
+
pass are set, everything else is left alone, so you do not need to read the
|
|
661
|
+
document first and cannot drop a tag another agent set. Pass `null` as a value
|
|
662
|
+
to remove a key.
|
|
663
|
+
|
|
657
664
|
- **Never partial-edit to fix a partial edit.** If a write leaves unexpected
|
|
658
665
|
structure, stop. Use `cerefox_list_versions`, retrieve the last good version,
|
|
659
666
|
and re-ingest cleanly. Repairing edits with more edits compounds the damage.
|
|
@@ -676,8 +683,10 @@ Each of these comes from a real agent session, and each is easy to make.
|
|
|
676
683
|
needs `cerefox_ingest`.
|
|
677
684
|
|
|
678
685
|
- **If a capability seems missing from one server, suspect your client first.**
|
|
679
|
-
Local and remote run the same code.
|
|
680
|
-
|
|
686
|
+
Local and remote run the same code. **Every `cerefox_get_help()` response
|
|
687
|
+
begins with the server's version and the operations it registers** — you do
|
|
688
|
+
not need a special topic, and the *absence* of that block is itself an answer:
|
|
689
|
+
a server that does not print it predates v1.5.0. If that
|
|
681
690
|
disagrees with your tool list, the client is holding a list it fetched before
|
|
682
691
|
an upgrade — clients cache it at connect time. Ask the user to restart the
|
|
683
692
|
client. Do not record a capability difference between servers as a fact; every
|
package/AGENT_QUICK_REFERENCE.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Cerefox Knowledge Base -- Agent Quick Reference
|
|
2
2
|
|
|
3
|
-
Cerefox is a persistent, shared knowledge base. You have **
|
|
3
|
+
Cerefox is a persistent, shared knowledge base. You have **17 MCP tools** (16 of them have CLI equivalents — `cerefox_get_help` is MCP-only). For the full guide, search Cerefox for "How AI Agents Use Cerefox" or call `cerefox_get_help` to retrieve this content over MCP.
|
|
4
4
|
|
|
5
5
|
## Tools
|
|
6
6
|
|
|
@@ -19,6 +19,7 @@ Cerefox is a persistent, shared knowledge base. You have **16 MCP tools** (15 of
|
|
|
19
19
|
| `cerefox_metadata_search` | Find or list docs by metadata, project, or time (no text query) | `metadata_filter`, `project_name` (list a project's docs), `updated_since`, `include_content` — **at least one** of metadata_filter/project_name/updated_since/created_since |
|
|
20
20
|
| `cerefox_list_metadata_keys` | Discover available metadata keys | (none required) |
|
|
21
21
|
| `cerefox_list_projects` | List all projects | (none required) |
|
|
22
|
+
| `cerefox_set_document_metadata` | Change tags WITHOUT resending content. **Merges** by default; a `null` value removes a key | `document_id`, `metadata` (required), `replace` (rare: set exactly this object), `author` |
|
|
22
23
|
| `cerefox_set_document_projects` | Set doc's project memberships to exactly the given list (destructive replace; metadata-only, no content change) | `document_id`, `project_names` (required) |
|
|
23
24
|
| `cerefox_get_audit_log` | Query write operation history | `document_id`, `author`, `operation`, `since` |
|
|
24
25
|
| `cerefox_get_help` | Retrieve Cerefox conventions (this reference) over MCP. **Call this whenever uncertain.** | `topic` (optional, case-insensitive H2 substring match) |
|
|
@@ -126,6 +127,7 @@ Same operations, same conventions. Full reference: [`docs/guides/cli.md`](docs/g
|
|
|
126
127
|
| `cerefox_get_relations` ⚑ | All relations touching a document, both directions | `document_id` |
|
|
127
128
|
| `cerefox_get_neighbors` ⚑ | Walk the graph along ONE relation type | `document_id`, `rel_type` (required), `depth`, `from_time`, `to_time`, `limit` |
|
|
128
129
|
| `cerefox_metadata_search` | `cerefox metadata search --metadata-filter '<json>' --requestor "<your-name>"` (list a project: `cerefox document list --project <name>`) |
|
|
130
|
+
| `cerefox_set_document_metadata` | `cerefox document set-metadata <id> --set key=value` (also `--remove key`, `--json '{...}'`, `--replace`) |
|
|
129
131
|
| `cerefox_set_document_projects` | `cerefox document set-projects <id> <name...> --author "<your-name>" --author-type agent` (or `--clear` to remove all) |
|
|
130
132
|
| `cerefox_get_audit_log` | `cerefox audit list --requestor "<your-name>"` (add `--json` for scripted access) |
|
|
131
133
|
| `cerefox_get_help` | `cerefox guides show agent-quick-reference` (or `cerefox guides list` for the full bundled-docs index) |
|
|
@@ -186,6 +188,13 @@ Each of these comes from a real agent session, and each is easy to make.
|
|
|
186
188
|
not catch it if your replacement text is longer than what it replaced, since
|
|
187
189
|
there is then no net loss to report.
|
|
188
190
|
|
|
191
|
+
- **To change only tags, use `cerefox_set_document_metadata`, never `cerefox_ingest`.**
|
|
192
|
+
Ingest replaces the whole document, so re-sending it to set one tag carries the
|
|
193
|
+
full transcription risk for no reason. The metadata tool merges: the keys you
|
|
194
|
+
pass are set, everything else is left alone, so you do not need to read the
|
|
195
|
+
document first and cannot drop a tag another agent set. Pass `null` as a value
|
|
196
|
+
to remove a key.
|
|
197
|
+
|
|
189
198
|
- **Never partial-edit to fix a partial edit.** If a write leaves unexpected
|
|
190
199
|
structure, stop. Use `cerefox_list_versions`, retrieve the last good version,
|
|
191
200
|
and re-ingest cleanly. Repairing edits with more edits compounds the damage.
|
|
@@ -208,8 +217,10 @@ Each of these comes from a real agent session, and each is easy to make.
|
|
|
208
217
|
needs `cerefox_ingest`.
|
|
209
218
|
|
|
210
219
|
- **If a capability seems missing from one server, suspect your client first.**
|
|
211
|
-
Local and remote run the same code.
|
|
212
|
-
|
|
220
|
+
Local and remote run the same code. **Every `cerefox_get_help()` response
|
|
221
|
+
begins with the server's version and the operations it registers** — you do
|
|
222
|
+
not need a special topic, and the *absence* of that block is itself an answer:
|
|
223
|
+
a server that does not print it predates v1.5.0. If that
|
|
213
224
|
disagrees with your tool list, the client is holding a list it fetched before
|
|
214
225
|
an upgrade — clients cache it at connect time. Ask the user to restart the
|
|
215
226
|
client. Do not record a capability difference between servers as a fact; every
|
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ This package contains a single binary, **`cerefox`**:
|
|
|
29
29
|
| Subcommand | What it does |
|
|
30
30
|
|---|---|
|
|
31
31
|
| `cerefox <command>` | CLI — search, ingest, list, version-history, audit-log, lifecycle (`init`, `doctor`, `configure-agent`, `self-update`). Callable from any directory. |
|
|
32
|
-
| `cerefox mcp` | Local stdio MCP server. Drop-in for Claude Code, Cursor, Claude Desktop, Codex CLI, Gemini CLI. Exposes the same
|
|
32
|
+
| `cerefox mcp` | Local stdio MCP server. Drop-in for Claude Code, Cursor, Claude Desktop, Codex CLI, Gemini CLI. Exposes the same 13 core MCP tools as the remote `cerefox-mcp` Edge Function, plus 4 document-relation tools that stay hidden until enabled. |
|
|
33
33
|
| `cerefox web` | Local web app at `http://localhost:8000` — React UI for browsing, searching, editing, and ingesting documents. Backed by an in-process Hono server that exposes the same `/api/v1/*` REST surface as the bundled Edge Functions. |
|
|
34
34
|
|
|
35
35
|
> **What this package isn't:** the source of truth for Cerefox's architecture
|
|
@@ -148,10 +148,11 @@ For manual configuration (any other MCP client), the canonical entry is:
|
|
|
148
148
|
```
|
|
149
149
|
|
|
150
150
|
Once configured, any of these clients can search + write your Cerefox KB via
|
|
151
|
-
the
|
|
151
|
+
the 13 core MCP tools (`cerefox_search`, `cerefox_ingest`, `cerefox_insert`,
|
|
152
152
|
`cerefox_edit`, `cerefox_get_document`, `cerefox_list_versions`,
|
|
153
153
|
`cerefox_list_projects`, `cerefox_list_metadata_keys`,
|
|
154
154
|
`cerefox_metadata_search`, `cerefox_set_document_projects`,
|
|
155
|
+
`cerefox_set_document_metadata`,
|
|
155
156
|
`cerefox_get_audit_log`, `cerefox_get_help`).
|
|
156
157
|
|
|
157
158
|
`cerefox_insert` and `cerefox_edit` change part of a document without resending
|