@facthouse/mcp 0.28.0 → 0.29.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.
Files changed (61) hide show
  1. package/README.md +35 -33
  2. package/dist/cli/index.d.ts +5 -21
  3. package/dist/cli/index.d.ts.map +1 -1
  4. package/dist/cli/index.js +6 -783
  5. package/dist/cli/index.js.map +1 -1
  6. package/dist/cli/init-backfill.d.ts.map +1 -1
  7. package/dist/cli/init-backfill.js +2 -0
  8. package/dist/cli/init-backfill.js.map +1 -1
  9. package/dist/cli/init-knobs.d.ts +12 -3
  10. package/dist/cli/init-knobs.d.ts.map +1 -1
  11. package/dist/cli/init-knobs.js +20 -5
  12. package/dist/cli/init-knobs.js.map +1 -1
  13. package/dist/cli/init-wizard.d.ts.map +1 -1
  14. package/dist/cli/init-wizard.js +39 -8
  15. package/dist/cli/init-wizard.js.map +1 -1
  16. package/dist/cli/init.d.ts +2 -0
  17. package/dist/cli/init.d.ts.map +1 -1
  18. package/dist/cli/init.js +23 -2
  19. package/dist/cli/init.js.map +1 -1
  20. package/dist/cli/run.d.ts +35 -0
  21. package/dist/cli/run.d.ts.map +1 -0
  22. package/dist/cli/run.js +801 -0
  23. package/dist/cli/run.js.map +1 -0
  24. package/dist/cli/settings.d.ts.map +1 -1
  25. package/dist/cli/settings.js +1 -1
  26. package/dist/cli/settings.js.map +1 -1
  27. package/dist/cli/web.d.ts +24 -1
  28. package/dist/cli/web.d.ts.map +1 -1
  29. package/dist/cli/web.js +235 -68
  30. package/dist/cli/web.js.map +1 -1
  31. package/dist/index.d.ts +4 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +4 -272
  34. package/dist/index.js.map +1 -1
  35. package/dist/intelligence/cli.d.ts +11 -3
  36. package/dist/intelligence/cli.d.ts.map +1 -1
  37. package/dist/intelligence/cli.js +115 -23
  38. package/dist/intelligence/cli.js.map +1 -1
  39. package/dist/intelligence/consolidate.d.ts +4 -0
  40. package/dist/intelligence/consolidate.d.ts.map +1 -1
  41. package/dist/intelligence/consolidate.js +14 -2
  42. package/dist/intelligence/consolidate.js.map +1 -1
  43. package/dist/intelligence/types.d.ts +5 -0
  44. package/dist/intelligence/types.d.ts.map +1 -1
  45. package/dist/intelligence/usage.d.ts +1 -1
  46. package/dist/intelligence/usage.js +1 -1
  47. package/dist/paths.d.ts +7 -0
  48. package/dist/paths.d.ts.map +1 -1
  49. package/dist/paths.js +25 -0
  50. package/dist/paths.js.map +1 -1
  51. package/dist/server.d.ts +8 -0
  52. package/dist/server.d.ts.map +1 -0
  53. package/dist/server.js +274 -0
  54. package/dist/server.js.map +1 -0
  55. package/dist/suppress-sqlite-warning.js +15 -3
  56. package/dist/suppress-sqlite-warning.js.map +1 -1
  57. package/dist/types/config.d.ts +5 -3
  58. package/dist/types/config.d.ts.map +1 -1
  59. package/dist/types/config.js +3 -1
  60. package/dist/types/config.js.map +1 -1
  61. package/package.json +2 -2
package/README.md CHANGED
@@ -2,9 +2,7 @@
2
2
 
3
3
  <img src="brand/mascot-right.png" width="128" align="right" alt="Facthouse mascot">
4
4
 
