@anmol-srv/sigil 0.10.3 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +18 -12
- package/README.md +90 -82
- package/dist/cli.js +758 -507
- package/dist/daemon.js +724 -0
- package/dist/hooks/post-tool-use.js +20 -22
- package/dist/hooks/session-end.js +63 -61
- package/dist/hooks/stop.js +76 -74
- package/dist/hooks/user-prompt-submit.js +55 -47
- package/dist/server.js +45 -554
- package/integrations/hermes/README.md +4 -4
- package/integrations/hermes/plugin/README.md +8 -8
- package/knexfile.js +29 -8
- package/package.json +11 -5
- package/src/db/migrations/20260601000000_create-device-table.cjs +34 -0
- package/src/db/migrations/20260601000001_create-pairing-code-table.cjs +27 -0
- package/src/db/migrations/20260601000002_add-fact-provenance.cjs +31 -0
- package/src/db/migrations/20260601000003_add-device-revoked-reason.cjs +19 -0
- package/src/db/migrations/20260601000004_create-trace-event-table.cjs +35 -0
- package/src/db/migrations/20260601000005_add-fact-agent-provenance.cjs +25 -0
- package/src/gui/web/api.js +37 -0
- package/src/gui/web/app.css +947 -0
- package/src/gui/web/app.js +1230 -0
- package/src/gui/web/components.js +90 -0
- package/src/gui/web/design/colors_and_type.css +178 -0
- package/src/gui/web/design/sigil-mark-mono.svg +8 -0
- package/src/gui/web/design/sigil-mark.svg +26 -0
- package/src/gui/web/index.html +536 -0
- package/src/gui/web/sigil.svg +31 -0
- package/src/gui/web/toast.js +62 -0
package/LICENSE
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2025 Anmol Srivastava
|
|
3
|
+
Copyright (c) 2025-2026 Anmol Srivastava
|
|
4
4
|
|
|
5
|
-
Permission
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
OR
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -4,27 +4,27 @@
|
|
|
4
4
|
|
|
5
5
|
# Sigil
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Your machine. Every agent. One brain.
|
|
8
8
|
|
|
9
9
|
Local-first memory shared across Claude Code, Codex CLI, Cursor, Kiro, and any agent that can run a shell command or speak [MCP](https://modelcontextprotocol.io/). Stored in your own Postgres. No cloud, no telemetry.
|
|
10
10
|
|
|
11
11
|
</div>
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
|
|
15
|
-
-e POSTGRES_PASSWORD=sigil_dev pgvector/pgvector:pg15
|
|
16
|
-
npm install -g @anmol-srv/sigil
|
|
17
|
-
sigil init
|
|
14
|
+
npx @anmol-srv/sigil
|
|
18
15
|
```
|
|
19
16
|
|
|
17
|
+
That's it. The command launches Sigil and opens a dashboard in your browser where you configure everything — database, LLM, and embedding provider — with live connection tests and one-click fixes. No config files to edit, no setup prompts in the terminal.
|
|
18
|
+
|
|
20
19
|
<div align="center">
|
|
21
20
|
|
|
22
|
-
Open Claude Code
|
|
21
|
+
Configure in the dashboard. Open Claude Code. Memory is already wired in.
|
|
23
22
|
|
|
24
23
|
[](https://www.npmjs.com/package/@anmol-srv/sigil)
|
|
24
|
+
[](https://anmol-srv.github.io/sigil/)
|
|
25
25
|
[](https://modelcontextprotocol.io/)
|
|
26
26
|
[](./eval/longmemeval/RESULTS.md)
|
|
27
|
-
[](https://opensource.org/licenses/MIT)
|
|
28
28
|
|
|
29
29
|
[**Quickstart**](#quickstart) · [Every agent](#works-with-every-agent-on-your-machine) · [How it works](#how-its-structured) · [Capabilities](#key-capabilities) · [Benchmarks](#benchmarks) · [FAQ](#faq)
|
|
30
30
|
|
|
@@ -34,26 +34,26 @@ Open Claude Code — memory is already wired in.
|
|
|
34
34
|
|
|
35
35
|
## Why this exists
|
|
36
36
|
|
|
37
|
-
Every memory tool for AI agents ships as someone else's cloud. Your code context, your team's decisions, your preferences
|
|
37
|
+
Every memory tool for AI agents ships as someone else's cloud. Your code context, your team's decisions, your preferences: all sitting in a vendor's database. That's the wrong default for the most intimate context your agents touch.
|
|
38
38
|
|
|
39
39
|
And every agent has its own walled memory. Claude doesn't see what you told Codex. Cursor doesn't know what Kiro learned this morning. You re-explain the same architecture, watch the same mistakes happen, lose hours to context-loading every session.
|
|
40
40
|
|
|
41
41
|
Sigil fixes both problems with the same primitive: a local memory layer every agent connects to.
|
|
42
42
|
|
|
43
43
|
- **In Claude Code:** four hooks (`UserPromptSubmit`, `PostToolUse`, `Stop`, `SessionEnd`) auto-capture decisions, preferences, and observations as you work. Relevant memory is injected into every new prompt before Claude sees it. You write zero `sigil remember` calls.
|
|
44
|
-
- **Everywhere else, the `sigil` CLI is the universal interface.** Any agent that can run a shell command
|
|
44
|
+
- **Everywhere else, the `sigil` CLI is the universal interface.** Any agent that can run a shell command (Codex CLI, terminal-based assistants, CI runners, Hermes, your own scripts) can call `sigil search "..."` or `sigil remember "..."` directly. No client integration required: if the agent can shell out, it can read and write memory.
|
|
45
45
|
- **For MCP-aware clients** (Cursor, Continue, Cline, Windsurf, Claude Desktop, Kiro): the same memory is also exposed as a 9-tool MCP server. Same brain, structured surface for clients that prefer it.
|
|
46
|
-
- **Across machines:** point multiple installs at the same Postgres. A fact captured on your laptop surfaces in the agent running on your home server. No daemon, no sync protocol
|
|
46
|
+
- **Across machines:** point multiple installs at the same Postgres. A fact captured on your laptop surfaces in the agent running on your home server. No daemon, no sync protocol. Postgres handles consistency.
|
|
47
47
|
|
|
48
|
-
The pod model (sessions, projects, people, playbooks, vitals
|
|
48
|
+
The pod model (sessions, projects, people, playbooks, vitals, and any pluggable kind you add) is the foundation. It's how the next layers (write-attributed multi-agent workflows, ACLs, custom integrations) will land on top of the same brain.
|
|
49
49
|
|
|
50
|
-
**What changes in practice:** Tuesday in Claude Code, you decide to route webhooks through Postgres `LISTEN/NOTIFY` instead of Redis pubsub. Thursday you open Cursor in the same repo and ask for an event handler
|
|
50
|
+
**What changes in practice:** Tuesday in Claude Code, you decide to route webhooks through Postgres `LISTEN/NOTIFY` instead of Redis pubsub. Thursday you open Cursor in the same repo and ask for an event handler. It already knows. Friday you spin up a Hermes agent on your home server and ask *"what's our event delivery setup?"*. Same answer, no copy-paste. The brain travels with you.
|
|
51
51
|
|
|
52
52
|
---
|
|
53
53
|
|
|
54
54
|
## Works with every agent on your machine
|
|
55
55
|
|
|
56
|
-
Sigil's wedge is one memory layer underneath everything. `sigil init` detects every coding agent on your machine and wires Sigil into each one automatically
|
|
56
|
+
Sigil's wedge is one memory layer underneath everything. `sigil init` detects every coding agent on your machine and wires Sigil into each one automatically: hooks for Claude Code, MCP server registration plus client-native steering rules for the rest.
|
|
57
57
|
|
|
58
58
|
| Agent | Integration depth | Auto-wired |
|
|
59
59
|
|---|---|---|
|
|
@@ -61,15 +61,15 @@ Sigil's wedge is one memory layer underneath everything. `sigil init` detects ev
|
|
|
61
61
|
| **Codex CLI** | `~/.codex/config.toml` MCP entry · `~/.codex/AGENTS.md` steering · MCP server | ✓ |
|
|
62
62
|
| **Cursor** | `~/.cursor/mcp.json` MCP entry · MCP server | ✓ |
|
|
63
63
|
| **Kiro** | `~/.kiro/settings/mcp.json` MCP entry · `~/.kiro/steering/sigil.md` steering rule · MCP server | ✓ |
|
|
64
|
-
| **Continue / Cline / Windsurf** | MCP server (one-line config from `sigil register --print`) |
|
|
65
|
-
| **Hermes / OpenClaw / any custom agent** | MCP server, REST, or `sigil` CLI directly |
|
|
66
|
-
| **Any MCP-spec client** | MCP server |
|
|
64
|
+
| **Continue / Cline / Windsurf** | MCP server (one-line config from `sigil register --print`) | - |
|
|
65
|
+
| **Hermes / OpenClaw / any custom agent** | MCP server, REST, or `sigil` CLI directly | - |
|
|
66
|
+
| **Any MCP-spec client** | MCP server | - |
|
|
67
67
|
|
|
68
|
-
Works with **any** agent that speaks MCP or can run a shell command. One brain on your machine
|
|
68
|
+
Works with **any** agent that speaks MCP or can run a shell command. One brain on your machine. Every agent reads and writes to it.
|
|
69
69
|
|
|
70
70
|
### Two interfaces: CLI first, MCP when it fits
|
|
71
71
|
|
|
72
|
-
The `sigil` CLI is the universal interface. If your agent has a `Bash` tool, a terminal, or any way to shell out, it can use Sigil
|
|
72
|
+
The `sigil` CLI is the universal interface. If your agent has a `Bash` tool, a terminal, or any way to shell out, it can use Sigil with no client-specific integration required:
|
|
73
73
|
|
|
74
74
|
```bash
|
|
75
75
|
sigil search "JWT auth setup" # what does the brain know?
|
|
@@ -78,9 +78,9 @@ sigil facts --limit=20 # list recent facts
|
|
|
78
78
|
sigil why "auth setup" # explain the search
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
-
That's exactly how Claude Code (via Bash tool), Codex CLI, terminal-based agents, Hermes, and your own CI scripts use Sigil today. The CLI is auto-detected on `PATH` after `npm install -g @anmol-srv/sigil
|
|
81
|
+
That's exactly how Claude Code (via Bash tool), Codex CLI, terminal-based agents, Hermes, and your own CI scripts use Sigil today. The CLI is auto-detected on `PATH` after `npm install -g @anmol-srv/sigil`; agents discover it the same way they discover `git` or `node`.
|
|
82
82
|
|
|
83
|
-
For clients that prefer structured tool calls (Cursor, Continue, Cline, Claude Desktop, Kiro, any MCP-spec agent), Sigil also exposes the same memory as a 9-tool MCP server
|
|
83
|
+
For clients that prefer structured tool calls (Cursor, Continue, Cline, Claude Desktop, Kiro, any MCP-spec agent), Sigil also exposes the same memory as a 9-tool MCP server. `sigil register --print` generates the config. MCP is the second interface, not the only one.
|
|
84
84
|
|
|
85
85
|
### vs your agent's built-in memory
|
|
86
86
|
|
|
@@ -88,10 +88,10 @@ Every coding agent ships with a hand-edited memory file: `CLAUDE.md`, `AGENTS.md
|
|
|
88
88
|
|
|
89
89
|
| | Built-in (`CLAUDE.md`, `AGENTS.md`, etc.) | **Sigil** |
|
|
90
90
|
|---|---|---|
|
|
91
|
-
| Capture | Manual
|
|
91
|
+
| Capture | Manual; you write and edit the file | Automatic via Claude Code hooks |
|
|
92
92
|
| Scale | Loaded fully into context every prompt | Top-K retrieved from unlimited corpus |
|
|
93
93
|
| Token cost | Linear in file size (caps how much you can store) | ~1.5K injected per prompt regardless of corpus size |
|
|
94
|
-
| Search | None
|
|
94
|
+
| Search | None; the model reads the whole file | Hybrid (pgvector + tsvector BM25 + RRF) |
|
|
95
95
|
| Cross-agent | Per-agent files, no sharing | One shared brain across every wired agent |
|
|
96
96
|
| Cross-machine | Manual sync (git, scp) | Point installs at the same Postgres |
|
|
97
97
|
| Freshness | Stale until you rewrite | Auto-decay, supersession, importance reweighting |
|
|
@@ -103,7 +103,7 @@ You can keep using `CLAUDE.md` for hard-coded project rules. Sigil handles every
|
|
|
103
103
|
|
|
104
104
|
## How it's structured
|
|
105
105
|
|
|
106
|
-
Memory lives in **pods
|
|
106
|
+
Memory lives in **pods**: typed containers with declared retrieval behaviour. Five built-in kinds today:
|
|
107
107
|
|
|
108
108
|
| Kind | Identity | Decay | Hot-context budget |
|
|
109
109
|
|---|---|---|---|
|
|
@@ -113,13 +113,13 @@ Memory lives in **pods** — typed containers with declared retrieval behaviour.
|
|
|
113
113
|
| `playbook` | your user-authored runbooks | never | 3 slots (active for matching project) |
|
|
114
114
|
| `vital` | virtual; facts marked `importance=5` | never | 6 slots (global) |
|
|
115
115
|
|
|
116
|
-
Pods are pluggable. Adding a new kind (`codex_session`, `slack_channel`, `github_pr`, ...) means writing a contract file
|
|
116
|
+
Pods are pluggable. Adding a new kind (`codex_session`, `slack_channel`, `github_pr`, ...) means writing a contract file. No schema migrations. Retrieval is pod-aware: hot-context blends facts from your active session + project + relevant people + vital, weighted by importance × decay.
|
|
117
117
|
|
|
118
118
|
Three storage layers underneath:
|
|
119
119
|
|
|
120
|
-
1. **Chunks
|
|
121
|
-
2. **Facts
|
|
122
|
-
3. **Entity graph
|
|
120
|
+
1. **Chunks**: raw 512-token blocks of ingested docs, embedded via your chosen provider (Ollama / OpenAI / Voyage)
|
|
121
|
+
2. **Facts**: atomic statements with confidence, importance, temporal validity, supersession links
|
|
122
|
+
3. **Entity graph**: typed nodes (person, project, service, ...) + relations, traversed via recursive CTEs
|
|
123
123
|
|
|
124
124
|
Retrieval is hybrid: pgvector cosine + tsvector keyword fused via Reciprocal Rank Fusion, then re-ranked by ACT-R activation (recency × frequency) and Hebbian co-retrieval boosts. The full pipeline is in `src/memory/`.
|
|
125
125
|
|
|
@@ -136,71 +136,77 @@ Retrieval is hybrid: pgvector cosine + tsvector keyword fused via Reciprocal Ran
|
|
|
136
136
|
|
|
137
137
|
| Capability | What it gives you |
|
|
138
138
|
|---|---|
|
|
139
|
-
| **Universal CLI interface** | Any agent with shell access can call `sigil search` / `sigil remember` directly
|
|
140
|
-
| **Auto-capture via hooks** | Zero manual `sigil remember` calls in Claude Code
|
|
139
|
+
| **Universal CLI interface** | Any agent with shell access can call `sigil search` / `sigil remember` directly. Works in Claude Code (Bash tool), Codex CLI, terminal agents, Hermes, CI scripts. No client integration required |
|
|
140
|
+
| **Auto-capture via hooks** | Zero manual `sigil remember` calls in Claude Code; the Stop hook handles routine saves |
|
|
141
141
|
| **Cross-agent shared memory** | Claude Code, Codex CLI, Cursor, Kiro all read and write the same brain |
|
|
142
142
|
| **Cross-machine via shared DB** | Laptop + home server + cloud agent on one Postgres = one memory |
|
|
143
143
|
| **Hybrid search** | pgvector cosine + tsvector BM25 fused via Reciprocal Rank Fusion (one SQL query) |
|
|
144
144
|
| **ACT-R + Hebbian re-ranking** | Recency × frequency activation + co-retrieval boosts (cognitive-science model, not vibes) |
|
|
145
|
-
| **Pluggable pods** | Five built-in kinds; add `slack_channel`, `github_pr`, `codex_session`, etc. as contract files
|
|
145
|
+
| **Pluggable pods** | Five built-in kinds; add `slack_channel`, `github_pr`, `codex_session`, etc. as contract files. No schema migrations |
|
|
146
146
|
| **AUDM dedup** | Add / Update / Delete / Merge intelligence stops fact pile-up across thousands of saves |
|
|
147
|
-
| **Fully air-gappable** | Pick Ollama for both LLM and embeddings
|
|
147
|
+
| **Fully air-gappable** | Pick Ollama for both LLM and embeddings. Zero data leaves your network |
|
|
148
148
|
| **No vendor account** | `npm install` + your Postgres = working brain. No signup, no API key required to start |
|
|
149
|
-
| **Hot-context snapshot** | Top-20 facts always loaded via `@~/.sigil/CLAUDE.md` import
|
|
149
|
+
| **Hot-context snapshot** | Top-20 facts always loaded via `@~/.sigil/CLAUDE.md` import. Instant context with zero latency |
|
|
150
150
|
| **9-tool MCP server** | `search`, `search_entity`, `traverse_graph`, `get_fact_context`, `get_entity_context`, `get_pod`, `list_pods`, `status`, `ingest` |
|
|
151
|
-
| **Honest benchmarks** | Public LongMemEval oracle: R@10 = 100%, 33ms p50 search. Reproducible
|
|
151
|
+
| **Honest benchmarks** | Public LongMemEval oracle: R@10 = 100%, 33ms p50 search. Reproducible. No in-house corpus theater |
|
|
152
152
|
|
|
153
153
|
---
|
|
154
154
|
|
|
155
155
|
## Quickstart
|
|
156
156
|
|
|
157
|
-
Sigil needs **Postgres 13+ with the `pgvector` extension** running somewhere reachable. You bring the server;
|
|
157
|
+
Sigil needs **Postgres 13+ with the `pgvector` extension** running somewhere reachable. You bring the server; the dashboard does everything else.
|
|
158
158
|
|
|
159
|
-
### 1.
|
|
159
|
+
### 1. Launch
|
|
160
160
|
|
|
161
161
|
```bash
|
|
162
|
-
|
|
163
|
-
docker run -d --name sigil-pg -p 5432:5432 \
|
|
164
|
-
-e POSTGRES_PASSWORD=sigil_dev pgvector/pgvector:pg15
|
|
162
|
+
npx @anmol-srv/sigil
|
|
165
163
|
```
|
|
166
164
|
|
|
167
|
-
|
|
165
|
+
This starts the Sigil daemon and opens the dashboard in your browser. The daemon runs even before anything is configured, so the setup wizard is always reachable. Everything below happens in the UI — no terminal prompts, no editing `~/.sigil/.env` by hand.
|
|
166
|
+
|
|
167
|
+
### 2. Configure in the dashboard
|
|
168
|
+
|
|
169
|
+
The first-run wizard walks you through three things, each with a live test before it's saved:
|
|
168
170
|
|
|
169
|
-
|
|
171
|
+
1. **Database** — paste a connection URL (Neon, Supabase, AWS RDS, Render, Railway, CockroachDB, …) or point at a local Postgres. The dashboard tests the connection, offers one-click **Install pgvector** if the extension is missing, and runs migrations. Pooled connection URLs (e.g. Neon's `-pooler` host) are handled automatically — migrations run against the direct endpoint.
|
|
172
|
+
2. **LLM provider** — OpenRouter, OpenAI, Anthropic, Ollama, or your Claude Code subscription. Tested with a live call.
|
|
173
|
+
3. **Embedding provider** — OpenAI, Voyage, or Ollama. If your database already holds vectors at a different dimension than the provider produces, the dashboard tells you exactly how many rows are affected and lets you wipe and start fresh or cancel — never a silent failure.
|
|
170
174
|
|
|
175
|
+
When a step fails, the dashboard shows the real cause and the fix, not a generic error. Switch any provider later from **Settings → Change** — it re-tests, applies, and restarts the daemon for you.
|
|
176
|
+
|
|
177
|
+
Need a local Postgres? The pgvector image includes the extension out of the box:
|
|
171
178
|
```bash
|
|
172
|
-
|
|
173
|
-
|
|
179
|
+
docker run -d --name sigil-pg -p 5432:5432 \
|
|
180
|
+
-e POSTGRES_PASSWORD=sigil_dev pgvector/pgvector:pg15
|
|
174
181
|
```
|
|
175
182
|
|
|
176
|
-
`
|
|
183
|
+
Finishing the wizard auto-detects every AI client on your machine (Claude Code, Codex CLI, Cursor, Kiro) and wires Sigil into each: hooks for Claude Code, MCP server registration + steering rules for the rest, plus `@~/.sigil/CLAUDE.md` in your global Claude config so hot-context is always loaded.
|
|
177
184
|
|
|
178
|
-
|
|
179
|
-
2. Asks for your embedding provider (OpenAI, Voyage, or Ollama).
|
|
180
|
-
3. Asks for your Postgres connection. **If the `sigil` database doesn't exist yet, it asks once for Postgres admin credentials and auto-creates the database, the `sigil_app` user, and the `vector` extension.** Admin creds are used once and never written to disk; only `sigil_app` credentials land in `~/.sigil/.env`.
|
|
181
|
-
4. Runs schema migrations.
|
|
182
|
-
5. Auto-detects every AI client on your machine (Claude Code, Codex CLI, Cursor, Kiro) and wires Sigil into each one — hooks for Claude Code, MCP server registration + steering rules for the rest. Adds `@~/.sigil/CLAUDE.md` to your global Claude config so hot-context is always loaded.
|
|
183
|
-
|
|
184
|
-
Re-running `sigil init` is idempotent. Existing `~/.sigil/.env` keys are preserved — only prompted values are updated.
|
|
185
|
+
### Prefer the terminal?
|
|
185
186
|
|
|
187
|
+
The interactive CLI setup still works and is fully equivalent:
|
|
186
188
|
```bash
|
|
187
|
-
|
|
189
|
+
npm install -g @anmol-srv/sigil
|
|
190
|
+
sigil init # interactive
|
|
191
|
+
sigil init --url "postgres://user:pass@ep-foo.neon.tech/sigil?sslmode=require" # non-interactive (CI / dotfiles)
|
|
192
|
+
sigil doctor # verify everything's wired
|
|
188
193
|
```
|
|
194
|
+
Re-running `sigil init` is idempotent — existing `~/.sigil/.env` keys are preserved.
|
|
189
195
|
```
|
|
190
196
|
Sigil diagnostic
|
|
191
197
|
|
|
192
|
-
✓ Config file
|
|
193
|
-
✓ Config validation
|
|
194
|
-
✓ Database
|
|
195
|
-
✓ Stored data
|
|
196
|
-
✓ LLM provider
|
|
197
|
-
✓ Embedding provider
|
|
198
|
-
✓ UserPromptSubmit hook
|
|
199
|
-
✓ PostToolUse hook
|
|
200
|
-
✓ Stop hook
|
|
201
|
-
✓ SessionEnd hook
|
|
198
|
+
✓ Config file: ~/.sigil/.env
|
|
199
|
+
✓ Config validation: no provider/model mismatches
|
|
200
|
+
✓ Database: Postgres @ localhost:5432/sigil
|
|
201
|
+
✓ Stored data: 0 docs, 0 chunks, 0 facts
|
|
202
|
+
✓ LLM provider: openrouter (model=google/gemini-flash-latest)
|
|
203
|
+
✓ Embedding provider: openai / text-embedding-3-large
|
|
204
|
+
✓ UserPromptSubmit hook: registered
|
|
205
|
+
✓ PostToolUse hook: registered
|
|
206
|
+
✓ Stop hook: registered
|
|
207
|
+
✓ SessionEnd hook: registered
|
|
202
208
|
✓ Sigil CLAUDE.md
|
|
203
|
-
✓ Hook errors
|
|
209
|
+
✓ Hook errors: none
|
|
204
210
|
|
|
205
211
|
All checks passed.
|
|
206
212
|
```
|
|
@@ -213,7 +219,7 @@ Tell Sigil something once:
|
|
|
213
219
|
sigil remember "Project uses Postgres LISTEN/NOTIFY for events, not Redis pubsub"
|
|
214
220
|
```
|
|
215
221
|
|
|
216
|
-
Open Claude Code in any project tomorrow. Ask "what's our event delivery setup?"
|
|
222
|
+
Open Claude Code in any project tomorrow. Ask "what's our event delivery setup?" and Claude answers correctly. The `UserPromptSubmit` hook injected the fact before Claude saw your prompt.
|
|
217
223
|
|
|
218
224
|
In practice you rarely call `sigil remember` directly. The `Stop` hook runs a classifier on every user message and auto-saves anything memorable (preferences, decisions, constraints, factual claims). The `PostToolUse` hook captures observations from Edit/Write/Bash.
|
|
219
225
|
|
|
@@ -221,7 +227,7 @@ In practice you rarely call `sigil remember` directly. The `Stop` hook runs a cl
|
|
|
221
227
|
|
|
222
228
|
## Use with other MCP clients
|
|
223
229
|
|
|
224
|
-
`sigil init` auto-wires Codex CLI, Cursor, and Kiro on first run if it detects them
|
|
230
|
+
`sigil init` auto-wires Codex CLI, Cursor, and Kiro on first run if it detects them. No manual config needed. For everything else (Continue, Cline, Windsurf, your custom MCP-spec agent), `sigil register --print` outputs the standard MCP config JSON:
|
|
225
231
|
|
|
226
232
|
```json
|
|
227
233
|
{
|
|
@@ -242,31 +248,33 @@ Drop the inner `sigil: {...}` object into your client's MCP config:
|
|
|
242
248
|
| Codex CLI | `~/.codex/config.toml` | ✓ |
|
|
243
249
|
| Cursor | `~/.cursor/mcp.json` (or Settings → MCP) | ✓ |
|
|
244
250
|
| Kiro | `~/.kiro/settings/mcp.json` | ✓ |
|
|
245
|
-
| Continue.dev | `~/.continue/config.json` |
|
|
246
|
-
| Cline (VS Code) | `cline_mcp_settings.json` in your VS Code user dir |
|
|
247
|
-
| Windsurf | `~/.codeium/windsurf/mcp_config.json` |
|
|
248
|
-
| Any other MCP-spec client | client's MCP config |
|
|
251
|
+
| Continue.dev | `~/.continue/config.json` | - |
|
|
252
|
+
| Cline (VS Code) | `cline_mcp_settings.json` in your VS Code user dir | - |
|
|
253
|
+
| Windsurf | `~/.codeium/windsurf/mcp_config.json` | - |
|
|
254
|
+
| Any other MCP-spec client | client's MCP config | - |
|
|
249
255
|
|
|
250
256
|
The agent now sees nine tools: `search`, `search_entity`, `traverse_graph`, `get_fact_context`, `get_entity_context`, `get_pod`, `list_pods`, `status`, `ingest`. Most agents use them well if their system prompt mentions Sigil; if not, a short nudge helps:
|
|
251
257
|
|
|
252
258
|
> "You have access to a persistent memory system called Sigil. Before answering about projects, preferences, or past decisions, call `sigil_search`. When the user shares preferences, decisions, or constraints, call `sigil_ingest` to save them."
|
|
253
259
|
|
|
254
|
-
Unlike Claude Code there's no hook layer
|
|
260
|
+
Unlike Claude Code there's no hook layer; the agent decides when to call. Capture relies on the agent or on you running `sigil remember` from the CLI.
|
|
255
261
|
|
|
256
262
|
---
|
|
257
263
|
|
|
258
264
|
## Cross-machine memory
|
|
259
265
|
|
|
260
|
-
Point multiple installs at the same Postgres and they share one brain:
|
|
266
|
+
Point multiple installs at the same Postgres and they share one brain. Either form works — Sigil uses whichever is set:
|
|
261
267
|
|
|
262
268
|
```bash
|
|
263
|
-
#
|
|
269
|
+
# Discrete env (typical for a self-hosted box on your LAN/VPN)
|
|
264
270
|
SIGIL_DB_HOST=postgres.your-network.local sigil init
|
|
265
271
|
|
|
266
|
-
#
|
|
267
|
-
|
|
272
|
+
# Or a single connection URL (typical for managed Postgres)
|
|
273
|
+
sigil init --url "postgres://user:pass@ep-foo.neon.tech/sigil?sslmode=require"
|
|
268
274
|
```
|
|
269
275
|
|
|
276
|
+
`SIGIL_DATABASE_URL` (or `DATABASE_URL`) takes precedence over the discrete `SIGIL_DB_HOST/PORT/NAME/USER/PASSWORD` keys when both are present.
|
|
277
|
+
|
|
270
278
|
Both machines now share memory. A fact captured on machine 1 surfaces on machine 2's next prompt. Reads and writes go directly to Postgres; consistency is whatever Postgres gives you (which is plenty for personal memory).
|
|
271
279
|
|
|
272
280
|
Use cases this unlocks:
|
|
@@ -279,7 +287,7 @@ Use cases this unlocks:
|
|
|
279
287
|
|
|
280
288
|
## Benchmarks
|
|
281
289
|
|
|
282
|
-
### Retrieval
|
|
290
|
+
### Retrieval, LongMemEval oracle split
|
|
283
291
|
|
|
284
292
|
| Metric | Sigil | Notes |
|
|
285
293
|
|---|---|---|
|
|
@@ -297,7 +305,7 @@ Honest caveats in [`eval/longmemeval/RESULTS.md`](./eval/longmemeval/RESULTS.md)
|
|
|
297
305
|
| Embedding latency | 26ms |
|
|
298
306
|
| Tokens injected per prompt | ~1.5K |
|
|
299
307
|
|
|
300
|
-
Hook hot-path latency (cold Node start + Postgres connect + search) is higher
|
|
308
|
+
Hook hot-path latency (cold Node start + Postgres connect + search) is higher: 200-400ms on first invocation, then warm. If that's unacceptable, comment the `UserPromptSubmit` hook out of `~/.claude/settings.json` and rely on the hot-context `CLAUDE.md` snapshot + on-demand MCP `search`.
|
|
301
309
|
|
|
302
310
|
---
|
|
303
311
|
|
|
@@ -305,12 +313,12 @@ Hook hot-path latency (cold Node start + Postgres connect + search) is higher
|
|
|
305
313
|
|
|
306
314
|
| Command | Description |
|
|
307
315
|
|---|---|
|
|
308
|
-
| `sigil init` | Interactive setup
|
|
316
|
+
| `sigil init` | Interactive setup: providers, Postgres, hooks |
|
|
309
317
|
| `sigil doctor` | Diagnose config, DB, providers, hook registration, error budget |
|
|
310
318
|
| `sigil remember "text" [--bg]` | Save fact(s) directly. `--bg` returns immediately |
|
|
311
319
|
| `sigil ingest <file\|url\|glob>` | Ingest one or many documents |
|
|
312
320
|
| `sigil search "query" [--pod-scope=auto\|global\|<name>]` | Search the brain |
|
|
313
|
-
| `sigil why "query"` | Explain a search
|
|
321
|
+
| `sigil why "query"` | Explain a search: per-fact RRF / pod / kind / importance breakdown |
|
|
314
322
|
| `sigil kind list` / `sigil kind show <name>` | Inspect registered pod kinds |
|
|
315
323
|
| `sigil pod list / show / create / archive / delete` | Manage pods |
|
|
316
324
|
| `sigil session list / current / show <uid>` | Inspect Claude Code session pods |
|
|
@@ -390,10 +398,10 @@ Memory itself lives in your Postgres. Embeddings stay local if you use Ollama; o
|
|
|
390
398
|
## FAQ
|
|
391
399
|
|
|
392
400
|
**Q: Does it work with Cursor / Codex / Windsurf / Continue / Cline?**
|
|
393
|
-
A: Yes
|
|
401
|
+
A: Yes, anything that speaks MCP can use Sigil. See [Use with other MCP clients](#use-with-other-mcp-clients). You lose Claude Code's auto-injection and auto-saving (the four hooks); your agent calls the MCP tools when it decides to. The memory engine is identical.
|
|
394
402
|
|
|
395
403
|
**Q: Does my data leave my machine?**
|
|
396
|
-
A: It depends on your providers. Memory storage is your own Postgres. Embeddings with Ollama stay local. The LLM call (for fact extraction, AUDM decisions, synthesis) sends text to whichever provider you picked
|
|
404
|
+
A: It depends on your providers. Memory storage is your own Postgres. Embeddings with Ollama stay local. The LLM call (for fact extraction, AUDM decisions, synthesis) sends text to whichever provider you picked, OpenRouter, OpenAI, Anthropic, or Ollama-local. Pick all-local (Ollama LLM + Ollama embeddings) for zero data egress.
|
|
397
405
|
|
|
398
406
|
**Q: Can I back up the brain?**
|
|
399
407
|
A: `sigil export --format=json --output=backup.json` exports facts, entities, pods, and documents. Or take a Postgres dump (`pg_dump sigil > sigil.sql`). To restore on a new machine: `pg_restore` then `sigil migrate` then `sigil init` (to set up the env).
|
|
@@ -402,10 +410,10 @@ A: `sigil export --format=json --output=backup.json` exports facts, entities, po
|
|
|
402
410
|
A: Single-user for now. Multiple installs sharing one Postgres works (see [Cross-machine memory](#cross-machine-memory)) but write attribution and ACLs (each pod is private / shared / public) land in 0.11.0+ along with the `agent` kind.
|
|
403
411
|
|
|
404
412
|
**Q: What happens if a hook crashes?**
|
|
405
|
-
A: Your prompt still goes through. Every hook wraps in a top-level try/catch that fails silently
|
|
413
|
+
A: Your prompt still goes through. Every hook wraps in a top-level try/catch that fails silently, Sigil's invariant is **a broken memory layer must never block a working prompt.** Errors append to `~/.sigil/.hook-errors.log`; `sigil doctor` surfaces them. After 5 unacked errors in 24h, `sigil doctor` exits with code 1 so CI / scripts can catch it.
|
|
406
414
|
|
|
407
415
|
**Q: How do I uninstall cleanly?**
|
|
408
|
-
A: `npm uninstall -g @anmol-srv/sigil` removes the binary. `rm -rf ~/.sigil` removes data and config. Unwire from Claude Code by removing the sigil hook entries from `~/.claude/settings.json` and the `@~/.sigil/CLAUDE.md` line from `~/.claude/CLAUDE.md`. The Postgres database (`sigil`) and user (`sigil_app`) survive
|
|
416
|
+
A: `npm uninstall -g @anmol-srv/sigil` removes the binary. `rm -rf ~/.sigil` removes data and config. Unwire from Claude Code by removing the sigil hook entries from `~/.claude/settings.json` and the `@~/.sigil/CLAUDE.md` line from `~/.claude/CLAUDE.md`. The Postgres database (`sigil`) and user (`sigil_app`) survive. Drop them yourself if you want them gone.
|
|
409
417
|
|
|
410
418
|
**Q: Where can I see how the retrieval pipeline actually works?**
|
|
411
419
|
A: Read `src/memory/search/hybrid.js` (entry point) and `src/memory/search/hybrid-sql.js` (the single-SQL RRF + ACT-R activation query). The pod kind registry contracts are in `src/memory/pods/kinds/`. Hooks are in `src/hooks/`.
|
|
@@ -414,4 +422,4 @@ A: Read `src/memory/search/hybrid.js` (entry point) and `src/memory/search/hybri
|
|
|
414
422
|
|
|
415
423
|
## License
|
|
416
424
|
|
|
417
|
-
|
|
425
|
+
MIT. See [LICENSE](./LICENSE).
|