@cerefox/memory 1.14.1 → 1.14.3
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 +12 -1
- package/AGENT_QUICK_REFERENCE.md +9 -8
- package/dist/bin/cerefox.js +1004 -667
- package/dist/frontend/assets/{index-BC_iqEHZ.js → index-DUY9wimN.js} +29 -29
- package/dist/frontend/assets/index-DUY9wimN.js.map +1 -0
- package/dist/frontend/index.html +1 -1
- package/dist/server-assets/_shared/ef-meta/index.ts +3 -3
- package/dist/server-assets/_shared/mcp-tools/_utils.ts +8 -3
- package/dist/server-assets/_shared/mcp-tools/get-help-content.ts +2 -2
- package/dist/server-assets/_shared/mcp-tools/metadata-search.ts +90 -19
- package/dist/server-assets/_shared/mcp-tools/search.ts +306 -50
- package/dist/server-assets/supabase/functions/cerefox-search/index.ts +75 -35
- package/docs/guides/connect-agents.md +15 -4
- package/docs/guides/response-limits.md +25 -3
- package/package.json +3 -3
- package/dist/frontend/assets/index-BC_iqEHZ.js.map +0 -1
package/AGENT_GUIDE.md
CHANGED
|
@@ -49,7 +49,7 @@ Find documents using hybrid search (full-text + semantic vector similarity).
|
|
|
49
49
|
| `max_bytes` | No | Response size budget in bytes (default 200000). |
|
|
50
50
|
| `author` | No | Your agent name for attribution. Always set this. |
|
|
51
51
|
|
|
52
|
-
**Results format**: Each result shows `## Title [id: <uuid>] (score: X.XXX)` followed by content.
|
|
52
|
+
**Results format**: Each result shows `## Title [id: <uuid>] (score: X.XXX)` followed by content (in `hybrid` and `fts` modes the heading also carries the section path and the chunk index: `## Title › Section › Subsection [id: <uuid>] (chunk 4) (score: …)`).
|
|
53
53
|
Save the `document_id` from `[id: ...]` -- you need it for `cerefox_get_document` and `cerefox_ingest` updates.
|
|
54
54
|
|
|
55
55
|
For large documents, results may be partial (`is_partial` flag). Use `cerefox_get_document` with the ID to get the full text.
|
|
@@ -226,6 +226,17 @@ No `expected_content_hash`: a trashed document cannot be concurrently edited, so
|
|
|
226
226
|
|
|
227
227
|
---
|
|
228
228
|
|
|
229
|
+
### A note on `max_bytes` and search
|
|
230
|
+
|
|
231
|
+
`cerefox_search` returns **complete documents**, so `max_bytes` has to be
|
|
232
|
+
large enough for the biggest one you might match. A budget smaller than the
|
|
233
|
+
top hit fits nothing, and you will get a header-only list that names what
|
|
234
|
+
matched, its size and its id, prefixed with a warning. That list is not an
|
|
235
|
+
empty result: raise `max_bytes`, or read a single document with
|
|
236
|
+
`cerefox_get_document` (`outline: true` for structure, `section` for one
|
|
237
|
+
part). **"No results found." is reserved for a query that genuinely matched
|
|
238
|
+
nothing** (v1.14.2, #254 — before that, a budget miss reported it too).
|
|
239
|
+
|
|
229
240
|
### cerefox_list_versions
|
|
230
241
|
|
|
231
242
|
Show version history of a document.
|
package/AGENT_QUICK_REFERENCE.md
CHANGED
|
@@ -76,14 +76,15 @@ recoverable answer, not a failure: retry with what it gave you.
|
|
|
76
76
|
2. **Prefer ID-based updates** -- pass `document_id` from search results for deterministic updates. Falls back to title-matching with `update_if_exists: true`.
|
|
77
77
|
3. **Set `author`** to your name on every call, reads and writes alike (e.g., "Claude Code", "archiver"). Same parameter on every tool. (`requestor` is still accepted everywhere as the pre-1.13.1 alias.) On the CLI it is `--author` on every command too (plus `--author-type` on writes); or rely on `CEREFOX_AUTHOR_NAME`/`CEREFOX_AUTHOR_TYPE` env vars set in the user's `.env`.
|
|
78
78
|
4. **Use `document_id` from search results** `[id: uuid]` for get_document and list_versions.
|
|
79
|
-
5.
|
|
80
|
-
6. **
|
|
81
|
-
7. **
|
|
82
|
-
8. **
|
|
83
|
-
9. **
|
|
84
|
-
10. **
|
|
85
|
-
11. **
|
|
86
|
-
12. **
|
|
79
|
+
5. **`max_bytes` has to fit a whole document.** Search returns COMPLETE documents, so a budget smaller than the top hit fits nothing. You get a header-only list saying so (never "No results found." — that means the store really has nothing). Raise `max_bytes`, or read one document with `cerefox_get_document` using `outline: true` or `section`.
|
|
80
|
+
6. **Add metadata** -- at minimum `type` ("decision-log", "research", "design-doc") and `status` ("active", "draft").
|
|
81
|
+
7. **Write structured Markdown** with H1/H2/H3 headings for good chunking and search.
|
|
82
|
+
8. **Deletes are soft (recoverable); permanent purge is web-UI-only.** `cerefox_delete_document` requires the document's `content_hash` as you read it (read before you delete) and takes a `reason` — give one; it is what the human reviewing the trash sees. `cerefox_restore_document` undoes a mistaken delete (also audited, also takes a `reason`). Always surface deletes AND restores to the user. Once a human purges from the web UI, the document is gone for good.
|
|
83
|
+
9. **Cross-doc links inside content**: **always use `[Text](document-uuid)`.** UUIDs are the only fully reliable link form — stable across title changes, never ambiguous, no encoding gotchas. Every `cerefox_search` result shows `[id: <uuid>]` after the title; grab it and use it. Title-based linking (`[Text](<Title With Spaces>)`) is fragile (breaks on colons, parens, ampersands, brackets — silently navigates to wrong page) — **don't write title-based links**; do an extra search to get the UUID instead. Repo-path forms (`[Text](docs/path.md)`) exist for repo-ingested files; don't construct manually. **The server validates `](uuid)` links on every write** (v1.7.0): a link to a nonexistent id rejects the write, naming the offender — that means you mangled the UUID; re-read the source and correct it, do not retry unchanged. Example ids go in backticks (code is not validated). `[[Wikilinks]]` may dangle. See `AGENT_GUIDE.md → Writing linkable content` for the full rule.
|
|
84
|
+
10. **Concurrency: content updates require `expected_content_hash`.** Pass the `content_hash` you last saw — every read shows one (`cerefox_get_document` incl. outline mode, `cerefox_search`, `cerefox_metadata_search`) and **every write returns the new one, including create** (v1.3.0, #189), so after writing you already hold the token for your next edit; no re-read needed. If it's stale you get a **conflict** — re-read the document, merge your changes into the latest content, retry with the new hash. **Never resolve a conflict by overwriting blindly** — the current content includes another writer's work. `last_write_wins: true` skips the check; use it ONLY when an external source of truth makes conflicts meaningless (file re-sync), never to silence a conflict.
|
|
85
|
+
11. **Search: prefer a few distinctive terms; heed `below confidence`.** When nothing clears the relevance threshold, `cerefox_search` returns the closest candidates prefixed with a `below confidence` warning instead of an empty set — that flag means **weak signal, not absent knowledge**: check the candidates' scores and titles before concluding the KB lacks the content. A truly empty response means nothing even weakly related exists.
|
|
86
|
+
12. **Relations express how documents relate; lifecycle tells you if knowledge is still good.** Use `cerefox_set_relation` when one document supersedes, contradicts, references, or continues another. `supersedes` marks the target **superseded**; `contradicts` marks **both** stale; `related_to`/`duplicates`/`contradicts` are symmetric (both directions written). Any other type string is accepted without special behaviour. When a search result or `cerefox_get_relations` shows a neighbour marked `[superseded]` or `[stale]`, say so rather than presenting it as current.
|
|
87
|
+
13. **Project memberships — non-destructive by default**: on `cerefox_ingest` updates, **`project_name` (singular) is a non-destructive add** (ensures membership, preserves others). Use **`project_names` (list)** when you want to set the doc's full project set in one call (destructive replace). For metadata-only project changes without writing content, use **`cerefox_set_document_projects(document_id, project_names)`** — that tool is the destructive-replace contract made explicit. Never call `cerefox_set_document_projects` with a single name when you mean "add" — that would REMOVE the doc from all other projects. When in doubt, use `cerefox_ingest` with singular `project_name`.
|
|
87
88
|
|
|
88
89
|
## Update Workflow (ID-based -- preferred)
|
|
89
90
|
|