5
- A local memory engine any AI tool can use. GitHub [`gordonkjlee/facthouse`](https://github.com/gordonkjlee/facthouse), npm [`@facthouse/mcp`](https://www.npmjs.com/package/@facthouse/mcp).
6
-
7
- Not a hosted plane. Not a vendor blob. Not Mem0's hosted "OpenMemory MCP" at [`mcp.mem0.ai`](https://mcp.mem0.ai).
5
+ Facthouse is a local memory engine for AI tools. Most “memory” products index chat logs. Facthouse takes agent activity - messages, tool use, and other MCP traffic - and applies neuroscience-inspired consolidation so it moves through **Data** (what happened in the session) → **Information** (extracted facts) → **Knowledge** (integrated beliefs on an entity graph). During this process, Facthouse links entities, drops duplicates, reconciles conflicts, and supersedes what is out of date. Vector embeddings add optional semantic search on top of that graph. The store is a SQLite file on your disk.
8
6
 
9
7
  [![npm](https://img.shields.io/npm/v/@facthouse/mcp.svg)](https://www.npmjs.com/package/@facthouse/mcp)
10
8
  [![CI](https://github.com/gordonkjlee/facthouse/actions/workflows/ci.yml/badge.svg)](https://github.com/gordonkjlee/facthouse/actions/workflows/ci.yml)
@@ -18,29 +16,16 @@ Needs Node 22.5 or 24+.
18
16
 
19
17
  <!-- x-release-please-start-version -->
20
18
  ```bash
21
- npm install -g @facthouse/mcp@0.28.0
19
+ npm install -g @facthouse/mcp@0.29.0
22
20
  facthouse init
23
21
  ```
24
22
  <!-- x-release-please-end -->
25
23
 
26
24
  If npm install -g fails because a command named mcp already exists, remove that leftover command and retry.
27
25
 
28
- Press Enter to accept each default (copy = Claude Code or Cursor session logs on disk; type record if the assistant should save facts). If you picked copy, init asks whether to copy existing logs, then whether to extract and integrate. Init prints an MCP snippet — paste it into the client and restart.
29
-
30
- To skip the wizard (record only — no transcript copy), paste this. The server creates `~/.facthouse` on first boot; you are not asked those questions.
26
+ `facthouse init --web` is the same setup as a browser form — it prints a 127.0.0.1 URL and does not open a browser.
31
27
 
32
- <!-- x-release-please-start-version -->
33
- ```json
34
- {
35
- "mcpServers": {
36
- "facthouse": {
37
- "command": "npx",
38
- "args": ["-y", "@facthouse/mcp@0.28.0"]
39
- }
40
- }
41
- }
42
- ```
43
- <!-- x-release-please-end -->
28
+ Press Enter to accept each default (copy = Claude Code or Cursor session logs on disk; type record if the assistant should save facts). If you picked copy, init asks whether to copy existing logs, then whether to extract and integrate. Init prints an MCP snippet — paste it into the client and restart.
44
29
 
45
30
  In the client, state something durable in ordinary conversation — there is no remember command.
46
31
 
@@ -54,7 +39,7 @@ Two ways. Pick one per store.
54
39
  |---|---|---|
55
40
  | Who | Claude Code or Cursor (session logs on disk, under the client home) | Any MCP client (Grok, Desktop, …) |
56
41
  | How | Name a source; Facthouse copies new lines from those logs into the store | Empty `sources`; the assistant calls `capture_fact` |
57
- | First run | TTY walk-through, pick **copy**, set cwd; init asks whether to copy existing logs, then whether to extract and integrate | The paste above (already record) |
42
+ | First run | TTY walk-through, pick **copy**, set cwd; init asks whether to copy existing logs, then whether to extract and integrate | TTY walk-through, pick **record** |
58
43
 
59
44
  On a copy store, capture_fact is a correction for every MCP client, not only the one that writes JSONL. Grok has no transcript adapter — do not put Claude Code on copy and Grok on the same store expecting Grok to record.
60
45
 
@@ -132,19 +117,19 @@ Both are read-only views over the same database the tools query. Clients that ne
132
117
 
133
118
  The MCP JSON starts the server via npx and does not need a global install. npm install -g puts facthouse on PATH for init, settings, stats, and inspect. The same CLI without PATH is npx -y -p "@facthouse/mcp" -- facthouse — pin the version; quote the package so PowerShell does not splat. -p and -- stop an older global binary winning. npx -y @facthouse/mcp with no -p / facthouse is the server; do not run it as a shell command for init, settings, or stats. The MCP paste starts the server. It does not put facthouse on PATH. To inspect the file from a terminal, see CLI below.
134
119
 
135
- These CLI commands work in bash, zsh, and PowerShell. Quote @facthouse/mcp in PowerShell. Git Bash /c/... paths are not PowerShell; use C:/... and pass --data instead of cd or export. ~/ is expanded on every platform. WSL uses /mnt/c/.... FACTHOUSE_DATA on an MCP snippet applies only to that server process. A terminal facthouse command needs --data, or FACTHOUSE_DATA in the environment that shell inherits. Hooks do not see mcp.json env.
120
+ These CLI commands work in bash, zsh, and PowerShell. Quote @facthouse/mcp in PowerShell. Git Bash /c/... paths are not PowerShell; use C:/... and pass --data instead of cd or export. In Git Bash, quote a backslash path or write C:/... — unquoted \ is an escape. ~/ is expanded on every platform. WSL uses /mnt/c/.... FACTHOUSE_DATA on an MCP snippet applies only to that server process. A terminal facthouse command needs --data, or FACTHOUSE_DATA in the environment that shell inherits. Hooks do not see mcp.json env.
136
121
 
137
122
  <!-- x-release-please-start-version -->
138
123
  ```bash
139
- npm install -g @facthouse/mcp@0.28.0
124
+ npm install -g @facthouse/mcp@0.29.0
140
125
  facthouse init --yes
141
126
  ```
142
127
 
143
128
  ```bash
144
- npx -y -p "@facthouse/mcp@0.28.0" -- facthouse init --yes
145
- npx -y -p "@facthouse/mcp@0.28.0" -- facthouse settings --json
146
- npx -y -p "@facthouse/mcp@0.28.0" -- facthouse stats
147
- npx -y -p "@facthouse/mcp@0.28.0" -- facthouse inspect
129
+ npx -y -p "@facthouse/mcp@0.29.0" -- facthouse init --yes
130
+ npx -y -p "@facthouse/mcp@0.29.0" -- facthouse settings --json
131
+ npx -y -p "@facthouse/mcp@0.29.0" -- facthouse stats
132
+ npx -y -p "@facthouse/mcp@0.29.0" -- facthouse inspect
148
133
  ```
149
134
  <!-- x-release-please-end -->
150
135
 
@@ -288,7 +273,7 @@ facthouse inspect --entity Helios --limit 20 --output ~/inspect.html
288
273
 
289
274
  ### Another store
290
275
 
291
- You do not need two installs. The default is one directory and one MCP server named `facthouse`. A second store is a second directory — not a filter on which client wrote the row. Work and personal is one reason to split, not a required setup.
276
+ The store is this directory. Clients share it by using the same path. A second store is a second directory, not a second install. The default MCP server name is `facthouse`. Splitting is not a filter on which client wrote the row. Work and personal is one reason to split, not a required setup.
292
277
 
293
278
  A non-default data directory prints a distinct MCP server name so two stores can share one `mcp.json`. Init against each extra directory prints that snippet. Example:
294
279
 
@@ -298,12 +283,12 @@ A non-default data directory prints a distinct MCP server name so two stores can
298
283
  "mcpServers": {
299
284
  "facthouse-personal": {
300
285
  "command": "npx",
301
- "args": ["-y", "@facthouse/mcp@0.28.0"],
286
+ "args": ["-y", "@facthouse/mcp@0.29.0"],
302
287
  "env": { "FACTHOUSE_DATA": "C:\\Users\\alex\\.facthouse-personal" }
303
288
  },
304
289
  "facthouse-work": {
305
290
  "command": "npx",
306
- "args": ["-y", "@facthouse/mcp@0.28.0"],
291
+ "args": ["-y", "@facthouse/mcp@0.29.0"],
307
292
  "env": { "FACTHOUSE_DATA": "C:\\Users\\alex\\.facthouse-work" }
308
293
  }
309
294
  }
@@ -329,7 +314,7 @@ Example — placeholders only; do not put a real password in a committed file:
329
314
  "mcpServers": {
330
315
  "facthouse": {
331
316
  "command": "npx",
332
- "args": ["-y", "@facthouse/mcp@0.28.0"],
317
+ "args": ["-y", "@facthouse/mcp@0.29.0"],
333
318
  "env": {
334
319
  "FACTHOUSE_DATA": "C:\\Users\\alex\\.facthouse-work",
335
320
  "FACTHOUSE_STORAGE": "postgres",
@@ -365,6 +350,23 @@ Choose one mechanism per store.
365
350
 
366
351
  Do not install record hooks on this store — both write the same rows. Facthouse does not detect or rewrite existing hook configs.
367
352
 
353
+ ### MCP-only record mode
354
+
355
+ To skip the wizard (record only — no transcript copy), paste this. The server creates `~/.facthouse` on first boot; you are not asked those questions.
356
+
357
+ <!-- x-release-please-start-version -->
358
+ ```json
359
+ {
360
+ "mcpServers": {
361
+ "facthouse": {
362
+ "command": "npx",
363
+ "args": ["-y", "@facthouse/mcp@0.29.0"]
364
+ }
365
+ }
366
+ }
367
+ ```
368
+ <!-- x-release-please-end -->
369
+
368
370
  ### Hooks (after the first consolidate)
369
371
 
370
372
  `mcp.json` `env` is **not** visible to hooks. Pass the same `--data` (or set `FACTHOUSE_DATA` in the environment the client itself inherits). The command must invoke the CLI (`facthouse`), never the server binary. `npx -y @facthouse/mcp` with no `-p` / `facthouse` starts the MCP **server** and hangs a hook. Pin the package version, quote it if the hook runs PowerShell, and put `--` before `facthouse` so a globally installed older binary on PATH cannot win.
@@ -381,7 +383,7 @@ Do not install record hooks on this store — both write the same rows. Facthous
381
383
  "hooks": [
382
384
  {
383
385
  "type": "command",
384
- "command": "npx -y -p @facthouse/mcp@0.28.0 -- facthouse notify compaction --data /absolute/path/to/the-same-store"
386
+ "command": "npx -y -p @facthouse/mcp@0.29.0 -- facthouse notify compaction --data /absolute/path/to/the-same-store"
385
387
  }
386
388
  ]
387
389
  }
@@ -464,7 +466,7 @@ Throwaway store, not the capture path for a real Claude Code or Cursor home. The
464
466
  <!-- x-release-please-start-version -->
465
467
  ```bash
466
468
  export FACTHOUSE_DATA=/tmp/facthouse-demo
467
- om() { npx -y -p "@facthouse/mcp@0.28.0" -- facthouse "$@"; }
469
+ om() { npx -y -p "@facthouse/mcp@0.29.0" -- facthouse "$@"; }
468
470
 
469
471
  om init --yes
470
472
 
@@ -479,7 +481,7 @@ om stats
479
481
 
480
482
  ```powershell
481
483
  $env:FACTHOUSE_DATA = Join-Path $env:TEMP "facthouse-demo"
482
- function om { npx -y -p "@facthouse/mcp@0.28.0" -- facthouse @args }
484
+ function om { npx -y -p "@facthouse/mcp@0.29.0" -- facthouse @args }
483
485
  om init --yes
484
486
  om record --role user --content "I prefer dark mode in every editor, and I never want telemetry enabled."
485
487
  om record --role user --content "I am allergic to shellfish, so avoid seafood restaurants when booking anything."
@@ -1,25 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import "../suppress-sqlite-warning.js";
3
- import { type ConsolidationResult } from "../intelligence/consolidate.js";
4
- import { type ConsolidateSteps } from "../intelligence/steps.js";
5
- import type { IntelligenceProvider } from "../intelligence/types.js";
6
- import type { EmbeddingProvider } from "../embedding/types.js";
7
- import { type ServerConfig } from "../types/config.js";
8
- interface ConsolidateStoreOpts {
9
- /** undefined: default cap; null: no cap; number: that many oldest lines. */
10
- extractLimit?: number | null;
11
- /** Init historic window. See ConsolidateCaller.extractSince. */
12
- extractSince?: Date;
13
- /** Print the result object instead of the human summary. */
14
- json?: boolean;
15
- /** Print nothing on success (the init offer prints its own lines). */
16
- print?: boolean;
17
- }
18
2
  /**
19
- * Open the DB at dataDir, run consolidate() with the given provider and steps,
20
- * report, then close. The copy step reads `config.sources` through the same
21
- * copySources the server's heartbeat uses — one copy path.
3
+ * Thin loader so `suppress-sqlite-warning` evaluates before `node:sqlite` is
4
+ * even translated. A static import of sqlite in this file (via the rest of
5
+ * the CLI graph) emits ExperimentalWarning during graph load, before any
6
+ * wrap of process.emitWarning can run.
22
7
  */
23
- export declare function consolidateInProcess(dataDir: string, provider: IntelligenceProvider, config?: Partial<ServerConfig>, embedding?: EmbeddingProvider | null, steps?: ConsolidateSteps, opts?: ConsolidateStoreOpts): Promise<ConsolidationResult | undefined>;
24
- export {};
8
+ import "../suppress-sqlite-warning.js";
25
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AAEA,OAAO,+BAA+B,CAAC;AAiEvC,OAAO,EAAe,KAAK,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACvF,OAAO,EAKL,KAAK,gBAAgB,EAEtB,MAAM,0BAA0B,CAAC;AAMlC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAkB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAipBvE,UAAU,oBAAoB;IAC5B,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,gEAAgE;IAChE,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,sEAAsE;IACtE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAmDD;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,oBAAoB,EAC9B,MAAM,GAAE,OAAO,CAAC,YAAY,CAAkB,EAC9C,SAAS,GAAE,iBAAiB,GAAG,IAAW,EAC1C,KAAK,GAAE,gBAA4B,EACnC,IAAI,GAAE,oBAAyB,GAC9B,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAgD1C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AAEA;;;;;GAKG;AACH,OAAO,+BAA+B,CAAC"}