@cerefox/memory 0.4.3 → 0.5.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/README.md ADDED
@@ -0,0 +1,164 @@
1
+ # @cerefox/memory
2
+
3
+ **User-owned shared memory for AI agents.** The local TypeScript runtime for
4
+ [Cerefox](https://github.com/fstamatelopoulos/cerefox) — a persistent,
5
+ curated knowledge layer that multiple AI tools can read and write.
6
+
7
+ > **Cerefox is BYO-storage.** This package is the *client* — the CLI + local
8
+ > MCP server. The knowledge base itself lives in **your own Supabase project**
9
+ > (Postgres + pgvector; free tier works). Installing this npm package does
10
+ > **not** give you a working KB on its own; you also need a Supabase project +
11
+ > an embedding API key. The first-run `cerefox init` wires everything together
12
+ > in ~2 minutes once you have those in hand. **See "Before you install"
13
+ > below.**
14
+
15
+ This package contains a single binary, **`cerefox`**:
16
+
17
+ | Subcommand | What it does |
18
+ |---|---|
19
+ | `cerefox <command>` | CLI — search, ingest, list, version-history, audit-log, lifecycle (`init`, `doctor`, `configure-agent`, `self-update`). Callable from any directory. |
20
+ | `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. |
21
+
22
+ > **What this package isn't:** the source of truth for Cerefox's architecture
23
+ > or docs. Those live in the [GitHub repo](https://github.com/fstamatelopoulos/cerefox).
24
+ > This README is the npm landing card.
25
+
26
+ ---
27
+
28
+ ## Before you install
29
+
30
+ Cerefox is a self-hosted memory layer. To use it you need three things, none
31
+ of which this npm package brings with it:
32
+
33
+ | Prerequisite | Why | How |
34
+ |---|---|---|
35
+ | A **Supabase project** | The knowledge base (documents + chunks + embeddings) lives in your Supabase project's Postgres database, with pgvector for semantic search. Free tier is enough for most personal use. | Sign up at [supabase.com](https://supabase.com), create a project, then follow the [Supabase setup guide](https://github.com/fstamatelopoulos/cerefox/blob/main/docs/guides/setup-supabase.md) — deploy the Cerefox schema (one script), then deploy the Edge Functions (one command). Estimate: 10–15 minutes the first time. |
36
+ | An **embedding API key** | Cerefox embeds your documents for semantic search. OpenAI's `text-embedding-3-small` is the default; Fireworks AI is an alternative. | Get an [OpenAI API key](https://platform.openai.com/api-keys) — costs are pennies/month for typical personal use (see [operational-cost.md](https://github.com/fstamatelopoulos/cerefox/blob/main/docs/guides/operational-cost.md)). |
37
+ | **Node ≥ 20** or **Bun ≥ 1.0** | Runtime for the `cerefox` bin (and the bundled `cerefox mcp` server). | [nodejs.org](https://nodejs.org) or [bun.sh](https://bun.sh). The one-line installer below bootstraps Bun for you if neither is present. |
38
+
39
+ If you don't yet have Supabase + an OpenAI key, the [Cerefox
40
+ quickstart](https://github.com/fstamatelopoulos/cerefox/blob/main/docs/guides/quickstart.md)
41
+ walks through the whole setup in one place.
42
+
43
+ ---
44
+
45
+ ## Install
46
+
47
+ Once you have the prerequisites above in hand:
48
+
49
+ ```bash
50
+ # One-line install (recommended on a fresh machine; bootstraps Bun if needed):
51
+ curl -fsSL https://github.com/fstamatelopoulos/cerefox/releases/latest/download/install.sh | sh
52
+
53
+ # Or direct (any of these):
54
+ bun install -g @cerefox/memory
55
+ npm install -g @cerefox/memory
56
+ pnpm add -g @cerefox/memory
57
+ yarn global add @cerefox/memory
58
+ ```
59
+
60
+ ---
61
+
62
+ ## First-run setup
63
+
64
+ ```bash
65
+ cerefox init # 5-step interactive bootstrap (asks for Supabase URL,
66
+ # Supabase key, OpenAI key, optional Postgres URL, identity)
67
+ cerefox doctor # verify everything reaches
68
+ ```
69
+
70
+ `cerefox init` prompts for the credentials you collected above, validates them
71
+ against the live services, writes `~/.cerefox/.env` (chmod 0600), and
72
+ optionally wires up an MCP client. **It does not create the Supabase project
73
+ for you** — you'll be asked for the URL + key, so make sure those are
74
+ already provisioned (see "Before you install").
75
+
76
+ > **Schema deploy (v0.5):** if your Supabase project is fresh, `cerefox init`
77
+ > tells you to run `uv run python scripts/db_deploy.py` from a Cerefox repo
78
+ > clone to install the schema. This last manual step goes away in v0.6 when
79
+ > the deploy logic is ported to the TS CLI. For now, the setup-supabase
80
+ > guide walks through it.
81
+
82
+ ---
83
+
84
+ ## Connect an AI agent
85
+
86
+ ```bash
87
+ cerefox configure-agent --tool claude-code # writes ~/.claude/mcp.json
88
+ cerefox configure-agent --tool claude-desktop # writes Claude Desktop config
89
+ ```
90
+
91
+ Phase 1 supports Claude Code + Claude Desktop. Cursor, Codex CLI, and Gemini
92
+ CLI ship in a follow-up. For manual configuration, the canonical MCP entry
93
+ is:
94
+
95
+ ```json
96
+ {
97
+ "mcpServers": {
98
+ "cerefox": {
99
+ "command": "npx",
100
+ "args": ["-y", "--package=@cerefox/memory", "cerefox", "mcp"]
101
+ }
102
+ }
103
+ }
104
+ ```
105
+
106
+ Once configured, any of these clients can search + write your Cerefox KB via
107
+ the 10 MCP tools (`cerefox_search`, `cerefox_ingest`, `cerefox_get_document`,
108
+ `cerefox_list_versions`, `cerefox_list_projects`, `cerefox_list_metadata_keys`,
109
+ `cerefox_metadata_search`, `cerefox_set_document_projects`,
110
+ `cerefox_get_audit_log`, `cerefox_get_help`).
111
+
112
+ ---
113
+
114
+ ## Common commands
115
+
116
+ ```bash
117
+ cerefox search "second brain" # hybrid (FTS + semantic)
118
+ cerefox ingest notes.md --project "Personal" # add a doc
119
+ cerefox list-projects # discover projects
120
+ cerefox metadata-search --metadata-filter '{"type":"decision-log"}'
121
+ cerefox get-audit-log --since 2026-05-01 # immutable history
122
+ cerefox doctor # diagnose your install
123
+ cerefox upgrade # alias for self-update
124
+ ```
125
+
126
+ Run `cerefox --help` for the full command surface (28 subcommands grouped
127
+ by category).
128
+
129
+ ---
130
+
131
+ ## Why install the CLI when I already have MCP wired up?
132
+
133
+ You don't have to. `cerefox mcp` (started as a stdio subprocess by any
134
+ MCP client) gives your AI agent full access to the knowledge base on
135
+ its own. The rest of the `cerefox` CLI is useful for:
136
+
137
+ - **One-off shell operations**: search, ingest, list, audit-log.
138
+ - **Power-user workflows**: `cerefox ingest-dir ./meeting-notes`,
139
+ `cerefox metadata-search --metadata-filter …`, `cerefox backup`.
140
+ - **Setup + diagnostics**: `cerefox init`, `cerefox doctor`,
141
+ `cerefox configure-agent`, `cerefox self-update`.
142
+ - **Agents via local Bash tool** (Path C in the architecture): some
143
+ coding agents prefer running `cerefox <subcommand>` over a Bash tool
144
+ rather than configuring MCP.
145
+
146
+ ---
147
+
148
+ ## Architecture, design, docs
149
+
150
+ - **Project README + roadmap**: <https://github.com/fstamatelopoulos/cerefox>
151
+ - **Architecture overview**: [`CLAUDE.md`](https://github.com/fstamatelopoulos/cerefox/blob/main/CLAUDE.md)
152
+ - **Setup guides**: [`docs/guides/`](https://github.com/fstamatelopoulos/cerefox/tree/main/docs/guides)
153
+ - **Migration from v0.4.x**: [`docs/guides/migration-v0.5.md`](https://github.com/fstamatelopoulos/cerefox/blob/main/docs/guides/migration-v0.5.md)
154
+ - **For AI agents using Cerefox**: [`AGENT_GUIDE.md`](https://github.com/fstamatelopoulos/cerefox/blob/main/AGENT_GUIDE.md), [`AGENT_QUICK_REFERENCE.md`](https://github.com/fstamatelopoulos/cerefox/blob/main/AGENT_QUICK_REFERENCE.md), or run `cerefox docs --list`.
155
+ - **Changelog**: [`CHANGELOG.md`](https://github.com/fstamatelopoulos/cerefox/blob/main/CHANGELOG.md)
156
+
157
+ ---
158
+
159
+ ## License
160
+
161
+ Apache-2.0 — see [`LICENSE`](https://github.com/fstamatelopoulos/cerefox/blob/main/LICENSE) in the repo.
162
+
163
+ Cerefox is a single-maintainer open-source project. Bug reports and PRs
164
+ welcome at [github.com/fstamatelopoulos/cerefox/issues](https://github.com/fstamatelopoulos/cerefox/issues).