@facthouse/mcp 0.26.0 → 0.27.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.
Files changed (66) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +611 -611
  3. package/dist/cli/inspect-html.js +460 -460
  4. package/dist/cli/inspect-intelligence.js +70 -70
  5. package/dist/cli/inspect-payload.js +39 -39
  6. package/dist/cli/inspect-theme.js +18 -18
  7. package/dist/cli/spend-dashboard.js +4 -4
  8. package/dist/cli/stats-html.js +674 -674
  9. package/dist/cli/web.js +89 -89
  10. package/dist/db/consolidation-lock.js +2 -2
  11. package/dist/db/consolidations.js +15 -15
  12. package/dist/db/embeddings.js +10 -10
  13. package/dist/db/entities.js +26 -26
  14. package/dist/db/extract-watermarks.js +79 -79
  15. package/dist/db/facts.js +39 -39
  16. package/dist/db/inferences.js +8 -8
  17. package/dist/db/intelligence-runs.js +5 -5
  18. package/dist/db/postgres-schema.js +323 -323
  19. package/dist/db/prune.js +17 -17
  20. package/dist/db/schema.js +530 -530
  21. package/dist/db/session-facts.js +26 -26
  22. package/dist/db/sessions.js +10 -10
  23. package/dist/db/sources.js +1 -1
  24. package/dist/db/stats.js +10 -10
  25. package/dist/db/watermarks.js +7 -7
  26. package/dist/intelligence/consolidate.js +35 -35
  27. package/dist/intelligence/extract-prompt.js +26 -26
  28. package/dist/intelligence/token-budget.d.ts +2 -0
  29. package/dist/intelligence/token-budget.d.ts.map +1 -1
  30. package/dist/intelligence/token-budget.js +1 -1
  31. package/dist/intelligence/token-budget.js.map +1 -1
  32. package/dist/search/episodes.js +14 -14
  33. package/dist/search/key-facts.js +3 -3
  34. package/dist/tools/fact-manager.js +3 -3
  35. package/dist/tools/read-tools.js +4 -4
  36. package/package.json +62 -62
  37. package/dist/cli/log-event.d.ts +0 -55
  38. package/dist/cli/log-event.d.ts.map +0 -1
  39. package/dist/cli/log-event.js +0 -149
  40. package/dist/cli/log-event.js.map +0 -1
  41. package/dist/db/scheduler-signal.d.ts +0 -20
  42. package/dist/db/scheduler-signal.d.ts.map +0 -1
  43. package/dist/db/scheduler-signal.js +0 -32
  44. package/dist/db/scheduler-signal.js.map +0 -1
  45. package/dist/schemas/starter-vocabulary.d.ts +0 -34
  46. package/dist/schemas/starter-vocabulary.d.ts.map +0 -1
  47. package/dist/schemas/starter-vocabulary.js +0 -91
  48. package/dist/schemas/starter-vocabulary.js.map +0 -1
  49. package/dist/search/profile.d.ts +0 -31
  50. package/dist/search/profile.d.ts.map +0 -1
  51. package/dist/search/profile.js +0 -43
  52. package/dist/search/profile.js.map +0 -1
  53. package/dist/sources/jsonl-ingest.d.ts +0 -58
  54. package/dist/sources/jsonl-ingest.d.ts.map +0 -1
  55. package/dist/sources/jsonl-ingest.js +0 -195
  56. package/dist/sources/jsonl-ingest.js.map +0 -1
  57. package/dist/sources/pull.d.ts +0 -85
  58. package/dist/sources/pull.d.ts.map +0 -1
  59. package/dist/sources/pull.js +0 -145
  60. package/dist/sources/pull.js.map +0 -1
  61. package/dist/types.d.ts +0 -115
  62. package/dist/types.d.ts.map +0 -1
  63. package/dist/types.js +0 -6
  64. package/dist/types.js.map +0 -1
  65. package/dist/warnings.d.ts.map +0 -1
  66. package/dist/warnings.js.map +0 -1
