@cerefox/memory 0.8.3 → 0.9.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 +28 -26
- package/AGENT_QUICK_REFERENCE.md +12 -12
- package/dist/bin/cerefox.js +614 -347
- package/dist/frontend/assets/{index-CAp2_lFX.js → index-De3R6K8J.js} +29 -29
- package/dist/frontend/assets/{index-CAp2_lFX.js.map → index-De3R6K8J.js.map} +1 -1
- package/dist/frontend/index.html +1 -1
- package/dist/server-assets/_shared/ef-meta/index.ts +1 -1
- package/dist/server-assets/_shared/mcp-tools/get-help-content.ts +2 -2
- package/docs/guides/access-paths.md +44 -38
- package/docs/guides/cli.md +206 -64
- package/docs/guides/configuration.md +28 -37
- package/docs/guides/connect-agents.md +157 -180
- package/docs/guides/operational-cost.md +1 -1
- package/docs/guides/ops-scripts.md +74 -54
- package/docs/guides/quickstart.md +28 -22
- package/docs/guides/setup-cloud-run.md +12 -2
- package/docs/guides/setup-local.md +16 -10
- package/docs/guides/setup-supabase.md +57 -162
- package/docs/guides/upgrading.md +44 -31
- package/package.json +1 -1
|
@@ -34,14 +34,14 @@ Three top-level paths plus a few special cases:
|
|
|
34
34
|
| Cursor (remote) | Path A-Remote — `cerefox-mcp` Edge Function | Hybrid | URL + anon key only; no local install |
|
|
35
35
|
| OpenAI Codex CLI (remote) | Path A-Remote — `cerefox-mcp` Edge Function | Hybrid | URL + anon key env var; TOML config |
|
|
36
36
|
| ChatGPT (chatgpt.com or desktop) | Path B — Custom GPT → Edge Functions | Hybrid | ChatGPT Plus required |
|
|
37
|
-
| Claude Desktop (local) | Path A-Local — `@cerefox/memory` via `npx`
|
|
38
|
-
| Claude Code (local) | Path A-Local — `@cerefox/memory` via `npx`
|
|
39
|
-
| Cursor (local) | Path A-Local — `@cerefox/memory` via `npx`
|
|
37
|
+
| Claude Desktop (local) | Path A-Local — `@cerefox/memory` via `npx` | Hybrid | Local alternative; Node.js; zero Edge Function invocations |
|
|
38
|
+
| Claude Code (local) | Path A-Local — `@cerefox/memory` via `npx` | Hybrid | Local alternative; zero Edge Function invocations |
|
|
39
|
+
| Cursor (local) | Path A-Local — `@cerefox/memory` via `npx` | Hybrid | Local alternative; zero Edge Function invocations |
|
|
40
40
|
| Cloud Claude (claude.ai web) | Remote Supabase MCP | FTS only | No install; search quality limited |
|
|
41
41
|
| Gemini CLI (remote) | Path A-Remote — `cerefox-mcp` Edge Function | Hybrid | URL + anon key only; no local install |
|
|
42
|
-
| Local coding agents (Claude Code, Codex CLI, opencode, OpenClaw, Hermes, …) | Path C — Shell CLI (Bash tool) | Hybrid |
|
|
42
|
+
| Local coding agents (Claude Code, Codex CLI, opencode, OpenClaw, Hermes, …) | Path C — Shell CLI (Bash tool) | Hybrid | `npm install -g @cerefox/memory`; agent runs `cerefox …` as a shell command. Useful when MCP setup is friction. |
|
|
43
43
|
| curl / scripts | Path B — Edge Functions directly | Hybrid | Direct HTTP; no client needed |
|
|
44
|
-
| Custom Python agents | Python SDK directly | Hybrid | Local Python
|
|
44
|
+
| Custom Python agents | Python SDK directly (legacy) | Hybrid | Local Python + repo clone; the Python path is legacy/frozen |
|
|
45
45
|
|
|
46
46
|
> **"Hybrid"** = FTS + semantic, document-level (complete reconstructed notes, not isolated chunks).
|
|
47
47
|
> **"FTS only"** = keyword search only; no semantic/vector search.
|
|
@@ -65,16 +65,17 @@ Three top-level paths plus a few special cases:
|
|
|
65
65
|
|
|
66
66
|
**For all paths:**
|
|
67
67
|
- Supabase project set up and schema deployed (see `setup-supabase.md`)
|
|
68
|
-
- Some content ingested (`cerefox ingest my-notes.md`)
|
|
68
|
+
- Some content ingested (`cerefox document ingest my-notes.md`)
|
|
69
69
|
|
|
70
70
|
**For Path A-Local only:**
|
|
71
|
-
-
|
|
71
|
+
- [Node.js ≥20](https://nodejs.org) (for `npx --package=@cerefox/memory cerefox mcp`, or a
|
|
72
|
+
global `npm install -g @cerefox/memory`)
|
|
72
73
|
+ `.env` file in the working directory the client launches the server from (see "env block"
|
|
73
74
|
in the per-client configs below if your client can't see the file)
|
|
74
|
-
-
|
|
75
|
-
+ `.env` in the checkout
|
|
76
|
-
- Either way, `.env` must define `CEREFOX_SUPABASE_URL`, `CEREFOX_SUPABASE_KEY`, and your
|
|
75
|
+
- `.env` must define `CEREFOX_SUPABASE_URL`, `CEREFOX_SUPABASE_KEY`, and your
|
|
77
76
|
embedding API key (`OPENAI_API_KEY`)
|
|
77
|
+
- A frozen Python MCP server still exists as a standalone fallback (`uv run cerefox mcp` from a
|
|
78
|
+
repo clone), but the npm package is the maintained path.
|
|
78
79
|
|
|
79
80
|
> **Important — which anon key to use (2026):** Path A-Remote and Path B both require an
|
|
80
81
|
> "anon key" as a Bearer token. As of 2026, you **must** use the **legacy anon JWT**
|
|
@@ -91,10 +92,11 @@ Three top-level paths plus a few special cases:
|
|
|
91
92
|
- For Claude Code: [Node.js](https://nodejs.org) for `npx mcp-remote` (recommended), or no extra deps for native HTTP
|
|
92
93
|
|
|
93
94
|
**For Path B (Edge Functions / GPT Actions) only:**
|
|
94
|
-
- Supabase Edge Functions deployed
|
|
95
|
-
`cerefox-
|
|
96
|
-
`cerefox-metadata-search`, `cerefox-list-projects`
|
|
97
|
-
|
|
95
|
+
- Supabase Edge Functions deployed (all 9, including `cerefox-mcp`): `cerefox-search`,
|
|
96
|
+
`cerefox-ingest`, `cerefox-metadata`, `cerefox-get-document`, `cerefox-list-versions`,
|
|
97
|
+
`cerefox-get-audit-log`, `cerefox-metadata-search`, `cerefox-list-projects`, `cerefox-mcp`.
|
|
98
|
+
End-user path: `cerefox server deploy`. Contributor/manual path: `npx supabase functions
|
|
99
|
+
deploy` (see `setup-supabase.md`).
|
|
98
100
|
- Your **legacy anon JWT** (see callout above): Supabase Dashboard → Project Settings → API Keys → Legacy → anon
|
|
99
101
|
- Your **project ref**: visible in the Supabase Dashboard URL
|
|
100
102
|
(`app.supabase.com/project/<project-ref>`)
|
|
@@ -111,23 +113,22 @@ Three top-level paths plus a few special cases:
|
|
|
111
113
|
The local Cerefox MCP server runs on your machine and exposes the same 10 tools as the remote
|
|
112
114
|
Edge Function, communicating with clients over stdio.
|
|
113
115
|
|
|
114
|
-
|
|
116
|
+
The local server ships as an npm package — **[`@cerefox/memory`](https://www.npmjs.com/package/@cerefox/memory)** — built with the official `@modelcontextprotocol/sdk`.
|
|
115
117
|
The bin entry is `cerefox` (run as `cerefox mcp`). The recommended client config is `npx -y --package=@cerefox/memory cerefox mcp`, or if you've installed the package globally, just `cerefox mcp`.
|
|
116
118
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
Pick one explicitly in your MCP client config.
|
|
119
|
+
A separate, **frozen** Python MCP server still exists as a standalone fallback — invoke it
|
|
120
|
+
explicitly with `uv run cerefox mcp` from a Cerefox repo clone. It is independent and
|
|
121
|
+
unmaintained; the npm package is the maintained path. (A "soft wrapper" that auto-delegated
|
|
122
|
+
the Python `cerefox mcp` to the npm package was removed in v0.5.2 — the two are now fully
|
|
123
|
+
separate. Pick one explicitly in your MCP client config.)
|
|
123
124
|
|
|
124
125
|
- Embeddings are computed locally using your `.env` key (no extra credentials)
|
|
125
126
|
- Works offline except for the OpenAI embedding API call per query
|
|
126
127
|
- One setup, all compatible local clients (Claude Desktop, Cursor, Claude Code, Codex CLI, …)
|
|
127
128
|
|
|
128
|
-
See [`docs/guides/migration-v0.5.md`](migration-v0.5.md)
|
|
129
|
-
|
|
130
|
-
|
|
129
|
+
See [`docs/guides/migration-v0.5.md`](migration-v0.5.md) and
|
|
130
|
+
[`docs/guides/migration-v0.9.md`](migration-v0.9.md) for the per-client config snippets and
|
|
131
|
+
the upgrade path.
|
|
131
132
|
|
|
132
133
|
> **Why not `mcp-server-fetch`?** The generic fetch MCP only supports GET requests and cannot
|
|
133
134
|
> make authenticated POST calls to the Edge Functions. The built-in local server is
|
|
@@ -189,7 +190,7 @@ For the full tool reference, search Cerefox for "How AI Agents Use Cerefox".
|
|
|
189
190
|
|
|
190
191
|
> **Agent reference docs**: `AGENT_GUIDE.md` (comprehensive) and `AGENT_QUICK_REFERENCE.md` (quick
|
|
191
192
|
> reference) in the repo root contain the full tool reference for AI agents. These are also
|
|
192
|
-
> ingested into the Cerefox KB via `sync_docs.
|
|
193
|
+
> ingested into the Cerefox KB via `bun scripts/sync_docs.ts`, so agents can find them by searching.
|
|
193
194
|
|
|
194
195
|
### Path A verification prompts
|
|
195
196
|
|
|
@@ -211,53 +212,17 @@ After setup, ask your client:
|
|
|
211
212
|
|
|
212
213
|
### Claude Desktop
|
|
213
214
|
|
|
214
|
-
**
|
|
215
|
-
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
216
|
-
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
217
|
-
|
|
218
|
-
**Recommended — npm (`@cerefox/memory`, v0.4.0+):**
|
|
215
|
+
**Recommended — let the CLI write it:**
|
|
219
216
|
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
"mcpServers": {
|
|
223
|
-
"cerefox": {
|
|
224
|
-
"command": "npx",
|
|
225
|
-
"args": ["-y", "--package=@cerefox/memory", "cerefox", "mcp"],
|
|
226
|
-
"env": {
|
|
227
|
-
"CEREFOX_SUPABASE_URL": "https://<your-project-ref>.supabase.co",
|
|
228
|
-
"CEREFOX_SUPABASE_KEY": "<your-service-role-or-sb_secret-key>",
|
|
229
|
-
"OPENAI_API_KEY": "sk-..."
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
```
|
|
235
|
-
|
|
236
|
-
The `env` block is only needed if you don't already have a `.env` file in a directory the
|
|
237
|
-
server can find — the server resolves `.env` from the current working directory.
|
|
238
|
-
|
|
239
|
-
**Alternative — local checkout (Python or pre-v0.4 setups):**
|
|
240
|
-
|
|
241
|
-
```json
|
|
242
|
-
{
|
|
243
|
-
"mcpServers": {
|
|
244
|
-
"cerefox": {
|
|
245
|
-
"command": "uv",
|
|
246
|
-
"args": ["--directory", "/path/to/cerefox", "run", "cerefox", "mcp"]
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
}
|
|
217
|
+
```bash
|
|
218
|
+
cerefox configure-agent --tool claude-desktop
|
|
250
219
|
```
|
|
251
220
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
This invocation soft-wraps `npx --package=@cerefox/memory cerefox mcp` when available; otherwise the
|
|
255
|
-
legacy Python MCP server takes over.
|
|
221
|
+
This writes the local-stdio entry into your `claude_desktop_config.json` and backs up the
|
|
222
|
+
existing file. Then restart Claude Desktop fully (Cmd+Q on macOS, not just close the window).
|
|
256
223
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
in an extra `{}` or replace the whole file.
|
|
260
|
-
- Restart Claude Desktop fully (Cmd+Q on macOS, not just close the window) after saving.
|
|
224
|
+
For the manual JSON (for the curious, or to debug if the CLI can't write your config), see
|
|
225
|
+
[Appendix: manual per-client config](#appendix-manual-per-client-config).
|
|
261
226
|
|
|
262
227
|
---
|
|
263
228
|
|
|
@@ -275,44 +240,17 @@ legacy Python MCP server takes over.
|
|
|
275
240
|
|
|
276
241
|
### Cursor
|
|
277
242
|
|
|
278
|
-
|
|
279
|
-
2. Paste either of the following into the MCP config JSON:
|
|
280
|
-
|
|
281
|
-
**Recommended — npm:**
|
|
282
|
-
|
|
283
|
-
```json
|
|
284
|
-
{
|
|
285
|
-
"mcpServers": {
|
|
286
|
-
"cerefox": {
|
|
287
|
-
"command": "npx",
|
|
288
|
-
"args": ["-y", "--package=@cerefox/memory", "cerefox", "mcp"],
|
|
289
|
-
"env": {
|
|
290
|
-
"CEREFOX_SUPABASE_URL": "https://<your-project-ref>.supabase.co",
|
|
291
|
-
"CEREFOX_SUPABASE_KEY": "<your-service-role-or-sb_secret-key>",
|
|
292
|
-
"OPENAI_API_KEY": "sk-..."
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
**Alternative — local checkout:**
|
|
243
|
+
**Recommended — let the CLI write it:**
|
|
300
244
|
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
"mcpServers": {
|
|
304
|
-
"cerefox": {
|
|
305
|
-
"command": "uv",
|
|
306
|
-
"args": ["--directory", "/path/to/cerefox", "run", "cerefox", "mcp"]
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
}
|
|
245
|
+
```bash
|
|
246
|
+
cerefox configure-agent --tool cursor
|
|
310
247
|
```
|
|
311
248
|
|
|
312
|
-
|
|
249
|
+
This writes the local-stdio entry into `~/.cursor/mcp.json`. Save and restart Cursor.
|
|
313
250
|
|
|
314
|
-
|
|
315
|
-
|
|
251
|
+
For project-scoped access, copy the generated entry into a `.cursor/mcp.json` in your project
|
|
252
|
+
root (committed to git, shared with your team). For the manual JSON, see
|
|
253
|
+
[Appendix: manual per-client config](#appendix-manual-per-client-config).
|
|
316
254
|
|
|
317
255
|
---
|
|
318
256
|
|
|
@@ -321,49 +259,21 @@ project-scoped access (committed to git, shared with your team).
|
|
|
321
259
|
Claude Code (the CLI tool and the **Code** tab inside Claude Desktop) uses its own MCP config —
|
|
322
260
|
separate from `claude_desktop_config.json`. Changes made in one do not affect the other.
|
|
323
261
|
|
|
324
|
-
**
|
|
262
|
+
**Recommended — let the CLI write it:**
|
|
325
263
|
|
|
326
264
|
```bash
|
|
327
|
-
|
|
328
|
-
npx -- -y --package=@cerefox/memory cerefox mcp
|
|
265
|
+
cerefox configure-agent --tool claude-code
|
|
329
266
|
```
|
|
330
267
|
|
|
331
|
-
|
|
332
|
-
- Use `--scope project` instead to limit it to the current directory (stored in `.mcp.json`).
|
|
333
|
-
|
|
334
|
-
If you don't already have `.env` resolvable from your shell's CWD, add the credentials inline
|
|
335
|
-
by editing the resulting JSON config to add an `env` block (see the Claude Desktop example
|
|
336
|
-
above).
|
|
337
|
-
|
|
338
|
-
Verify:
|
|
268
|
+
This runs the right `claude mcp add` for you. Verify with:
|
|
339
269
|
```bash
|
|
340
270
|
claude mcp list
|
|
341
271
|
```
|
|
342
272
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
uv -- --directory /path/to/cerefox run cerefox mcp
|
|
348
|
-
```
|
|
349
|
-
|
|
350
|
-
This soft-wraps `npx --package=@cerefox/memory cerefox mcp` when available; otherwise falls back to
|
|
351
|
-
the legacy Python MCP server.
|
|
352
|
-
|
|
353
|
-
**Option 3: `.mcp.json` in project root (project-scoped, committable)**
|
|
354
|
-
|
|
355
|
-
Create `.mcp.json` in the root of the repo you work in:
|
|
356
|
-
|
|
357
|
-
```json
|
|
358
|
-
{
|
|
359
|
-
"mcpServers": {
|
|
360
|
-
"cerefox": {
|
|
361
|
-
"command": "npx",
|
|
362
|
-
"args": ["-y", "--package=@cerefox/memory", "cerefox", "mcp"]
|
|
363
|
-
}
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
```
|
|
273
|
+
If you don't already have `.env` resolvable from your shell's CWD, edit the resulting JSON
|
|
274
|
+
config to add an `env` block (see the manual config in the
|
|
275
|
+
[Appendix](#appendix-manual-per-client-config)). For project-scoped access, drop a `.mcp.json`
|
|
276
|
+
in the repo root with the same local-stdio entry (committable, shared with your team).
|
|
367
277
|
|
|
368
278
|
**Code tab inside Claude Desktop:**
|
|
369
279
|
The **Code** tab in Claude Desktop uses the same config as the Claude Code CLI, not
|
|
@@ -399,10 +309,13 @@ https://<your-project-ref>.supabase.co/functions/v1/cerefox-mcp
|
|
|
399
309
|
| Offline use or development on the cerefox codebase | Path A-Local -- no network dependency |
|
|
400
310
|
| Lowest latency (same machine, no HTTPS round-trip) | Path A-Local -- slightly faster |
|
|
401
311
|
|
|
402
|
-
**Deploy the Edge
|
|
312
|
+
**Deploy the Edge Functions** (end-user path — deploys schema, RPCs, and all 9 Edge Functions
|
|
313
|
+
from assets bundled in the npm package, no repo clone):
|
|
403
314
|
```bash
|
|
404
|
-
|
|
315
|
+
cerefox server deploy
|
|
405
316
|
```
|
|
317
|
+
Contributors working from a repo clone can deploy a single function manually with
|
|
318
|
+
`npx supabase functions deploy cerefox-mcp`.
|
|
406
319
|
|
|
407
320
|
---
|
|
408
321
|
|
|
@@ -1148,19 +1061,19 @@ Claude.ai web can connect to the Supabase-hosted remote MCP (no local install):
|
|
|
1148
1061
|
|
|
1149
1062
|
### What it is
|
|
1150
1063
|
|
|
1151
|
-
Modern local coding agents — Claude Code, OpenAI Codex CLI, opencode, OpenClaw, Hermes, and many others — all expose a **Bash tool** (or similar shell-execution tool) to their underlying model. If the agent's user
|
|
1064
|
+
Modern local coding agents — Claude Code, OpenAI Codex CLI, opencode, OpenClaw, Hermes, and many others — all expose a **Bash tool** (or similar shell-execution tool) to their underlying model. If the agent's user has installed the Cerefox CLI (`npm install -g @cerefox/memory`), the agent can read and write the knowledge base by running `cerefox …` exactly the same way a human would.
|
|
1152
1065
|
|
|
1153
|
-
This is **not a separate Cerefox installation path** — it's the same Layer 2 access (
|
|
1066
|
+
This is **not a separate Cerefox installation path** — it's the same Layer 2 access (REST + service-role key) that you already use as a human via the CLI. What's new is the *usage model*: the user authorizes a local agent to use that CLI on their behalf, instead of (or alongside) configuring MCP.
|
|
1154
1067
|
|
|
1155
1068
|
When to choose Path C over Path A:
|
|
1156
1069
|
|
|
1157
1070
|
- **No MCP setup friction** — the agent already has a Bash tool; no `.mcp.json`, no `claude mcp add`, no Claude Desktop config edits.
|
|
1158
|
-
- **One Cerefox
|
|
1071
|
+
- **One Cerefox CLI install serves any number of local agents** — Claude Code, Codex CLI, opencode, etc. running in the same project all use the same `cerefox …` commands.
|
|
1159
1072
|
- **Best for power users who already use the CLI themselves** — the agent and the user share one mental model and one set of conventions.
|
|
1160
1073
|
|
|
1161
1074
|
When Path A is still better:
|
|
1162
1075
|
|
|
1163
|
-
- Cleaner agent UX — named tool calls (`cerefox_search(...)`) read better in agent transcripts than `Bash("
|
|
1076
|
+
- Cleaner agent UX — named tool calls (`cerefox_search(...)`) read better in agent transcripts than `Bash("cerefox search 'foo'")`.
|
|
1164
1077
|
- Some agents may rate-limit or budget Bash calls separately from MCP calls.
|
|
1165
1078
|
- Cloud-only agents (claude.ai, chatgpt.com) cannot use Path C at all — they have no Bash tool.
|
|
1166
1079
|
|
|
@@ -1168,16 +1081,14 @@ When Path A is still better:
|
|
|
1168
1081
|
|
|
1169
1082
|
Same as **Path A-Local**:
|
|
1170
1083
|
|
|
1171
|
-
- [
|
|
1172
|
-
-
|
|
1173
|
-
- `.env` configured with `CEREFOX_SUPABASE_URL`, `CEREFOX_SUPABASE_KEY` (service-role / new secret key), and your embedding API key (`OPENAI_API_KEY`)
|
|
1084
|
+
- [Node.js ≥20](https://nodejs.org) + the CLI installed: `npm install -g @cerefox/memory`
|
|
1085
|
+
- `.env` configured (resolved from the working directory) with `CEREFOX_SUPABASE_URL`, `CEREFOX_SUPABASE_KEY` (service-role / new secret key), and your embedding API key (`OPENAI_API_KEY`)
|
|
1174
1086
|
|
|
1175
1087
|
Quick sanity check before pointing an agent at it:
|
|
1176
1088
|
|
|
1177
1089
|
```bash
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
uv run cerefox list-projects
|
|
1090
|
+
cerefox search "any query"
|
|
1091
|
+
cerefox project list
|
|
1181
1092
|
```
|
|
1182
1093
|
|
|
1183
1094
|
If both work for you, they'll work for the agent.
|
|
@@ -1186,8 +1097,8 @@ If both work for you, they'll work for the agent.
|
|
|
1186
1097
|
|
|
1187
1098
|
The pattern is the same across Claude Code, Codex CLI, opencode, OpenClaw, Hermes, and similar tools:
|
|
1188
1099
|
|
|
1189
|
-
1. **
|
|
1190
|
-
2. **Point the agent at the agent docs
|
|
1100
|
+
1. **Confirm the `cerefox` CLI is installed and on PATH** (`npm install -g @cerefox/memory`) with a resolvable `.env`.
|
|
1101
|
+
2. **Point the agent at the agent docs**: `AGENT_GUIDE.md` and `AGENT_QUICK_REFERENCE.md` (repo root, also retrievable over MCP via `cerefox_get_help`). These describe what to read, what to write, and the audit/metadata conventions. They cover MCP usage; the CLI mapping is in `AGENT_GUIDE.md` ("Using Cerefox via the CLI").
|
|
1191
1102
|
3. **Optionally**: add a one-line reminder in the agent's system prompt so the model defaults to using Cerefox proactively.
|
|
1192
1103
|
|
|
1193
1104
|
Example system-prompt snippet (adapt for your agent — Claude Code's `CLAUDE.md`, Codex's `AGENTS.md`, opencode's project config, etc.):
|
|
@@ -1195,16 +1106,16 @@ Example system-prompt snippet (adapt for your agent — Claude Code's `CLAUDE.md
|
|
|
1195
1106
|
```
|
|
1196
1107
|
You have access to a personal Cerefox knowledge base via a local CLI.
|
|
1197
1108
|
|
|
1198
|
-
-
|
|
1199
|
-
|
|
1200
|
-
- Read AGENT_GUIDE.md and AGENT_QUICK_REFERENCE.md
|
|
1201
|
-
|
|
1202
|
-
|
|
1109
|
+
- Run any command with: cerefox <subcommand> (resource-verb shape, e.g.
|
|
1110
|
+
`cerefox document get`, `cerefox project list`, `cerefox metadata search`)
|
|
1111
|
+
- Read AGENT_GUIDE.md and AGENT_QUICK_REFERENCE.md for conventions, metadata
|
|
1112
|
+
rules, and the MCP-tool → CLI-command mapping. Full per-flag reference:
|
|
1113
|
+
docs/guides/cli.md.
|
|
1203
1114
|
|
|
1204
1115
|
Identify yourself on every call:
|
|
1205
|
-
- Writes (ingest, ingest-dir): pass --author "<your-name>" --author-type agent
|
|
1206
|
-
- Reads (search, get
|
|
1207
|
-
|
|
1116
|
+
- Writes (document ingest, document ingest-dir): pass --author "<your-name>" --author-type agent
|
|
1117
|
+
- Reads (search, document get, document version list, project list,
|
|
1118
|
+
metadata search, audit list): pass --requestor "<your-name>"
|
|
1208
1119
|
|
|
1209
1120
|
When answering questions, search Cerefox first. When the user asks you to
|
|
1210
1121
|
remember something, ingest it. Cite document titles for every claim drawn
|
|
@@ -1217,54 +1128,61 @@ The agent docs are written around MCP tool names. **CLI flag names match MCP par
|
|
|
1217
1128
|
|
|
1218
1129
|
| MCP tool | CLI command |
|
|
1219
1130
|
|---|---|
|
|
1220
|
-
| `cerefox_search` | `
|
|
1221
|
-
| `cerefox_ingest` (file) | `
|
|
1222
|
-
| `cerefox_ingest` (paste) | `printf '...' \|
|
|
1223
|
-
| `cerefox_get_document` | `
|
|
1224
|
-
| `cerefox_list_versions` | `
|
|
1225
|
-
| `cerefox_list_projects` | `
|
|
1226
|
-
| `cerefox_list_metadata_keys` | `
|
|
1227
|
-
| `cerefox_metadata_search` | `
|
|
1228
|
-
| `cerefox_get_audit_log` | `
|
|
1131
|
+
| `cerefox_search` | `cerefox search "<query>" --match-count N --project-name <n> --metadata-filter '<json>' --requestor <name>` (CLI-only: `--mode`, `--alpha`, `--min-score`, `--only-metadata`) |
|
|
1132
|
+
| `cerefox_ingest` (file) | `cerefox document ingest <path> --title <t> --project-name <n> --metadata '<json>' --update-if-exists\|--document-id <uuid> --source <s> --author <a> --author-type user\|agent` |
|
|
1133
|
+
| `cerefox_ingest` (paste) | `printf '...' \| cerefox document ingest --paste --title "<title>"` (same flags) |
|
|
1134
|
+
| `cerefox_get_document` | `cerefox document get <document-id> --version-id <vid> --requestor <name>` |
|
|
1135
|
+
| `cerefox_list_versions` | `cerefox document version list <document-id> --requestor <name>` |
|
|
1136
|
+
| `cerefox_list_projects` | `cerefox project list --requestor <name>` |
|
|
1137
|
+
| `cerefox_list_metadata_keys` | `cerefox metadata keys` |
|
|
1138
|
+
| `cerefox_metadata_search` | `cerefox metadata search --metadata-filter '<json>' --project-name <n> --requestor <name>` |
|
|
1139
|
+
| `cerefox_get_audit_log` | `cerefox audit list --document-id <id> --author <a> --operation <op> --since <iso> --until <iso> --limit N --json --requestor <name>` |
|
|
1140
|
+
|
|
1141
|
+
> CLI verbs with no MCP equivalent: `cerefox document edit`, `cerefox document restore`, `cerefox project create` / `cerefox project edit`, `cerefox config list`.
|
|
1229
1142
|
|
|
1230
1143
|
### Path C verification prompts
|
|
1231
1144
|
|
|
1232
1145
|
After pointing your agent at the repo, ask it:
|
|
1233
1146
|
|
|
1234
1147
|
> "Run a Cerefox search for 'second brain'. What did you find?"
|
|
1235
|
-
> Expected: agent runs `
|
|
1148
|
+
> Expected: agent runs `cerefox search "second brain"` via its Bash tool and reports results.
|
|
1236
1149
|
|
|
1237
1150
|
> "Save a note titled 'Test Note' to Cerefox with the content '# Test\nThis is a Path C test.'"
|
|
1238
|
-
> Expected: agent runs `cerefox ingest --paste --title "Test Note"` (or equivalent) and reports the new document ID.
|
|
1151
|
+
> Expected: agent runs `cerefox document ingest --paste --title "Test Note"` (or equivalent) and reports the new document ID.
|
|
1239
1152
|
|
|
1240
1153
|
> "List my Cerefox projects."
|
|
1241
|
-
> Expected: agent runs `
|
|
1154
|
+
> Expected: agent runs `cerefox project list`.
|
|
1242
1155
|
|
|
1243
1156
|
### Caveats
|
|
1244
1157
|
|
|
1245
1158
|
- **Privilege level**: the CLI uses the **service-role key** (`CEREFOX_SUPABASE_KEY`), which bypasses Row Level Security. An agent with Bash access has the same full read/write power you do. Only enable Path C for agents you trust to act on your behalf — the same trust level you'd grant Cursor/Claude Code for editing your source code.
|
|
1246
1159
|
- **Audit attribution**: Path C records `access_path = "cli"` in usage logs, distinct from `"local-mcp"` / `"remote-mcp"`. **Agents must set `--author <name> --author-type agent` on writes and `--requestor <name>` on reads** (or rely on `CEREFOX_AUTHOR_NAME` / `CEREFOX_AUTHOR_TYPE` / `CEREFOX_REQUESTOR_NAME` env vars). Without these flags, writes attribute to `"unknown"` / `"user"`, which under-reports agent activity. See the 2026-05-18 Decision Log Q2 entry for the design rationale (`author_type` is caller-declared on ambiguous channels — CLI and Edge Functions — but `access_path` is always derived from the code layer).
|
|
1247
|
-
- **Soft-delete is reachable; purge and restore are not** — by design. `cerefox delete
|
|
1160
|
+
- **Soft-delete is reachable; purge and restore are not** — by design. `cerefox document delete` is exposed on the CLI and sends documents to trash with an audit entry. **Permanent purge** (irreversible) and **restore from trash** (un-doing a destructive action) are intentionally web-UI-only and require human-in-the-loop confirmation. If an agent on Path C decides to delete content, it should surface that to the user explicitly so they can review and either restore or commit. See [`access-paths.md` → Destructive operations and the trust model](access-paths.md#destructive-operations-and-the-trust-model) for the full rationale and contributor guidance.
|
|
1248
1161
|
- **Cross-doc links in content you ingest** become clickable when the user views them in the Cerefox web UI. Author them as `[Text](uuid)` (most stable), `[Text](docs/path.md)` (repo files), or `[Text](<Title With Spaces>)` (angle-bracket form — bare spaces break markdown). See [`AGENT_GUIDE.md` → "Writing linkable content"](../../AGENT_GUIDE.md#writing-linkable-content) for the full set of rules.
|
|
1249
|
-
- **
|
|
1250
|
-
- **No sandboxing beyond the agent's existing Bash sandbox**: the CLI is just shell. If your agent's tool framework restricts which commands run, allowlist `
|
|
1162
|
+
- **CLI install per machine**: the agent needs the `cerefox` binary installed (`npm install -g @cerefox/memory`) with a resolvable `.env`. If you skip the local install entirely, Path A-Remote or Path B is the only option.
|
|
1163
|
+
- **No sandboxing beyond the agent's existing Bash sandbox**: the CLI is just shell. If your agent's tool framework restricts which commands run, allowlist `cerefox …` explicitly.
|
|
1251
1164
|
|
|
1252
1165
|
### Path C is configuration-free, but here's the per-agent footprint
|
|
1253
1166
|
|
|
1254
|
-
| Agent | Where to
|
|
1167
|
+
| Agent | Where to remind the agent about Cerefox |
|
|
1255
1168
|
|---|---|
|
|
1256
1169
|
| Claude Code | `CLAUDE.md` in the project, or `~/.claude/CLAUDE.md` globally. No MCP entry needed. |
|
|
1257
1170
|
| OpenAI Codex CLI | `AGENTS.md` or the project's instructions file. |
|
|
1258
1171
|
| opencode | Project config / agent system prompt. |
|
|
1259
1172
|
| OpenClaw, Hermes, custom local agents | Whatever the tool's system-prompt / memory mechanism is. |
|
|
1260
1173
|
|
|
1261
|
-
There is nothing Cerefox-specific to
|
|
1174
|
+
There is nothing Cerefox-specific to configure for the agent itself — just the globally-installed `cerefox` CLI + your `.env`.
|
|
1262
1175
|
|
|
1263
1176
|
---
|
|
1264
1177
|
|
|
1265
|
-
## Custom agents (Python SDK)
|
|
1178
|
+
## Custom agents (Python SDK — legacy)
|
|
1266
1179
|
|
|
1267
|
-
|
|
1180
|
+
> **Legacy/frozen path.** The Python codebase is no longer the maintained runtime — the CLI,
|
|
1181
|
+
> local MCP server, and deploy tooling have all moved to TypeScript (`@cerefox/memory`). The
|
|
1182
|
+
> Python client below still works from a repo clone but is unmaintained. Prefer Path A (MCP),
|
|
1183
|
+
> Path B (Edge Functions HTTP), or Path C (the `cerefox` CLI) for new integrations.
|
|
1184
|
+
|
|
1185
|
+
Use the Cerefox Python client directly for scripted or embedded agents (from a repo clone):
|
|
1268
1186
|
|
|
1269
1187
|
```python
|
|
1270
1188
|
from cerefox.config import Settings
|
|
@@ -1295,8 +1213,8 @@ for hit in resp.results:
|
|
|
1295
1213
|
Both paths use the same Postgres RPCs and the same stored embeddings, but embed queries
|
|
1296
1214
|
independently. If you change the embedding model, **update both paths** before searching:
|
|
1297
1215
|
|
|
1298
|
-
1. Update `.env` + run `cerefox reindex` (re-embeds stored chunks
|
|
1299
|
-
2. Update the TypeScript constants in `supabase/functions/*/index.ts` + redeploy Edge Functions
|
|
1216
|
+
1. Update `.env` + run `cerefox server reindex` (re-embeds stored chunks)
|
|
1217
|
+
2. Update the TypeScript constants in `supabase/functions/*/index.ts` + redeploy Edge Functions (`cerefox server deploy`)
|
|
1300
1218
|
|
|
1301
1219
|
See `docs/guides/configuration.md` → "Changing the embedding model" for the full procedure.
|
|
1302
1220
|
|
|
@@ -1504,3 +1422,62 @@ This RPC derives keys from actual `doc_metadata` JSONB — no separate registry
|
|
|
1504
1422
|
Cerefox's default `max_response_bytes = 200000` is a safety ceiling; small-to-big retrieval
|
|
1505
1423
|
keeps individual results compact so this limit is rarely reached in practice. If your MCP
|
|
1506
1424
|
client has a lower context limit, reduce it via `CEREFOX_MAX_RESPONSE_BYTES` in your `.env`.
|
|
1425
|
+
|
|
1426
|
+
---
|
|
1427
|
+
|
|
1428
|
+
## Appendix: manual per-client config
|
|
1429
|
+
|
|
1430
|
+
`cerefox configure-agent --tool <client>` writes these entries for you (recommended). The raw
|
|
1431
|
+
config below is here for the curious, or for debugging if the CLI can't write your config. Each
|
|
1432
|
+
block is the local-stdio Path A-Local entry — the `npx -y --package=@cerefox/memory cerefox mcp`
|
|
1433
|
+
invocation. The `env` block is only needed if you don't already have a `.env` file in a
|
|
1434
|
+
directory the server can find (the server resolves `.env` from the current working directory).
|
|
1435
|
+
|
|
1436
|
+
### Claude Desktop (manual)
|
|
1437
|
+
|
|
1438
|
+
Config file location:
|
|
1439
|
+
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
1440
|
+
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
1441
|
+
|
|
1442
|
+
```json
|
|
1443
|
+
{
|
|
1444
|
+
"mcpServers": {
|
|
1445
|
+
"cerefox": {
|
|
1446
|
+
"command": "npx",
|
|
1447
|
+
"args": ["-y", "--package=@cerefox/memory", "cerefox", "mcp"],
|
|
1448
|
+
"env": {
|
|
1449
|
+
"CEREFOX_SUPABASE_URL": "https://<your-project-ref>.supabase.co",
|
|
1450
|
+
"CEREFOX_SUPABASE_KEY": "<your-service-role-or-sb_secret-key>",
|
|
1451
|
+
"OPENAI_API_KEY": "sk-..."
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
```
|
|
1457
|
+
|
|
1458
|
+
Merge the `mcpServers` block into any existing file — do not wrap it in an extra `{}` or
|
|
1459
|
+
replace the whole file. Restart Claude Desktop fully (Cmd+Q on macOS) after saving.
|
|
1460
|
+
|
|
1461
|
+
### Cursor (manual)
|
|
1462
|
+
|
|
1463
|
+
Open **Cursor Settings** (`Cmd+,`) → **Tools & Integrations** → **MCP** → **Add new global MCP
|
|
1464
|
+
server**, then paste the same block as Claude Desktop (above). Save and restart Cursor. For
|
|
1465
|
+
project-scoped access, put the same content in `.cursor/mcp.json` in your project root.
|
|
1466
|
+
|
|
1467
|
+
### Claude Code (manual)
|
|
1468
|
+
|
|
1469
|
+
```bash
|
|
1470
|
+
claude mcp add --scope user cerefox \
|
|
1471
|
+
npx -- -y --package=@cerefox/memory cerefox mcp
|
|
1472
|
+
```
|
|
1473
|
+
|
|
1474
|
+
- `--scope user` makes the server available in every project (stored in `~/.claude/mcp.json`).
|
|
1475
|
+
- Use `--scope project` instead to limit it to the current directory (stored in `.mcp.json`).
|
|
1476
|
+
|
|
1477
|
+
If `.env` isn't resolvable from your shell's CWD, edit the resulting JSON config to add an
|
|
1478
|
+
`env` block (see the Claude Desktop block above). The **Code** tab inside Claude Desktop uses
|
|
1479
|
+
this same config — run the `claude mcp add` above and it picks it up automatically.
|
|
1480
|
+
|
|
1481
|
+
> The legacy Python MCP server can be wired manually as a standalone fallback by pointing the
|
|
1482
|
+
> `command` at `uv` with args `["--directory", "/path/to/cerefox", "run", "cerefox", "mcp"]`.
|
|
1483
|
+
> It is frozen and unmaintained — prefer the npm entry above.
|
|
@@ -100,7 +100,7 @@ If you want to keep costs as low as possible:
|
|
|
100
100
|
See `docs/guides/configuration.md` for how to switch.
|
|
101
101
|
- **Batch ingest, don't re-ingest**: Cerefox deduplicates by content hash — re-ingesting the
|
|
102
102
|
same file twice costs nothing. Only new or changed content triggers embedding calls.
|
|
103
|
-
- **`cerefox reindex`**: Re-embeds all existing chunks if you switch embedders. Run this once
|
|
103
|
+
- **`cerefox server reindex`**: Re-embeds all existing chunks if you switch embedders. Run this once
|
|
104
104
|
after switching, not repeatedly.
|
|
105
105
|
|
|
106
106
|
---
|