@cerefox/memory 0.7.1 → 0.8.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 +62 -25
- package/dist/bin/cerefox.js +1163 -344
- package/dist/frontend/assets/{index-HNlMcvli.js → index-CAp2_lFX.js} +2 -2
- package/dist/frontend/assets/index-CAp2_lFX.js.map +1 -0
- package/dist/frontend/index.html +1 -1
- package/dist/server-assets/_shared/ef-meta/index.ts +97 -0
- package/dist/server-assets/_shared/embeddings/index.ts +175 -0
- package/dist/server-assets/_shared/mcp-tools/_chunker.ts +187 -0
- package/dist/server-assets/_shared/mcp-tools/_projects.ts +121 -0
- package/dist/server-assets/_shared/mcp-tools/_utils.ts +73 -0
- package/dist/server-assets/_shared/mcp-tools/audit-log.ts +95 -0
- package/dist/server-assets/_shared/mcp-tools/get-document.ts +73 -0
- package/dist/server-assets/_shared/mcp-tools/get-help-content.ts +26 -0
- package/dist/server-assets/_shared/mcp-tools/get-help.ts +90 -0
- package/dist/server-assets/_shared/mcp-tools/index.ts +67 -0
- package/dist/server-assets/_shared/mcp-tools/ingest.ts +315 -0
- package/dist/server-assets/_shared/mcp-tools/list-metadata-keys.ts +55 -0
- package/dist/server-assets/_shared/mcp-tools/list-projects.ts +59 -0
- package/dist/server-assets/_shared/mcp-tools/list-versions.ts +72 -0
- package/dist/server-assets/_shared/mcp-tools/metadata-search.ts +154 -0
- package/dist/server-assets/_shared/mcp-tools/search.ts +193 -0
- package/dist/server-assets/_shared/mcp-tools/set-document-projects.ts +163 -0
- package/dist/server-assets/_shared/mcp-tools/types.ts +92 -0
- package/dist/server-assets/db/migrations/0003_add_document_versions.sql +91 -0
- package/dist/server-assets/db/migrations/0004_add_audit_log_review_status_archived.sql +71 -0
- package/dist/server-assets/db/migrations/0005_metadata_search.sql +628 -0
- package/dist/server-assets/db/migrations/0006_usage_log.sql +255 -0
- package/dist/server-assets/db/migrations/0007_usage_log_requestor.sql +178 -0
- package/dist/server-assets/db/migrations/0008_soft_delete.sql +130 -0
- package/dist/server-assets/db/migrations/0009_audit_log_restore_operation.sql +20 -0
- package/dist/server-assets/db/migrations/0010_requestor_enforcement_config.sql +12 -0
- package/dist/server-assets/db/migrations/0011_title_boosting.sql +48 -0
- package/dist/server-assets/db/rpcs.sql +1723 -0
- package/dist/server-assets/db/schema.sql +380 -0
- package/dist/server-assets/supabase/functions/cerefox-get-audit-log/index.ts +117 -0
- package/dist/server-assets/supabase/functions/cerefox-get-document/index.ts +138 -0
- package/dist/server-assets/supabase/functions/cerefox-ingest/index.ts +819 -0
- package/dist/server-assets/supabase/functions/cerefox-list-projects/index.ts +96 -0
- package/dist/server-assets/supabase/functions/cerefox-list-versions/index.ts +113 -0
- package/dist/server-assets/supabase/functions/cerefox-mcp/index.ts +294 -0
- package/dist/server-assets/supabase/functions/cerefox-mcp/shared.ts +42 -0
- package/dist/server-assets/supabase/functions/cerefox-metadata/index.ts +99 -0
- package/dist/server-assets/supabase/functions/cerefox-metadata-search/index.ts +146 -0
- package/dist/server-assets/supabase/functions/cerefox-search/index.ts +382 -0
- package/docs/guides/connect-agents.md +58 -3
- package/docs/guides/migration-v0.5.md +50 -0
- package/package.json +3 -2
- package/dist/frontend/assets/index-HNlMcvli.js.map +0 -1
package/README.md
CHANGED
|
@@ -5,12 +5,20 @@
|
|
|
5
5
|
curated knowledge layer that multiple AI tools can read and write.
|
|
6
6
|
|
|
7
7
|
> **Cerefox is BYO-storage.** This package is the *client* — the CLI + local
|
|
8
|
-
> MCP server. The knowledge base itself lives in **your own
|
|
9
|
-
> (Postgres + pgvector; free tier works). Installing this
|
|
10
|
-
> **not** give you a working KB on its own; you also need a
|
|
11
|
-
> an embedding API key
|
|
12
|
-
>
|
|
13
|
-
|
|
8
|
+
> MCP server + local web UI. The knowledge base itself lives in **your own
|
|
9
|
+
> Supabase project** (Postgres + pgvector; free tier works). Installing this
|
|
10
|
+
> npm package does **not** give you a working KB on its own; you also need a
|
|
11
|
+
> Supabase project + an embedding API key, and a one-time server-side deploy
|
|
12
|
+
> from the source repo. **See "Before you install" below.**
|
|
13
|
+
|
|
14
|
+
**Why cloud-backed?** Cerefox is designed as a *cloud-backed* memory layer so
|
|
15
|
+
the same knowledge is reachable from every agent you run — Claude Code on
|
|
16
|
+
your laptop, Cursor on a second machine, ChatGPT on the web, a script in CI.
|
|
17
|
+
Postgres + pgvector deliver hybrid (semantic + full-text) search across that
|
|
18
|
+
shared memory; Supabase provides the always-on endpoint that makes "same
|
|
19
|
+
memory, any device, any agent" work. You own the data and the endpoint; this
|
|
20
|
+
package bundles **everything you run locally** — CLI, MCP server, web UI,
|
|
21
|
+
and the in-process ingestion + retrieval pipeline — that talks to it.
|
|
14
22
|
|
|
15
23
|
This package contains a single binary, **`cerefox`**:
|
|
16
24
|
|
|
@@ -18,6 +26,7 @@ This package contains a single binary, **`cerefox`**:
|
|
|
18
26
|
|---|---|
|
|
19
27
|
| `cerefox <command>` | CLI — search, ingest, list, version-history, audit-log, lifecycle (`init`, `doctor`, `configure-agent`, `self-update`). Callable from any directory. |
|
|
20
28
|
| `cerefox mcp` | Local stdio MCP server. Drop-in for Claude Code, Cursor, Claude Desktop, Codex CLI, Gemini CLI. Exposes the same 10 MCP tools as the remote `cerefox-mcp` Edge Function. |
|
|
29
|
+
| `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. |
|
|
21
30
|
|
|
22
31
|
> **What this package isn't:** the source of truth for Cerefox's architecture
|
|
23
32
|
> or docs. Those live in the [GitHub repo](https://github.com/fstamatelopoulos/cerefox).
|
|
@@ -27,14 +36,42 @@ This package contains a single binary, **`cerefox`**:
|
|
|
27
36
|
|
|
28
37
|
## Before you install
|
|
29
38
|
|
|
30
|
-
Cerefox is a self-hosted memory layer
|
|
31
|
-
|
|
39
|
+
Cerefox is a self-hosted memory layer with two halves you set up independently:
|
|
40
|
+
|
|
41
|
+
**Server side** (lives in your Supabase project, runs ~24/7):
|
|
42
|
+
- Postgres schema + RPCs (search, ingest, audit log, version history)
|
|
43
|
+
- Edge Functions (server-side embedding, remote `cerefox-mcp` MCP server, Custom-GPT actions)
|
|
44
|
+
|
|
45
|
+
**Client side** (this npm package, runs on your machine):
|
|
46
|
+
- `cerefox` CLI + `cerefox mcp` (local stdio MCP) + `cerefox web` (local UI at `http://localhost:8000`)
|
|
47
|
+
|
|
48
|
+
The server side ships with the source repo, not this npm package. Both halves are required for a working install.
|
|
49
|
+
|
|
50
|
+
### What you need
|
|
32
51
|
|
|
33
52
|
| Prerequisite | Why | How |
|
|
34
53
|
|---|---|---|
|
|
35
|
-
| A **Supabase project** |
|
|
36
|
-
| An **embedding API key** |
|
|
37
|
-
| **Node ≥ 20** or **Bun ≥ 1.0** | Runtime for the `cerefox` bin (and the bundled `cerefox mcp` server). | [nodejs.org](https://nodejs.org)
|
|
54
|
+
| A **Supabase project** | Hosts Postgres + pgvector + Edge Functions. Free tier is enough for most personal use. | [supabase.com](https://supabase.com) → New project |
|
|
55
|
+
| An **embedding API key** | OpenAI `text-embedding-3-small` (default) or Fireworks AI. Pennies/month for typical personal use (see [operational-cost.md](https://github.com/fstamatelopoulos/cerefox/blob/main/docs/guides/operational-cost.md)). | Get an [OpenAI API key](https://platform.openai.com/api-keys). |
|
|
56
|
+
| **Node ≥ 20** or **Bun ≥ 1.0** | Runtime for the `cerefox` bin (and the bundled `cerefox mcp` server). | [nodejs.org](https://nodejs.org) · [bun.sh](https://bun.sh). The one-line installer below bootstraps Bun if neither is present. |
|
|
57
|
+
|
|
58
|
+
### One-time server-side setup (~10 min — clone required)
|
|
59
|
+
|
|
60
|
+
The schema, RPCs, and Edge Functions ship with the source repo, not this npm package. Clone once, configure, deploy:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
git clone https://github.com/fstamatelopoulos/cerefox.git
|
|
64
|
+
cd cerefox && cp .env.example .env # fill in CEREFOX_SUPABASE_* + OPENAI_API_KEY + CEREFOX_DATABASE_URL
|
|
65
|
+
bun install # workspace deps for the deploy scripts
|
|
66
|
+
bun scripts/db_deploy.ts # creates tables, indexes, RPCs in your Supabase
|
|
67
|
+
npx supabase functions deploy cerefox-mcp cerefox-search cerefox-ingest \
|
|
68
|
+
cerefox-metadata cerefox-get-document \
|
|
69
|
+
cerefox-list-versions cerefox-get-audit-log \
|
|
70
|
+
cerefox-metadata-search cerefox-list-projects
|
|
71
|
+
npx supabase secrets set OPENAI_API_KEY=sk-...
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Full walkthrough (connection-pooling quirks, Supabase API-key flavors, troubleshooting): [setup-supabase.md](https://github.com/fstamatelopoulos/cerefox/blob/main/docs/guides/setup-supabase.md).
|
|
38
75
|
|
|
39
76
|
If you don't yet have Supabase + an OpenAI key, the [Cerefox
|
|
40
77
|
quickstart](https://github.com/fstamatelopoulos/cerefox/blob/main/docs/guides/quickstart.md)
|
|
@@ -64,7 +101,7 @@ yarn global add @cerefox/memory
|
|
|
64
101
|
```bash
|
|
65
102
|
cerefox init # 5-step interactive bootstrap (asks for Supabase URL,
|
|
66
103
|
# Supabase key, OpenAI key, optional Postgres URL, identity)
|
|
67
|
-
cerefox doctor #
|
|
104
|
+
cerefox doctor # end-to-end health check against the live services
|
|
68
105
|
```
|
|
69
106
|
|
|
70
107
|
`cerefox init` prompts for the credentials you collected above, validates them
|
|
@@ -73,11 +110,10 @@ optionally wires up an MCP client. **It does not create the Supabase project
|
|
|
73
110
|
for you** — you'll be asked for the URL + key, so make sure those are
|
|
74
111
|
already provisioned (see "Before you install").
|
|
75
112
|
|
|
76
|
-
> **
|
|
77
|
-
>
|
|
78
|
-
>
|
|
79
|
-
>
|
|
80
|
-
> guide walks through it.
|
|
113
|
+
> **Already ran the server-side setup above?** Then your schema is in place and
|
|
114
|
+
> `cerefox init` only needs the URL + keys. If you skipped that step,
|
|
115
|
+
> `cerefox doctor` will flag it and point you back to
|
|
116
|
+
> `bun scripts/db_deploy.ts` from a repo clone.
|
|
81
117
|
|
|
82
118
|
> **Upgrading from the Python `cerefox` CLI?** If you have a working
|
|
83
119
|
> `.env` in your repo clone, init detects it and offers to **copy** it to
|
|
@@ -92,13 +128,15 @@ already provisioned (see "Before you install").
|
|
|
92
128
|
|
|
93
129
|
```bash
|
|
94
130
|
# Run the configure-agent commands that apply to your setup:
|
|
95
|
-
cerefox configure-agent --tool claude-code #
|
|
96
|
-
cerefox configure-agent --tool claude-desktop #
|
|
131
|
+
cerefox configure-agent --tool claude-code # ~/.claude.json via `claude mcp add`
|
|
132
|
+
cerefox configure-agent --tool claude-desktop # Claude Desktop config
|
|
133
|
+
cerefox configure-agent --tool cursor # ~/.cursor/mcp.json
|
|
134
|
+
cerefox configure-agent --tool codex # ~/.codex/config.toml
|
|
135
|
+
cerefox configure-agent --tool gemini # ~/.gemini/settings.json
|
|
97
136
|
```
|
|
98
137
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
is:
|
|
138
|
+
All five writers landed in v0.6. For manual configuration, the canonical MCP
|
|
139
|
+
entry is:
|
|
102
140
|
|
|
103
141
|
```json
|
|
104
142
|
{
|
|
@@ -147,9 +185,8 @@ its own. The rest of the `cerefox` CLI is useful for:
|
|
|
147
185
|
`cerefox metadata-search --metadata-filter …`, `cerefox backup`.
|
|
148
186
|
- **Setup + diagnostics**: `cerefox init`, `cerefox doctor`,
|
|
149
187
|
`cerefox configure-agent`, `cerefox self-update`.
|
|
150
|
-
- **Agents via local Bash tool
|
|
151
|
-
|
|
152
|
-
rather than configuring MCP.
|
|
188
|
+
- **Agents via local Bash tool**: some coding agents prefer running
|
|
189
|
+
`cerefox <subcommand>` from a shell rather than configuring MCP.
|
|
153
190
|
|
|
154
191
|
---
|
|
155
192
|
|