package/README.md CHANGED
@@ -1,611 +1,611 @@
1
- # Facthouse
2
-
3
- <img src="brand/mascot-right.png" width="128" align="right" alt="Facthouse mascot">
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).
8
-
9
- [![npm](https://img.shields.io/npm/v/@facthouse/mcp.svg)](https://www.npmjs.com/package/@facthouse/mcp)
10
- [![CI](https://github.com/gordonkjlee/facthouse/actions/workflows/ci.yml/badge.svg)](https://github.com/gordonkjlee/facthouse/actions/workflows/ci.yml)
11
- [![License: MIT](https://img.shields.io/github/license/gordonkjlee/facthouse)](LICENSE)
12
-
13
- It records, stores, and retrieves structured knowledge. Domain routing, entity extraction, deduplication, and supersession run in the server. Exposed as an MCP server.
14
-
15
- ## Quick Start
16
-
17
- Needs Node 22.5 or 24+.
18
-
19
- Paste this. Restart the client. The server creates `~/.facthouse` on first boot.
20
-
21
- <!-- x-release-please-start-version -->
22
- ```json
23
- {
24
- "mcpServers": {
25
- "facthouse": {
26
- "command": "npx",
27
- "args": ["-y", "@facthouse/mcp@0.26.0"]
28
- }
29
- }
30
- }
31
- ```
32
- <!-- x-release-please-end -->
33
-
34
- In the client, state something durable in ordinary conversation — there is no remember command.
35
-
36
- That is the store. Transcript file (Claude Code or Cursor): next section. CLI: [below](#cli).
37
-
38
- ## How conversations get in
39
-
40
- Two ways. Pick one per store.
41
-
42
- | | Copy from transcripts | The assistant records |
43
- |---|---|---|
44
- | Who | Claude Code or Cursor, when that client writes a JSONL file here | Any MCP client (Grok Build, Desktop, …) |
45
- | How | Name a source; Facthouse copies new lines into your file | Empty `sources`; the assistant calls `capture_fact` |
46
- | First run | TTY walk-through, pick **copy**, set cwd, then `facthouse consolidate` | The paste above (already record) |
47
-
48
- 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.
49
-
50
- ```bash
51
- facthouse init
52
- ```
53
-
54
- Pick copy, set cwd, then `facthouse consolidate` once. It copies your transcripts, extracts facts from the oldest 50 events, and integrates them; `--all` takes the whole backlog. After that, the server copies new lines when it handles a call.
55
-
56
- Compact (optional): `facthouse notify compaction` — not a turn-end Stop hook.
57
-
58
- Replay: [facthouse.dev/demo.html](https://facthouse.dev/demo.html).
59
-
60
- ## What you get
61
-
62
- - **Local SQLite.** Optional Postgres. Isolation is the directory, not a column.
63
- - **Entity graph.** People, organisations, projects, places, products — extracted, typed and linked.
64
- - **Hybrid search.** BM25 + structured domain + entity-graph paths, merged via Reciprocal Rank Fusion. An embedding provider adds meaning as a fourth list; off by default.
65
- - **In-session memory.** `get_session_context` is the same briefing as `memory://briefing`. Tools-only clients should call it at session start.
66
- - **Immutable history.** Facts are never deleted, only superseded.
67
-
68
- ## How it works
69
-
70
- One SQLite database. Three tables in it, not three databases:
71
-
72
- - **D** (`session_events`) — what was said (copied transcripts, or what the assistant records)
73
- - **I** (`session_facts`) — what was just extracted, or `capture_fact`
74
- - **K** (`facts`) — integrated knowledge
75
-
76
- FTS5 (words) and optional embeddings (meaning) are indexes of **K**. They are not a second store. Semantic search is off unless you turn it on: `search "shellfish"` finds a shellfish fact, `search "food"` does not, until you choose an embedding model — a model is an opinion about what “similar” means.
77
-
78
- Two speeds. **Extract** turns new transcript lines into self-contained facts. **Integrate** fits them into what the store already knows: domains, entities, duplicates, contradictions, the graph. `consolidate` runs copy, extract, and integrate together — in the server at session start and at compaction, or by hand from the CLI. Extract is capped at 50 events per run, so a first backfill is never spent on the lot. The MCP server copies the raw log on a call; it does not extract then. Consolidation does not invent a sentence nobody said.
79
-
80
- Storage needs Node. Intelligence needs a language model. By default that is the [Claude Code CLI](https://github.com/anthropics/claude-code) on your existing subscription. Without it, consolidation falls back to a built-in heuristic that **does not extract facts from transcripts**. `capture_fact` still stores facts, with no entities and no domain routing.
81
-
82
- ## MCP
83
-
84
- Works with Claude Code, Claude Desktop, and any MCP-compatible tool. Data is stored at `~/.facthouse` by default. That one directory is the whole install. To use a different path, add `"env": { "FACTHOUSE_DATA": "/absolute/path" }` to the MCP snippet. JSON accepts forward slashes on Windows.
85
-
86
- Cursor consumes tools but not resources until a later adapter exists — `search_knowledge` and `get_entity` still work there; call `get_session_context` at session start.
87
-
88
- Resources are context the client loads **automatically** — no tool call. Tools only help if the assistant remembers to reach for them; resources are simply present.
89
-
90
- - `memory://briefing` — Everything worth knowing right now: profile, what was learned in the last consolidation, open threads, and recent knowledge. Markdown, kept to roughly a screenful.
91
- - `memory://profile` — Core identity facts, most important first.
92
-
93
- Both are read-only views over the same database the tools query. Clients that never load resources (Cursor, Windsurf, Grok) get the same briefing by calling `get_session_context` at the start of a conversation. No second profile schema.
94
-
95
- ### Tools
96
-
97
- **Session**
98
-
99
- - `log_event` — Log conversation events (messages, artifacts).
100
- - `get_events` — Retrieve events from current or previous session.
101
- - `get_session_context` — Working briefing (the same markdown as `memory://briefing`) plus facts captured in this session. Call at the start of every conversation if the client does not load resources.
102
-
103
- **Reading**
104
-
105
- - `get_entity` — Everything known about any named subject — person, organisation, project, place, product — and how it connects. When several rows share the name under different types, facts from all of them come back. Hyphens, underscores, and stray punctuation count as the same letters only when that does not join two names already stored as separate rows. If there is no entity by that name, facts that mention the wording still come back rather than an empty miss.
106
- - `get_context` — Everything relevant to a topic (search + entity traversal)
107
- - `search_knowledge` — Hybrid search across integrated knowledge
108
-
109
- **Writing**
110
-
111
- - `capture_fact` — Store a fact. On a copy store this is a correction for something extraction missed; on a store with empty `sources` it is how facts get in. The description the assistant sees is generated from that same rule.
112
- - `consolidate` — Integrate pending facts into long-term knowledge. Extracts entities, resolves duplicates, detects contradictions, builds the knowledge graph.
113
- - Inference tools — Opt-in, off by default (`inferences.enabled` in config.json). A hypothesis cites existing fact ids and stays pending until confirmed. Those tools are not registered until you turn the gate on. Consolidate never invents a sentence nobody said.
114
-
115
- **Meta**
116
-
117
- - `get_schemas` — Available domains and structure
118
- - `get_stats` — Fact count, entity count, domain distribution, extract backlog, intelligence spend
119
-
120
- ## CLI
121
-
122
- 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.
123
-
124
- 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/....
125
-
126
- <!-- x-release-please-start-version -->
127
- ```bash
128
- npm install -g @facthouse/mcp@0.26.0
129
- facthouse init --yes
130
- ```
131
-
132
- ```bash
133
- npx -y -p "@facthouse/mcp@0.26.0" -- facthouse init --yes
134
- npx -y -p "@facthouse/mcp@0.26.0" -- facthouse settings --json
135
- npx -y -p "@facthouse/mcp@0.26.0" -- facthouse stats
136
- npx -y -p "@facthouse/mcp@0.26.0" -- facthouse inspect
137
- ```
138
- <!-- x-release-please-end -->
139
-
140
- | Job | Use |
141
- |-----|-----|
142
- | MCP server (what the client starts) | The JSON snippet: `npx` with args `-y` and a **pinned** `@facthouse/mcp@…`. No global install. |
143
- | `facthouse` on PATH | `npm install -g @facthouse/mcp@…` (same pin). Update it when you bump the snippet. |
144
- | Change extra knobs later | `facthouse settings` (or `settings --data <dir>`). Does not reset the file. |
145
- | One CLI command, no PATH | `npx -y -p "@facthouse/mcp@…" -- facthouse …` |
146
-
147
- #### `facthouse init [dir]`
148
-
149
- The walk-through is how a human first-run writes `config.json`. Skip it and the server still creates the directory on first MCP boot.
150
-
151
- On a terminal, init asks data directory, **copy transcripts vs assistant records** (default copy), semantic search, and More settings. `--yes` never prompts and leaves `sources` empty. `--web` prints a `127.0.0.1` URL and does not open a browser; `--yes` refuses `--web`. On a terminal, `--force` still asks those questions, then replaces the whole file; `--yes --force` is the silent reset. `--force` does not merge with the previous file.
152
-
153
- ```bash
154
- facthouse init --yes
155
- ```
156
-
157
- ```bash
158
- facthouse init --yes ~/my-memory
159
- ```
160
-
161
- ```bash
162
- facthouse init --yes --force
163
- ```
164
-
165
- The generated `config.json` is where you change consolidation behaviour — most notably `intelligence.provider` (`cli` by default; `heuristic` for a zero-dependency regex fallback, or `FACTHOUSE_PROVIDER=heuristic` at runtime). Init does not ask that field.
166
-
167
- #### `facthouse settings`
168
-
169
- Change extra knobs on an existing `config.json` (CLI model, timeout, optional local extract). Does not reset the rest of the file. Refuses if there is no `config.json` (this command does not create a store). `--json` / not a terminal prints the current knobs and does not write. `--web` is the same knobs on a local page (print URL, no auto-open).
170
-
171
- ```bash
172
- facthouse settings
173
- ```
174
-
175
- ```bash
176
- facthouse settings --data ~/my-memory
177
- ```
178
-
179
- #### `facthouse record`
180
-
181
- Inserts events directly into the database (no running server needed). Supported for demos and for stores that have no named source. Not the Claude Code or Cursor default — that is `sources` plus `facthouse consolidate`.
182
-
183
- ```bash
184
- # From a hook (reads JSON payload from stdin):
185
- echo '{"hook_event_name":"UserPromptSubmit","prompt":"hello"}' | facthouse record --role user
186
-
187
- # With explicit content:
188
- facthouse record --role user --event-type message --content "hello world"
189
-
190
- # Options:
191
- # --role user | assistant | system | tool (default: user)
192
- # --event-type message | tool_call | tool_result | artifact (default: message)
193
- # --content-type text | json | image | audio | binary (default: text)
194
- # --content Event content (or pipe via stdin)
195
- # --speaker Named participant when the transcript has one
196
- # --session-id Target session (default: most recent)
197
- # --data Data directory (default: ~/.facthouse or FACTHOUSE_DATA)
198
- ```
199
-
200
- #### `facthouse consolidate`
201
-
202
- Copy new lines from `config.sources`, extract candidate facts from them, and integrate the pending facts into knowledge. The one command that spends model calls:
203
-
204
- ```bash
205
- facthouse consolidate
206
- facthouse consolidate --copy # copy only; spends nothing
207
- facthouse consolidate --integrate # pending facts to knowledge; no extract pass
208
- facthouse consolidate --all # extract the whole backlog now
209
- facthouse consolidate --limit 200 # extract the oldest 200
210
-
211
- # Steps — named steps run, in order; none named means all three:
212
- # -c, --copy copy new transcript lines into events
213
- # -e, --extract turn new events into candidate facts (the model call)
214
- # -i, --integrate classify, link, dedupe, supersede, embed
215
- # Extract is capped at 50 events per run so a first backfill is never spent on
216
- # the lot; the run says how many remain. --all lifts the cap, --limit N sets it.
217
- # --json print the result object instead of the summary
218
- # --data Data directory (default: ~/.facthouse or FACTHOUSE_DATA)
219
- ```
220
-
221
- Honours the configured provider (by default `claude -p`). Empty `sources` makes the copy step a no-op. Set `cwd` on the source unless you intend to copy every project group. Do not also run `record` hooks on a store with named sources.
222
-
223
- #### `facthouse notify <moment>`
224
-
225
- Tell the running MCP server that a moment happened. The server decides what to run and does it in the background, so a hook returns at once:
226
-
227
- ```bash
228
- facthouse notify compaction # the client window is about to collapse: copy, extract, integrate now
229
- facthouse notify threshold # events arrived: extract if the threshold is due
230
-
231
- # Options:
232
- # --data Data directory (default: ~/.facthouse or FACTHOUSE_DATA)
233
- ```
234
-
235
- No server listening is not an error: the command says so and exits 0, and the next session start covers it. This is what the PreCompact hook calls.
236
-
237
- #### `facthouse search <query>`
238
-
239
- ```bash
240
- facthouse search "coffee"
241
- facthouse search "coffee" --domain preferences
242
- facthouse search "coffee" --json
243
-
244
- # Options:
245
- # --domain Prioritise a domain. Biases ranking; does not filter
246
- # --limit Maximum results (default: 20)
247
- # --json Emit the raw search payload
248
- # --data Data directory (default: ~/.facthouse or FACTHOUSE_DATA)
249
- ```
250
-
251
- `--domain` **biases ranking rather than filtering.** A hard filter would hide a fact filed under a near-synonym.
252
-
253
- #### `facthouse stats`
254
-
255
- ```bash
256
- facthouse stats
257
- facthouse stats --json
258
- ```
259
-
260
- Facts are immutable — superseded facts are kept — so the current count and the total legitimately differ once anything has been superseded. `--json` includes the answering binary's package version. Intelligence spend is calls, tokens, and elapsed time for extract / classify / entities / reconcile / supersede / summarise, with provider and model per stage. Embeddings are not that number.
261
-
262
- #### `facthouse inspect`
263
-
264
- Sample D, I, K, entities, and the graph. Writes a local HTML file under the data directory (not the cwd). Prints the path. Does not open a browser. The file is a memory export — treat it like `stats --json`. The same page also shows intelligence spend (Graph / Spend).
265
-
266
- ```bash
267
- facthouse inspect
268
- facthouse inspect --graph
269
- facthouse inspect --layer k
270
- facthouse inspect --json
271
- facthouse inspect --entity Helios --limit 20 --output ~/inspect.html
272
- ```
273
-
274
- `--layer health|d|i|k|entities|graph|all` prints terminal tables (newest-first, capped). `--graph` (the default when no `--layer` / `--json`) writes `inspect.html`. `--limit` is 10 for tables and 50 for the canvas. `--all` draws every node — a hairball, explicit. Search and type filter in the page can still reach a node that was outside the cap.
275
-
276
- ## Advanced
277
-
278
- ### Another store
279
-
280
- 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.
281
-
282
- 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:
283
-
284
- <!-- x-release-please-start-version -->
285
- ```json
286
- {
287
- "mcpServers": {
288
- "facthouse-personal": {
289
- "command": "npx",
290
- "args": ["-y", "@facthouse/mcp@0.26.0"],
291
- "env": { "FACTHOUSE_DATA": "C:\\Users\\alex\\.facthouse-personal" }
292
- },
293
- "facthouse-work": {
294
- "command": "npx",
295
- "args": ["-y", "@facthouse/mcp@0.26.0"],
296
- "env": { "FACTHOUSE_DATA": "C:\\Users\\alex\\.facthouse-work" }
297
- }
298
- }
299
- }
300
- ```
301
- <!-- x-release-please-end -->
302
-
303
- Point each store's `sources.cwd` (or hook `--data`) at that store only. Two directories do not isolate anything if both copy the same home.
304
-
305
- ### Postgres (optional)
306
-
307
- SQLite is the default and needs no extra software. To use Postgres instead, set `storage.provider` to `"postgres"` in that store's `config.json`, or `FACTHOUSE_STORAGE=postgres` on the MCP entry, and set `FACTHOUSE_POSTGRES_URL` to a `postgres://` (or `postgresql://`) URL. The password belongs in the environment, not in `config.json`. If the URL is missing or the server cannot be reached, Facthouse stops; it does not create a SQLite file.
308
-
309
- The data directory is still the memory: `config.json` and the scheduler socket live there. Tables live at the URL. Two memories need two directories and two databases.
310
-
311
- Init does not ask which engine to use. `facthouse init --yes` still writes sqlite.
312
-
313
- Example — placeholders only; do not put a real password in a committed file:
314
-
315
- <!-- x-release-please-start-version -->
316
- ```json
317
- {
318
- "mcpServers": {
319
- "facthouse": {
320
- "command": "npx",
321
- "args": ["-y", "@facthouse/mcp@0.26.0"],
322
- "env": {
323
- "FACTHOUSE_DATA": "C:\\Users\\alex\\.facthouse-work",
324
- "FACTHOUSE_STORAGE": "postgres",
325
- "FACTHOUSE_POSTGRES_URL": "postgres://USER:PASSWORD@localhost:5432/facthouse"
326
- }
327
- }
328
- }
329
- }
330
- ```
331
- <!-- x-release-please-end -->
332
-
333
- ### Copy versus record
334
-
335
- Choose one mechanism per store.
336
-
337
- **Recommended — copy.** Name a `claude-code` or `cursor` source (set `cwd`) and run `facthouse consolidate` from the CLI first. The MCP server also copies at session start and when it handles a call. Grok and Codex are later adapters. Unknown `kind` values are rejected.
338
-
339
- ```json
340
- {
341
- "sources": [
342
- {
343
- "kind": "claude-code",
344
- "home": "~/.claude",
345
- "cwd": "C:\\dev\\app"
346
- }
347
- ]
348
- }
349
- ```
350
-
351
- `home` is the client config dir (`~/.claude` or `~/.cursor` — path examples, not extra discovery). Cursor is `"kind": "cursor"` and `home/projects/*/agent-transcripts/**/*.jsonl` only — not Composer SQLite. Cursor encodes `C:\\dev\\app` as `c-dev-app` (Claude Code uses `C--dev-app`). A first backfill of more than 50 events takes several runs, or one `facthouse consolidate --all`.
352
-
353
- **Alternative — record, no sources.** Leave `sources` empty. Pipe a client hook payload into `facthouse record` if you have one. MCP `log_event` / `capture_fact` keep working.
354
-
355
- Do not install record hooks on this store — both write the same rows. Facthouse does not detect or rewrite existing hook configs.
356
-
357
- ### Hooks (after the first consolidate)
358
-
359
- `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.
360
-
361
- <details>
362
- <summary>PreCompact hook JSON</summary>
363
-
364
- <!-- x-release-please-start-version -->
365
- ```json
366
- {
367
- "hooks": {
368
- "PreCompact": [
369
- {
370
- "hooks": [
371
- {
372
- "type": "command",
373
- "command": "npx -y -p @facthouse/mcp@0.26.0 -- facthouse notify compaction --data /absolute/path/to/the-same-store"
374
- }
375
- ]
376
- }
377
- ]
378
- }
379
- }
380
- ```
381
- <!-- x-release-please-end -->
382
-
383
- </details>
384
-
385
- PreCompact `notify compaction` asks the running server to consolidate: copy the newest JSONL lines, extract, integrate. The hook returns at once; the server does the work. We do not install a turn-end Stop hook. On Windows the `--data` path is the same absolute directory you put in `FACTHOUSE_DATA` (for example `C:\\Users\\alex\\AppData\\Local\\Temp\\facthouse-try`).
386
-
387
- Frequent incremental copying interleaves conversations on the global sequence: a long chat kept open is sliced between other chats. Extract progress is per conversation, so a timeout in one chat does not discard another. Shrinking `extraction.batch_size` means more extract calls (more chances of a timeout), not a store-wide hold-all. `facthouse stats` reports unextracted events against that extract watermark.
388
-
389
- If the MCP server does not start, or lists no tools, check the package version the client actually spawned. A global `facthouse` on PATH can be years behind the pin in this README. Diagnose with `facthouse stats --data <dir>` (the CLI prints whether the scheduler is listening) and by inspecting `serverInfo.version` from `initialize` plus `tools/list` over stdio. `0.2.x` answers `initialize` then throws on `tools/list`.
390
-
391
- ### Embeddings, model, timeout, bitemporal
392
-
393
- Set `embedding.provider` in `config.json` to `"ollama"` (local, no API key) or `"voyage"` (hosted), run `facthouse consolidate`, and `search "food"` starts returning the allergy. Facts are embedded when they are consolidated. Voyage applies a **3 requests/minute** rate limit until a payment method is on the account.
394
-
395
- Meaning-search is an exact scan of stored vectors when the set is small. When that set is large (default 32 MiB of the current model), an HNSW index of those vectors is used instead: in-process on SQLite, or a Postgres `vector` sidecar when the extension is enabled. Small stores stay exact. A missing engine keeps exact search and prints a warning; Facthouse does not install a native addon. `embedding.ann` is `null` (auto), `false` (never), or `true` (force when the engine allows). This does not turn embeddings on.
396
-
397
- `intelligence.cli.model` and `intelligence.cli.timeout_ms` are extra knobs. First-run More settings (Y) can write them; later, `facthouse settings`. Init does not ask `intelligence.provider`; `FACTHOUSE_PROVIDER=heuristic` is the kill-switch. The heuristic fallback **does not extract facts from transcripts**.
398
-
399
- Unnamed user-channel speech is attributed to the store's owner; a display name still does not create a person. Extra backing (assent, a tool observation, a different speaker restating) is recorded, not scored, unless the store sets `interlocutor` ranking weights in `config.json`. The engine ships none. Weight keys match the speaker string as stored, so two people with the same name share a key.
400
-
401
- Set `temporal.mode` to `bitemporal` to record when the system retracted a belief, so search can answer what the store believed at an instant.
402
-
403
- ### Intelligence spend
404
-
405
- `facthouse stats` and `get_stats` report billed consolidation calls: tokens, elapsed time, and the provider plus model on each stage (extract, classify, entities, reconcile, supersede, summarise). A run that did not report tokens omits those fields rather than showing zero. Embeddings are a different API and are not this number.
406
-
407
- Optional `intelligence.token_budget` caps billed extract per provider on rolling windows. Unset is unlimited. Over the cap, consolidate skips extract, holds the watermark, and does not fall back to the heuristic. Stats and inspect Spend show used and remaining on each cap, and when oldest usage in that window ages out (`resets`).
408
-
409
- ```json
410
- "intelligence": {
411
- "token_budget": {
412
- "cli": { "week": "10M" }
413
- }
414
- }
415
- ```
416
-
417
- `hour`, `day`, `week`, and `month` are rolling. Omit a scale to leave it unlimited. Remaining room is on `facthouse stats`, `get_stats`, and inspect Spend. Set the cap in this store's `config.json` — there is no budget command.
418
-
419
- Optional local intelligence is a different switch from embeddings. Add `intelligence.http` on an OpenAI-compatible host. The protocol is `POST /v1/chat/completions`; only the port changes:
420
-
421
- | Host | Typical URL |
422
- |------|-------------|
423
- | Ollama | `http://localhost:11434/v1` (the default if you omit the URL) |
424
- | LM Studio | `http://localhost:1234/v1` |
425
- | vLLM | `http://localhost:8000/v1` |
426
- | llama.cpp | `http://localhost:8080/v1` |
427
-
428
- The model string is whatever that host lists. `GET {base_url}/models` prints the names. `nomic-embed-text` is embed-only and will not extract. If the host is up and serves exactly one chat model, Facthouse uses it for this run and tells you to pin `intelligence.http.model`. If several chat models are listed, set that field; extract will not guess.
429
-
430
- Extract and summarise then use that host; reconcile and supersede stay on the CLI unless you list `intelligence.stages`. Each stage can set on-fail to cli, http, or none (see the JSON below). HTTP extract defaults to retrying on the CLI (counts against the CLI token budget). Contradiction defaults to none — no provider switch. none holds the extract watermark — it does not fall through to the heuristic. First-run More settings (Y, after the recommended path) can set the host, model, and extract on-fail. Later, `facthouse settings` merges those knobs into an existing file without resetting it. `facthouse inspect` Spend shows the same knobs and copies JSON; it does not save `config.json`.
431
-
432
- The live script `npm run test:http-intelligence` has passed on `qwen2.5vl:7b`.
433
-
434
- ```json
435
- "intelligence": {
436
- "http": {
437
- "base_url": "http://localhost:11434/v1",
438
- "model": "qwen2.5vl:7b"
439
- },
440
- "stages": {
441
- "extract": { "provider": "http", "on_fail": "cli" },
442
- "summarise": { "provider": "http", "on_fail": "cli" },
443
- "reconcile": { "provider": "cli", "on_fail": "none" },
444
- "supersede": { "provider": "cli", "on_fail": "none" }
445
- }
446
- }
447
- ```
448
-
449
- ### CLI demo (no transcript source)
450
-
451
- Throwaway store, not the capture path for a real Claude Code or Cursor home. These three lines are typed in.
452
-
453
- <!-- x-release-please-start-version -->
454
- ```bash
455
- export FACTHOUSE_DATA=/tmp/facthouse-demo
456
- om() { npx -y -p "@facthouse/mcp@0.26.0" -- facthouse "$@"; }
457
-
458
- om init --yes
459
-
460
- om record --role user --content "I prefer dark mode in every editor, and I never want telemetry enabled."
461
- om record --role user --content "I am allergic to shellfish, so avoid seafood restaurants when booking anything."
462
- om record --role user --content "My colleague Robin at Acme is leading the Atlas migration project this quarter."
463
-
464
- om consolidate
465
- om search "Atlas"
466
- om stats
467
- ```
468
-
469
- ```powershell
470
- $env:FACTHOUSE_DATA = Join-Path $env:TEMP "facthouse-demo"
471
- function om { npx -y -p "@facthouse/mcp@0.26.0" -- facthouse @args }
472
- om init --yes
473
- om record --role user --content "I prefer dark mode in every editor, and I never want telemetry enabled."
474
- om record --role user --content "I am allergic to shellfish, so avoid seafood restaurants when booking anything."
475
- om record --role user --content "My colleague Robin at Acme is leading the Atlas migration project this quarter."
476
- om consolidate
477
- om search "Atlas"
478
- om stats
479
- ```
480
- <!-- x-release-please-end -->
481
-
482
- `allergies` is not a domain Facthouse ships. The engine has no built-in vocabulary — it read the conversation and decided that fact needed a home. A domain **biases ranking rather than filtering**. Clean up: `rm -rf /tmp/facthouse-demo` (Git Bash / macOS / Linux) or `Remove-Item -Recurse -Force $env:TEMP\facthouse-demo` (PowerShell).
483
-
484
- ## Integration
485
-
486
- Facthouse's tool descriptions tell assistants when to search and when a correction is worth staging. They are not how Claude Code conversations enter the store — that is copy from a named source.
487
-
488
- ### Without configuration
489
-
490
- Claude Code or Cursor: name a `sources` entry (set `cwd`) and run `facthouse consolidate` from the CLI first. MCP session start also copies. `capture_fact` is there if the assistant needs to correct or add something copy-plus-extraction will not produce.
491
-
492
- Clients with no copy adapter still rely on `log_event` / `capture_fact` until their adapter exists.
493
-
494
- ### Hook points
495
-
496
- | Hook point | When | What to call | Why |
497
- |---|---|---|---|
498
- | Session start | Conversation begins | `memory://profile` (automatic), `search_knowledge` | The assistant knows who you are from message one |
499
- | Correction | A durable fact is missing from the store | `capture_fact` | Optional; Claude Code conversations are already in `session_events` via copy |
500
- | Pre-response search | Before generating a reply | `search_knowledge`, `get_context` | Responses informed by stored knowledge |
501
- | Pre-compaction | Before context window compression | `facthouse notify compaction` | The server copies new lines, extracts, integrates |
502
- | Natural breakpoints | Topic change, task completion | `consolidate` (optional) | Keeps the knowledge graph current |
503
-
504
- **On pre-compaction:** `facthouse notify compaction` asks the server to consolidate. It is not a `record` hook.
505
-
506
- ### Claude Code
507
-
508
- Create `.claude/rules/facthouse.md` in your project (or `~/.claude/rules/facthouse.md` globally):
509
-
510
- ```markdown
511
- # Facthouse
512
-
513
- - Conversations are copied from the named Claude Code source (first backfill: `facthouse consolidate` on the CLI)
514
- - Do not install record hooks on this store
515
- - Identity context loads automatically from the `memory://profile` resource — no tool call needed
516
- - Before answering questions this store might already know, call `search_knowledge`
517
- - Call `capture_fact` only to correct or add something that is not in the transcript
518
- - When the conversation is getting long, call `consolidate` (or rely on PreCompact `facthouse notify compaction`)
519
- - At natural breakpoints (topic change, task completion), call `consolidate` to keep the knowledge graph current
520
- ```
521
-
522
- To allow Facthouse tools without per-call approval prompts, add to the `permissions.allow` array in `.claude/settings.json`:
523
-
524
- ```json
525
- {
526
- "permissions": {
527
- "allow": [
528
- "mcp__facthouse__*"
529
- ]
530
- }
531
- }
532
- ```
533
-
534
- ### Cursor / Windsurf
535
-
536
- Add to `.cursorrules` (Cursor) or `.windsurfrules` (Windsurf) in your project root:
537
-
538
- ```
539
- When the facthouse MCP server is available:
540
- - Before answering questions this store might already know, call search_knowledge
541
- - To find out everything known about a particular person, project, or thing, call get_entity
542
- - Call capture_fact only to correct or add something copy or extraction missed
543
- - When context is getting long, call consolidate to process pending facts before they are lost
544
- ```
545
-
546
- Cursor and Windsurf consume tools but not resources, so `memory://profile` will not load on its own there. Cursor conversations themselves are copied with `kind: "cursor"` (JSONL under `~/.cursor/projects/`, not the SQLite composer store).
547
-
548
- ### Claude Desktop / other MCP clients
549
-
550
- No copy adapter yet. Tool descriptions handle search and optional `capture_fact`; conversations are not tailed until a later adapter exists.
551
-
552
- ## Reclaiming space
553
-
554
- Facthouse logs raw conversation and tool output to `session_events`. On a store wired into an agentic client this becomes almost all of the database. A store measured in daily use held 47,000 events and 493 MB against 21 integrated facts.
555
-
556
- `facthouse stats` reports the raw layer alongside the knowledge, including how much is reclaimable. To reclaim it:
557
-
558
- ```bash
559
- facthouse prune # report only — nothing is deleted
560
- facthouse prune --apply --vacuum # delete, then rebuild the file
561
- ```
562
-
563
- Set `retention.disk_budget` in `config.json` to a size such as `"2GB"` to cap `memory.db`. Unset is unlimited; init does not write a cap. When a cap is set and the file is full, unreachable raw events are pruned automatically so new logs can reuse that space; if nothing unused remains, more raw events are refused. Facts are never deleted to meet the number. Compacting (`--vacuum`) is still a human step — it copies the whole file so the operating system sees the smaller size.
564
-
565
- If most of that volume is tool output you judge to be noise, `extraction.event_types` and `extraction.roles` restrict what is examined, and `extraction.min_content_length` skips trivial events. Measure before you do. Volume and value are not the same axis.
566
-
567
- **The rule is reachability, not age.** An event is removed only when all three hold:
568
-
569
- 1. Extraction has already read it. Anything ahead of the consolidation watermark is still input.
570
- 2. No fact's provenance cites it.
571
- 3. It has fallen outside its own session's most recent `extraction.working_memory_size` events — a spare so consolidation can still glance at recent raw notes. That window is evidence of the current topic, not a pronoun dictionary.
572
-
573
- No fact, entity, embedding or search result is affected. Deleting rows does not shrink the file on its own — that is `--vacuum`. Without a cap, nothing prunes automatically.
574
-
575
- ## Development
576
-
577
- ```bash
578
- git clone https://github.com/gordonkjlee/facthouse
579
- cd facthouse
580
- npm install
581
- npm run build
582
- npm test
583
- ```
584
-
585
- `npm test` always runs hermetic pipelines (fixture JSONL → copy → extract →
586
- search) with a recording extractor, and skips live evals that need a real
587
- model:
588
-
589
- - Semantic recall needs Ollama with `nomic-embed-text`. Start it, then
590
- `npm run test:semantic`.
591
- - The live first-fact eval needs the `claude` CLI. Run `npm run test:first-fact`.
592
- - The live coding-store eval (warehouse-shaped Cursor transcripts) also
593
- needs the `claude` CLI. Run `npm run test:coding-store`.
594
- - Local HTTP extract needs a chat model on an OpenAI-compatible host and
595
- `FACTHOUSE_HTTP_MODEL` (verified on `qwen2.5vl:7b`). Run
596
- `npm run test:http-intelligence`.
597
-
598
- Each of those scripts fails rather than skips when its dependency is missing,
599
- so a green run means the claim was actually verified rather than quietly
600
- stepped over.
601
-
602
- ## Contribute
603
-
604
- Issues and pull requests are welcome. Open an issue first if the change is more than a typo.
605
-
606
- - Questions: [GitHub Discussions](https://github.com/gordonkjlee/facthouse/discussions)
607
- - How to build and test: [CONTRIBUTING.md](CONTRIBUTING.md)
608
-
609
- ## License
610
-
611
- MIT
1
+ # Facthouse
2
+
3
+ <img src="brand/mascot-right.png" width="128" align="right" alt="Facthouse mascot">
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).
8
+
9
+ [![npm](https://img.shields.io/npm/v/@facthouse/mcp.svg)](https://www.npmjs.com/package/@facthouse/mcp)
10
+ [![CI](https://github.com/gordonkjlee/facthouse/actions/workflows/ci.yml/badge.svg)](https://github.com/gordonkjlee/facthouse/actions/workflows/ci.yml)
11
+ [![License: MIT](https://img.shields.io/github/license/gordonkjlee/facthouse)](LICENSE)
12
+
13
+ It records, stores, and retrieves structured knowledge. Domain routing, entity extraction, deduplication, and supersession run in the server. Exposed as an MCP server.
14
+
15
+ ## Quick Start
16
+
17
+ Needs Node 22.5 or 24+.
18
+
19
+ Paste this. Restart the client. The server creates `~/.facthouse` on first boot.
20
+
21
+ <!-- x-release-please-start-version -->
22
+ ```json
23
+ {
24
+ "mcpServers": {
25
+ "facthouse": {
26
+ "command": "npx",
27
+ "args": ["-y", "@facthouse/mcp@0.27.1"]
28
+ }
29
+ }
30
+ }
31
+ ```
32
+ <!-- x-release-please-end -->
33
+
34
+ In the client, state something durable in ordinary conversation — there is no remember command.
35
+
36
+ That is the store. Transcript file (Claude Code or Cursor): next section. CLI: [below](#cli).
37
+
38
+ ## How conversations get in
39
+
40
+ Two ways. Pick one per store.
41
+
42
+ | | Copy from transcripts | The assistant records |
43
+ |---|---|---|
44
+ | Who | Claude Code or Cursor, when that client writes a JSONL file here | Any MCP client (Grok Build, Desktop, …) |
45
+ | How | Name a source; Facthouse copies new lines into your file | Empty `sources`; the assistant calls `capture_fact` |
46
+ | First run | TTY walk-through, pick **copy**, set cwd, then `facthouse consolidate` | The paste above (already record) |
47
+
48
+ 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.
49
+
50
+ ```bash
51
+ facthouse init
52
+ ```
53
+
54
+ Pick copy, set cwd, then `facthouse consolidate` once. It copies your transcripts, extracts facts from the oldest 50 events, and integrates them; `--all` takes the whole backlog. After that, the server copies new lines when it handles a call.
55
+
56
+ Compact (optional): `facthouse notify compaction` — not a turn-end Stop hook.
57
+
58
+ Replay: [facthouse.dev/demo.html](https://facthouse.dev/demo.html).
59
+
60
+ ## What you get
61
+
62
+ - **Local SQLite.** Optional Postgres. Isolation is the directory, not a column.
63
+ - **Entity graph.** People, organisations, projects, places, products — extracted, typed and linked.
64
+ - **Hybrid search.** BM25 + structured domain + entity-graph paths, merged via Reciprocal Rank Fusion. An embedding provider adds meaning as a fourth list; off by default.
65
+ - **In-session memory.** `get_session_context` is the same briefing as `memory://briefing`. Tools-only clients should call it at session start.
66
+ - **Immutable history.** Facts are never deleted, only superseded.
67
+
68
+ ## How it works
69
+
70
+ One SQLite database. Three tables in it, not three databases:
71
+
72
+ - **D** (`session_events`) — what was said (copied transcripts, or what the assistant records)
73
+ - **I** (`session_facts`) — what was just extracted, or `capture_fact`
74
+ - **K** (`facts`) — integrated knowledge
75
+
76
+ FTS5 (words) and optional embeddings (meaning) are indexes of **K**. They are not a second store. Semantic search is off unless you turn it on: `search "shellfish"` finds a shellfish fact, `search "food"` does not, until you choose an embedding model — a model is an opinion about what “similar” means.
77
+
78
+ Two speeds. **Extract** turns new transcript lines into self-contained facts. **Integrate** fits them into what the store already knows: domains, entities, duplicates, contradictions, the graph. `consolidate` runs copy, extract, and integrate together — in the server at session start and at compaction, or by hand from the CLI. Extract is capped at 50 events per run, so a first backfill is never spent on the lot. The MCP server copies the raw log on a call; it does not extract then. Consolidation does not invent a sentence nobody said.
79
+
80
+ Storage needs Node. Intelligence needs a language model. By default that is the [Claude Code CLI](https://github.com/anthropics/claude-code) on your existing subscription. Without it, consolidation falls back to a built-in heuristic that **does not extract facts from transcripts**. `capture_fact` still stores facts, with no entities and no domain routing.
81
+
82
+ ## MCP
83
+
84
+ Works with Claude Code, Claude Desktop, and any MCP-compatible tool. Data is stored at `~/.facthouse` by default. That one directory is the whole install. To use a different path, add `"env": { "FACTHOUSE_DATA": "/absolute/path" }` to the MCP snippet. JSON accepts forward slashes on Windows.
85
+
86
+ Cursor consumes tools but not resources until a later adapter exists — `search_knowledge` and `get_entity` still work there; call `get_session_context` at session start.
87
+
88
+ Resources are context the client loads **automatically** — no tool call. Tools only help if the assistant remembers to reach for them; resources are simply present.
89
+
90
+ - `memory://briefing` — Everything worth knowing right now: profile, what was learned in the last consolidation, open threads, and recent knowledge. Markdown, kept to roughly a screenful.
91
+ - `memory://profile` — Core identity facts, most important first.
92
+
93
+ Both are read-only views over the same database the tools query. Clients that never load resources (Cursor, Windsurf, Grok) get the same briefing by calling `get_session_context` at the start of a conversation. No second profile schema.
94
+
95
+ ### Tools
96
+
97
+ **Session**
98
+
99
+ - `log_event` — Log conversation events (messages, artifacts).
100
+ - `get_events` — Retrieve events from current or previous session.
101
+ - `get_session_context` — Working briefing (the same markdown as `memory://briefing`) plus facts captured in this session. Call at the start of every conversation if the client does not load resources.
102
+
103
+ **Reading**
104
+
105
+ - `get_entity` — Everything known about any named subject — person, organisation, project, place, product — and how it connects. When several rows share the name under different types, facts from all of them come back. Hyphens, underscores, and stray punctuation count as the same letters only when that does not join two names already stored as separate rows. If there is no entity by that name, facts that mention the wording still come back rather than an empty miss.
106
+ - `get_context` — Everything relevant to a topic (search + entity traversal)
107
+ - `search_knowledge` — Hybrid search across integrated knowledge
108
+
109
+ **Writing**
110
+
111
+ - `capture_fact` — Store a fact. On a copy store this is a correction for something extraction missed; on a store with empty `sources` it is how facts get in. The description the assistant sees is generated from that same rule.
112
+ - `consolidate` — Integrate pending facts into long-term knowledge. Extracts entities, resolves duplicates, detects contradictions, builds the knowledge graph.
113
+ - Inference tools — Opt-in, off by default (`inferences.enabled` in config.json). A hypothesis cites existing fact ids and stays pending until confirmed. Those tools are not registered until you turn the gate on. Consolidate never invents a sentence nobody said.
114
+
115
+ **Meta**
116
+
117
+ - `get_schemas` — Available domains and structure
118
+ - `get_stats` — Fact count, entity count, domain distribution, extract backlog, intelligence spend
119
+
120
+ ## CLI
121
+
122
+ 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.
123
+
124
+ 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/....
125
+
126
+ <!-- x-release-please-start-version -->
127
+ ```bash
128
+ npm install -g @facthouse/mcp@0.27.1
129
+ facthouse init --yes
130
+ ```
131
+
132
+ ```bash
133
+ npx -y -p "@facthouse/mcp@0.27.1" -- facthouse init --yes
134
+ npx -y -p "@facthouse/mcp@0.27.1" -- facthouse settings --json
135
+ npx -y -p "@facthouse/mcp@0.27.1" -- facthouse stats
136
+ npx -y -p "@facthouse/mcp@0.27.1" -- facthouse inspect
137
+ ```
138
+ <!-- x-release-please-end -->
139
+
140
+ | Job | Use |
141
+ |-----|-----|
142
+ | MCP server (what the client starts) | The JSON snippet: `npx` with args `-y` and a **pinned** `@facthouse/mcp@…`. No global install. |
143
+ | `facthouse` on PATH | `npm install -g @facthouse/mcp@…` (same pin). Update it when you bump the snippet. |
144
+ | Change extra knobs later | `facthouse settings` (or `settings --data <dir>`). Does not reset the file. |
145
+ | One CLI command, no PATH | `npx -y -p "@facthouse/mcp@…" -- facthouse …` |
146
+
147
+ #### `facthouse init [dir]`
148
+
149
+ The walk-through is how a human first-run writes `config.json`. Skip it and the server still creates the directory on first MCP boot.
150
+
151
+ On a terminal, init asks data directory, **copy transcripts vs assistant records** (default copy), semantic search, and More settings. `--yes` never prompts and leaves `sources` empty. `--web` prints a `127.0.0.1` URL and does not open a browser; `--yes` refuses `--web`. On a terminal, `--force` still asks those questions, then replaces the whole file; `--yes --force` is the silent reset. `--force` does not merge with the previous file.
152
+
153
+ ```bash
154
+ facthouse init --yes
155
+ ```
156
+
157
+ ```bash
158
+ facthouse init --yes ~/my-memory
159
+ ```
160
+
161
+ ```bash
162
+ facthouse init --yes --force
163
+ ```
164
+
165
+ The generated `config.json` is where you change consolidation behaviour — most notably `intelligence.provider` (`cli` by default; `heuristic` for a zero-dependency regex fallback, or `FACTHOUSE_PROVIDER=heuristic` at runtime). Init does not ask that field.
166
+
167
+ #### `facthouse settings`
168
+
169
+ Change extra knobs on an existing `config.json` (CLI model, timeout, optional local extract). Does not reset the rest of the file. Refuses if there is no `config.json` (this command does not create a store). `--json` / not a terminal prints the current knobs and does not write. `--web` is the same knobs on a local page (print URL, no auto-open).
170
+
171
+ ```bash
172
+ facthouse settings
173
+ ```
174
+
175
+ ```bash
176
+ facthouse settings --data ~/my-memory
177
+ ```
178
+
179
+ #### `facthouse record`
180
+
181
+ Inserts events directly into the database (no running server needed). Supported for demos and for stores that have no named source. Not the Claude Code or Cursor default — that is `sources` plus `facthouse consolidate`.
182
+
183
+ ```bash
184
+ # From a hook (reads JSON payload from stdin):
185
+ echo '{"hook_event_name":"UserPromptSubmit","prompt":"hello"}' | facthouse record --role user
186
+
187
+ # With explicit content:
188
+ facthouse record --role user --event-type message --content "hello world"
189
+
190
+ # Options:
191
+ # --role user | assistant | system | tool (default: user)
192
+ # --event-type message | tool_call | tool_result | artifact (default: message)
193
+ # --content-type text | json | image | audio | binary (default: text)
194
+ # --content Event content (or pipe via stdin)
195
+ # --speaker Named participant when the transcript has one
196
+ # --session-id Target session (default: most recent)
197
+ # --data Data directory (default: ~/.facthouse or FACTHOUSE_DATA)
198
+ ```
199
+
200
+ #### `facthouse consolidate`
201
+
202
+ Copy new lines from `config.sources`, extract candidate facts from them, and integrate the pending facts into knowledge. The one command that spends model calls:
203
+
204
+ ```bash
205
+ facthouse consolidate
206
+ facthouse consolidate --copy # copy only; spends nothing
207
+ facthouse consolidate --integrate # pending facts to knowledge; no extract pass
208
+ facthouse consolidate --all # extract the whole backlog now
209
+ facthouse consolidate --limit 200 # extract the oldest 200
210
+
211
+ # Steps — named steps run, in order; none named means all three:
212
+ # -c, --copy copy new transcript lines into events
213
+ # -e, --extract turn new events into candidate facts (the model call)
214
+ # -i, --integrate classify, link, dedupe, supersede, embed
215
+ # Extract is capped at 50 events per run so a first backfill is never spent on
216
+ # the lot; the run says how many remain. --all lifts the cap, --limit N sets it.
217
+ # --json print the result object instead of the summary
218
+ # --data Data directory (default: ~/.facthouse or FACTHOUSE_DATA)
219
+ ```
220
+
221
+ Honours the configured provider (by default `claude -p`). Empty `sources` makes the copy step a no-op. Set `cwd` on the source unless you intend to copy every project group. Do not also run `record` hooks on a store with named sources.
222
+
223
+ #### `facthouse notify <moment>`
224
+
225
+ Tell the running MCP server that a moment happened. The server decides what to run and does it in the background, so a hook returns at once:
226
+
227
+ ```bash
228
+ facthouse notify compaction # the client window is about to collapse: copy, extract, integrate now
229
+ facthouse notify threshold # events arrived: extract if the threshold is due
230
+
231
+ # Options:
232
+ # --data Data directory (default: ~/.facthouse or FACTHOUSE_DATA)
233
+ ```
234
+
235
+ No server listening is not an error: the command says so and exits 0, and the next session start covers it. This is what the PreCompact hook calls.
236
+
237
+ #### `facthouse search <query>`
238
+
239
+ ```bash
240
+ facthouse search "coffee"
241
+ facthouse search "coffee" --domain preferences
242
+ facthouse search "coffee" --json
243
+
244
+ # Options:
245
+ # --domain Prioritise a domain. Biases ranking; does not filter
246
+ # --limit Maximum results (default: 20)
247
+ # --json Emit the raw search payload
248
+ # --data Data directory (default: ~/.facthouse or FACTHOUSE_DATA)
249
+ ```
250
+
251
+ `--domain` **biases ranking rather than filtering.** A hard filter would hide a fact filed under a near-synonym.
252
+
253
+ #### `facthouse stats`
254
+
255
+ ```bash
256
+ facthouse stats
257
+ facthouse stats --json
258
+ ```
259
+
260
+ Facts are immutable — superseded facts are kept — so the current count and the total legitimately differ once anything has been superseded. `--json` includes the answering binary's package version. Intelligence spend is calls, tokens, and elapsed time for extract / classify / entities / reconcile / supersede / summarise, with provider and model per stage. Embeddings are not that number.
261
+
262
+ #### `facthouse inspect`
263
+
264
+ Sample D, I, K, entities, and the graph. Writes a local HTML file under the data directory (not the cwd). Prints the path. Does not open a browser. The file is a memory export — treat it like `stats --json`. The same page also shows intelligence spend (Graph / Spend).
265
+
266
+ ```bash
267
+ facthouse inspect
268
+ facthouse inspect --graph
269
+ facthouse inspect --layer k
270
+ facthouse inspect --json
271
+ facthouse inspect --entity Helios --limit 20 --output ~/inspect.html
272
+ ```
273
+
274
+ `--layer health|d|i|k|entities|graph|all` prints terminal tables (newest-first, capped). `--graph` (the default when no `--layer` / `--json`) writes `inspect.html`. `--limit` is 10 for tables and 50 for the canvas. `--all` draws every node — a hairball, explicit. Search and type filter in the page can still reach a node that was outside the cap.
275
+
276
+ ## Advanced
277
+
278
+ ### Another store
279
+
280
+ 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.
281
+
282
+ 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:
283
+
284
+ <!-- x-release-please-start-version -->
285
+ ```json
286
+ {
287
+ "mcpServers": {
288
+ "facthouse-personal": {
289
+ "command": "npx",
290
+ "args": ["-y", "@facthouse/mcp@0.27.1"],
291
+ "env": { "FACTHOUSE_DATA": "C:\\Users\\alex\\.facthouse-personal" }
292
+ },
293
+ "facthouse-work": {
294
+ "command": "npx",
295
+ "args": ["-y", "@facthouse/mcp@0.27.1"],
296
+ "env": { "FACTHOUSE_DATA": "C:\\Users\\alex\\.facthouse-work" }
297
+ }
298
+ }
299
+ }
300
+ ```
301
+ <!-- x-release-please-end -->
302
+
303
+ Point each store's `sources.cwd` (or hook `--data`) at that store only. Two directories do not isolate anything if both copy the same home.
304
+
305
+ ### Postgres (optional)
306
+
307
+ SQLite is the default and needs no extra software. To use Postgres instead, set `storage.provider` to `"postgres"` in that store's `config.json`, or `FACTHOUSE_STORAGE=postgres` on the MCP entry, and set `FACTHOUSE_POSTGRES_URL` to a `postgres://` (or `postgresql://`) URL. The password belongs in the environment, not in `config.json`. If the URL is missing or the server cannot be reached, Facthouse stops; it does not create a SQLite file.
308
+
309
+ The data directory is still the memory: `config.json` and the scheduler socket live there. Tables live at the URL. Two memories need two directories and two databases.
310
+
311
+ Init does not ask which engine to use. `facthouse init --yes` still writes sqlite.
312
+
313
+ Example — placeholders only; do not put a real password in a committed file:
314
+
315
+ <!-- x-release-please-start-version -->
316
+ ```json
317
+ {
318
+ "mcpServers": {
319
+ "facthouse": {
320
+ "command": "npx",
321
+ "args": ["-y", "@facthouse/mcp@0.27.1"],
322
+ "env": {
323
+ "FACTHOUSE_DATA": "C:\\Users\\alex\\.facthouse-work",
324
+ "FACTHOUSE_STORAGE": "postgres",
325
+ "FACTHOUSE_POSTGRES_URL": "postgres://USER:PASSWORD@localhost:5432/facthouse"
326
+ }
327
+ }
328
+ }
329
+ }
330
+ ```
331
+ <!-- x-release-please-end -->
332
+
333
+ ### Copy versus record
334
+
335
+ Choose one mechanism per store.
336
+
337
+ **Recommended — copy.** Name a `claude-code` or `cursor` source (set `cwd`) and run `facthouse consolidate` from the CLI first. The MCP server also copies at session start and when it handles a call. Grok and Codex are later adapters. Unknown `kind` values are rejected.
338
+
339
+ ```json
340
+ {
341
+ "sources": [
342
+ {
343
+ "kind": "claude-code",
344
+ "home": "~/.claude",
345
+ "cwd": "C:\\dev\\app"
346
+ }
347
+ ]
348
+ }
349
+ ```
350
+
351
+ `home` is the client config dir (`~/.claude` or `~/.cursor` — path examples, not extra discovery). Cursor is `"kind": "cursor"` and `home/projects/*/agent-transcripts/**/*.jsonl` only — not Composer SQLite. Cursor encodes `C:\\dev\\app` as `c-dev-app` (Claude Code uses `C--dev-app`). A first backfill of more than 50 events takes several runs, or one `facthouse consolidate --all`.
352
+
353
+ **Alternative — record, no sources.** Leave `sources` empty. Pipe a client hook payload into `facthouse record` if you have one. MCP `log_event` / `capture_fact` keep working.
354
+
355
+ Do not install record hooks on this store — both write the same rows. Facthouse does not detect or rewrite existing hook configs.
356
+
357
+ ### Hooks (after the first consolidate)
358
+
359
+ `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.
360
+
361
+ <details>
362
+ <summary>PreCompact hook JSON</summary>
363
+
364
+ <!-- x-release-please-start-version -->
365
+ ```json
366
+ {
367
+ "hooks": {
368
+ "PreCompact": [
369
+ {
370
+ "hooks": [
371
+ {
372
+ "type": "command",
373
+ "command": "npx -y -p @facthouse/mcp@0.27.1 -- facthouse notify compaction --data /absolute/path/to/the-same-store"
374
+ }
375
+ ]
376
+ }
377
+ ]
378
+ }
379
+ }
380
+ ```
381
+ <!-- x-release-please-end -->
382
+
383
+ </details>
384
+
385
+ PreCompact `notify compaction` asks the running server to consolidate: copy the newest JSONL lines, extract, integrate. The hook returns at once; the server does the work. We do not install a turn-end Stop hook. On Windows the `--data` path is the same absolute directory you put in `FACTHOUSE_DATA` (for example `C:\\Users\\alex\\AppData\\Local\\Temp\\facthouse-try`).
386
+
387
+ Frequent incremental copying interleaves conversations on the global sequence: a long chat kept open is sliced between other chats. Extract progress is per conversation, so a timeout in one chat does not discard another. Shrinking `extraction.batch_size` means more extract calls (more chances of a timeout), not a store-wide hold-all. `facthouse stats` reports unextracted events against that extract watermark.
388
+
389
+ If the MCP server does not start, or lists no tools, check the package version the client actually spawned. A global `facthouse` on PATH can be years behind the pin in this README. Diagnose with `facthouse stats --data <dir>` (the CLI prints whether the scheduler is listening) and by inspecting `serverInfo.version` from `initialize` plus `tools/list` over stdio. `0.2.x` answers `initialize` then throws on `tools/list`.
390
+
391
+ ### Embeddings, model, timeout, bitemporal
392
+
393
+ Set `embedding.provider` in `config.json` to `"ollama"` (local, no API key) or `"voyage"` (hosted), run `facthouse consolidate`, and `search "food"` starts returning the allergy. Facts are embedded when they are consolidated. Voyage applies a **3 requests/minute** rate limit until a payment method is on the account.
394
+
395
+ Meaning-search is an exact scan of stored vectors when the set is small. When that set is large (default 32 MiB of the current model), an HNSW index of those vectors is used instead: in-process on SQLite, or a Postgres `vector` sidecar when the extension is enabled. Small stores stay exact. A missing engine keeps exact search and prints a warning; Facthouse does not install a native addon. `embedding.ann` is `null` (auto), `false` (never), or `true` (force when the engine allows). This does not turn embeddings on.
396
+
397
+ `intelligence.cli.model` and `intelligence.cli.timeout_ms` are extra knobs. First-run More settings (Y) can write them; later, `facthouse settings`. Init does not ask `intelligence.provider`; `FACTHOUSE_PROVIDER=heuristic` is the kill-switch. The heuristic fallback **does not extract facts from transcripts**.
398
+
399
+ Unnamed user-channel speech is attributed to the store's owner; a display name still does not create a person. Extra backing (assent, a tool observation, a different speaker restating) is recorded, not scored, unless the store sets `interlocutor` ranking weights in `config.json`. The engine ships none. Weight keys match the speaker string as stored, so two people with the same name share a key.
400
+
401
+ Set `temporal.mode` to `bitemporal` to record when the system retracted a belief, so search can answer what the store believed at an instant.
402
+
403
+ ### Intelligence spend
404
+
405
+ `facthouse stats` and `get_stats` report billed consolidation calls: tokens, elapsed time, and the provider plus model on each stage (extract, classify, entities, reconcile, supersede, summarise). A run that did not report tokens omits those fields rather than showing zero. Embeddings are a different API and are not this number.
406
+
407
+ Optional `intelligence.token_budget` caps billed extract per provider on rolling windows. Unset is unlimited. Over the cap, consolidate skips extract, holds the watermark, and does not fall back to the heuristic. Stats and inspect Spend show used and remaining on each cap, and when oldest usage in that window ages out (`resets`).
408
+
409
+ ```json
410
+ "intelligence": {
411
+ "token_budget": {
412
+ "cli": { "week": "10M" }
413
+ }
414
+ }
415
+ ```
416
+
417
+ `hour`, `day`, `week`, and `month` are rolling. Omit a scale to leave it unlimited. Remaining room is on `facthouse stats`, `get_stats`, and inspect Spend. Set the cap in this store's `config.json` — there is no budget command.
418
+
419
+ Optional local intelligence is a different switch from embeddings. Add `intelligence.http` on an OpenAI-compatible host. The protocol is `POST /v1/chat/completions`; only the port changes:
420
+
421
+ | Host | Typical URL |
422
+ |------|-------------|
423
+ | Ollama | `http://localhost:11434/v1` (the default if you omit the URL) |
424
+ | LM Studio | `http://localhost:1234/v1` |
425
+ | vLLM | `http://localhost:8000/v1` |
426
+ | llama.cpp | `http://localhost:8080/v1` |
427
+
428
+ The model string is whatever that host lists. `GET {base_url}/models` prints the names. `nomic-embed-text` is embed-only and will not extract. If the host is up and serves exactly one chat model, Facthouse uses it for this run and tells you to pin `intelligence.http.model`. If several chat models are listed, set that field; extract will not guess.
429
+
430
+ Extract and summarise then use that host; reconcile and supersede stay on the CLI unless you list `intelligence.stages`. Each stage can set on-fail to cli, http, or none (see the JSON below). HTTP extract defaults to retrying on the CLI (counts against the CLI token budget). Contradiction defaults to none — no provider switch. none holds the extract watermark — it does not fall through to the heuristic. First-run More settings (Y, after the recommended path) can set the host, model, and extract on-fail. Later, `facthouse settings` merges those knobs into an existing file without resetting it. `facthouse inspect` Spend shows the same knobs and copies JSON; it does not save `config.json`.
431
+
432
+ The live script `npm run test:http-intelligence` has passed on `qwen2.5vl:7b`.
433
+
434
+ ```json
435
+ "intelligence": {
436
+ "http": {
437
+ "base_url": "http://localhost:11434/v1",
438
+ "model": "qwen2.5vl:7b"
439
+ },
440
+ "stages": {
441
+ "extract": { "provider": "http", "on_fail": "cli" },
442
+ "summarise": { "provider": "http", "on_fail": "cli" },
443
+ "reconcile": { "provider": "cli", "on_fail": "none" },
444
+ "supersede": { "provider": "cli", "on_fail": "none" }
445
+ }
446
+ }
447
+ ```
448
+
449
+ ### CLI demo (no transcript source)
450
+
451
+ Throwaway store, not the capture path for a real Claude Code or Cursor home. These three lines are typed in.
452
+
453
+ <!-- x-release-please-start-version -->
454
+ ```bash
455
+ export FACTHOUSE_DATA=/tmp/facthouse-demo
456
+ om() { npx -y -p "@facthouse/mcp@0.27.1" -- facthouse "$@"; }
457
+
458
+ om init --yes
459
+
460
+ om record --role user --content "I prefer dark mode in every editor, and I never want telemetry enabled."
461
+ om record --role user --content "I am allergic to shellfish, so avoid seafood restaurants when booking anything."
462
+ om record --role user --content "My colleague Robin at Acme is leading the Atlas migration project this quarter."
463
+
464
+ om consolidate
465
+ om search "Atlas"
466
+ om stats
467
+ ```
468
+
469
+ ```powershell
470
+ $env:FACTHOUSE_DATA = Join-Path $env:TEMP "facthouse-demo"
471
+ function om { npx -y -p "@facthouse/mcp@0.27.1" -- facthouse @args }
472
+ om init --yes
473
+ om record --role user --content "I prefer dark mode in every editor, and I never want telemetry enabled."
474
+ om record --role user --content "I am allergic to shellfish, so avoid seafood restaurants when booking anything."
475
+ om record --role user --content "My colleague Robin at Acme is leading the Atlas migration project this quarter."
476
+ om consolidate
477
+ om search "Atlas"
478
+ om stats
479
+ ```
480
+ <!-- x-release-please-end -->
481
+
482
+ `allergies` is not a domain Facthouse ships. The engine has no built-in vocabulary — it read the conversation and decided that fact needed a home. A domain **biases ranking rather than filtering**. Clean up: `rm -rf /tmp/facthouse-demo` (Git Bash / macOS / Linux) or `Remove-Item -Recurse -Force $env:TEMP\facthouse-demo` (PowerShell).
483
+
484
+ ## Integration
485
+
486
+ Facthouse's tool descriptions tell assistants when to search and when a correction is worth staging. They are not how Claude Code conversations enter the store — that is copy from a named source.
487
+
488
+ ### Without configuration
489
+
490
+ Claude Code or Cursor: name a `sources` entry (set `cwd`) and run `facthouse consolidate` from the CLI first. MCP session start also copies. `capture_fact` is there if the assistant needs to correct or add something copy-plus-extraction will not produce.
491
+
492
+ Clients with no copy adapter still rely on `log_event` / `capture_fact` until their adapter exists.
493
+
494
+ ### Hook points
495
+
496
+ | Hook point | When | What to call | Why |
497
+ |---|---|---|---|
498
+ | Session start | Conversation begins | `memory://profile` (automatic), `search_knowledge` | The assistant knows who you are from message one |
499
+ | Correction | A durable fact is missing from the store | `capture_fact` | Optional; Claude Code conversations are already in `session_events` via copy |
500
+ | Pre-response search | Before generating a reply | `search_knowledge`, `get_context` | Responses informed by stored knowledge |
501
+ | Pre-compaction | Before context window compression | `facthouse notify compaction` | The server copies new lines, extracts, integrates |
502
+ | Natural breakpoints | Topic change, task completion | `consolidate` (optional) | Keeps the knowledge graph current |
503
+
504
+ **On pre-compaction:** `facthouse notify compaction` asks the server to consolidate. It is not a `record` hook.
505
+
506
+ ### Claude Code
507
+
508
+ Create `.claude/rules/facthouse.md` in your project (or `~/.claude/rules/facthouse.md` globally):
509
+
510
+ ```markdown
511
+ # Facthouse
512
+
513
+ - Conversations are copied from the named Claude Code source (first backfill: `facthouse consolidate` on the CLI)
514
+ - Do not install record hooks on this store
515
+ - Identity context loads automatically from the `memory://profile` resource — no tool call needed
516
+ - Before answering questions this store might already know, call `search_knowledge`
517
+ - Call `capture_fact` only to correct or add something that is not in the transcript
518
+ - When the conversation is getting long, call `consolidate` (or rely on PreCompact `facthouse notify compaction`)
519
+ - At natural breakpoints (topic change, task completion), call `consolidate` to keep the knowledge graph current
520
+ ```
521
+
522
+ To allow Facthouse tools without per-call approval prompts, add to the `permissions.allow` array in `.claude/settings.json`:
523
+
524
+ ```json
525
+ {
526
+ "permissions": {
527
+ "allow": [
528
+ "mcp__facthouse__*"
529
+ ]
530
+ }
531
+ }
532
+ ```
533
+
534
+ ### Cursor / Windsurf
535
+
536
+ Add to `.cursorrules` (Cursor) or `.windsurfrules` (Windsurf) in your project root:
537
+
538
+ ```
539
+ When the facthouse MCP server is available:
540
+ - Before answering questions this store might already know, call search_knowledge
541
+ - To find out everything known about a particular person, project, or thing, call get_entity
542
+ - Call capture_fact only to correct or add something copy or extraction missed
543
+ - When context is getting long, call consolidate to process pending facts before they are lost
544
+ ```
545
+
546
+ Cursor and Windsurf consume tools but not resources, so `memory://profile` will not load on its own there. Cursor conversations themselves are copied with `kind: "cursor"` (JSONL under `~/.cursor/projects/`, not the SQLite composer store).
547
+
548
+ ### Claude Desktop / other MCP clients
549
+
550
+ No copy adapter yet. Tool descriptions handle search and optional `capture_fact`; conversations are not tailed until a later adapter exists.
551
+
552
+ ## Reclaiming space
553
+
554
+ Facthouse logs raw conversation and tool output to `session_events`. On a store wired into an agentic client this becomes almost all of the database. A store measured in daily use held 47,000 events and 493 MB against 21 integrated facts.
555
+
556
+ `facthouse stats` reports the raw layer alongside the knowledge, including how much is reclaimable. To reclaim it:
557
+
558
+ ```bash
559
+ facthouse prune # report only — nothing is deleted
560
+ facthouse prune --apply --vacuum # delete, then rebuild the file
561
+ ```
562
+
563
+ Set `retention.disk_budget` in `config.json` to a size such as `"2GB"` to cap `memory.db`. Unset is unlimited; init does not write a cap. When a cap is set and the file is full, unreachable raw events are pruned automatically so new logs can reuse that space; if nothing unused remains, more raw events are refused. Facts are never deleted to meet the number. Compacting (`--vacuum`) is still a human step — it copies the whole file so the operating system sees the smaller size.
564
+
565
+ If most of that volume is tool output you judge to be noise, `extraction.event_types` and `extraction.roles` restrict what is examined, and `extraction.min_content_length` skips trivial events. Measure before you do. Volume and value are not the same axis.
566
+
567
+ **The rule is reachability, not age.** An event is removed only when all three hold:
568
+
569
+ 1. Extraction has already read it. Anything ahead of the consolidation watermark is still input.
570
+ 2. No fact's provenance cites it.
571
+ 3. It has fallen outside its own session's most recent `extraction.working_memory_size` events — a spare so consolidation can still glance at recent raw notes. That window is evidence of the current topic, not a pronoun dictionary.
572
+
573
+ No fact, entity, embedding or search result is affected. Deleting rows does not shrink the file on its own — that is `--vacuum`. Without a cap, nothing prunes automatically.
574
+
575
+ ## Development
576
+
577
+ ```bash
578
+ git clone https://github.com/gordonkjlee/facthouse
579
+ cd facthouse
580
+ npm install
581
+ npm run build
582
+ npm test
583
+ ```
584
+
585
+ `npm test` always runs hermetic pipelines (fixture JSONL → copy → extract →
586
+ search) with a recording extractor, and skips live evals that need a real
587
+ model:
588
+
589
+ - Semantic recall needs Ollama with `nomic-embed-text`. Start it, then
590
+ `npm run test:semantic`.
591
+ - The live first-fact eval needs the `claude` CLI. Run `npm run test:first-fact`.
592
+ - The live coding-store eval (warehouse-shaped Cursor transcripts) also
593
+ needs the `claude` CLI. Run `npm run test:coding-store`.
594
+ - Local HTTP extract needs a chat model on an OpenAI-compatible host and
595
+ `FACTHOUSE_HTTP_MODEL` (verified on `qwen2.5vl:7b`). Run
596
+ `npm run test:http-intelligence`.
597
+
598
+ Each of those scripts fails rather than skips when its dependency is missing,
599
+ so a green run means the claim was actually verified rather than quietly
600
+ stepped over.
601
+
602
+ ## Contribute
603
+
604
+ Issues and pull requests are welcome. Open an issue first if the change is more than a typo.
605
+
606
+ - Questions: [GitHub Discussions](https://github.com/gordonkjlee/facthouse/discussions)
607
+ - How to build and test: [CONTRIBUTING.md](CONTRIBUTING.md)
608
+
609
+ ## License
610
+
611
+ MIT