granite-mem 0.1.3 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -33
- package/dist/index.js +1743 -42
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -60,6 +60,7 @@ Granite is designed to be easy for agents to read and act on:
|
|
|
60
60
|
- notes are plain files
|
|
61
61
|
- metadata is explicit
|
|
62
62
|
- commands support `--json`
|
|
63
|
+
- Granite ships with an MCP server
|
|
63
64
|
- vault structure is predictable
|
|
64
65
|
- search, backlinks, and recommendations are available from the CLI
|
|
65
66
|
|
|
@@ -80,42 +81,48 @@ npm link
|
|
|
80
81
|
Create the default vault in `~/.granite` and start capturing:
|
|
81
82
|
|
|
82
83
|
```bash
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
mem serve
|
|
84
|
+
granite init
|
|
85
|
+
granite add "Talked to Alice about local-first sync tradeoffs"
|
|
86
|
+
granite new "Local-first sync tradeoffs" --type permanent
|
|
87
|
+
granite list
|
|
88
|
+
granite search "sync"
|
|
89
89
|
```
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
Start one long-running interface when you need it:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
granite serve # local web UI
|
|
95
|
+
granite mcp # MCP server for agent clients
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
`granite new` does more than create a file. It can immediately suggest related links, tags, and the next note to create, which is the core of Granite's value loop.
|
|
92
99
|
|
|
93
100
|
## Example Workflow
|
|
94
101
|
|
|
95
102
|
Capture something quickly:
|
|
96
103
|
|
|
97
104
|
```bash
|
|
98
|
-
|
|
105
|
+
granite add "Users want fewer note types, but stronger defaults."
|
|
99
106
|
```
|
|
100
107
|
|
|
101
108
|
Turn it into a durable note:
|
|
102
109
|
|
|
103
110
|
```bash
|
|
104
|
-
|
|
111
|
+
granite new "Strong defaults beat infinite flexibility" --type permanent
|
|
105
112
|
```
|
|
106
113
|
|
|
107
114
|
Find connections:
|
|
108
115
|
|
|
109
116
|
```bash
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
117
|
+
granite suggest-links strong-defaults-beat-infinite-flexibility
|
|
118
|
+
granite recommend strong-defaults-beat-infinite-flexibility
|
|
119
|
+
granite backlinks strong-defaults-beat-infinite-flexibility
|
|
113
120
|
```
|
|
114
121
|
|
|
115
122
|
Open the local UI:
|
|
116
123
|
|
|
117
124
|
```bash
|
|
118
|
-
|
|
125
|
+
granite serve
|
|
119
126
|
```
|
|
120
127
|
|
|
121
128
|
Then browse notes, search the vault, inspect backlinks, and explore the graph locally.
|
|
@@ -165,33 +172,65 @@ This keeps the system transparent, portable, and inspectable.
|
|
|
165
172
|
Many commands support JSON output:
|
|
166
173
|
|
|
167
174
|
```bash
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
175
|
+
granite new "Sync constraints" --type permanent --json
|
|
176
|
+
granite list --json
|
|
177
|
+
granite show sync-constraints --json
|
|
178
|
+
granite search "constraints" --json
|
|
179
|
+
granite backlinks sync-constraints --json
|
|
180
|
+
granite recommend sync-constraints --json
|
|
174
181
|
```
|
|
175
182
|
|
|
176
183
|
That makes Granite a useful substrate for local workflows, scripts, and agent memory.
|
|
177
184
|
|
|
185
|
+
## MCP Server
|
|
186
|
+
|
|
187
|
+
Granite ships with an MCP server so LLM clients can control the vault directly through tools, resources, and prompts.
|
|
188
|
+
|
|
189
|
+
Start it over stdio for local MCP clients:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
granite mcp --vault /path/to/vault
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Start it over Streamable HTTP:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
granite mcp --transport http --host 127.0.0.1 --port 3321
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
The server exposes:
|
|
202
|
+
|
|
203
|
+
- tools for vault overview, list/get/search, create/update, backlinks, link suggestions, recommendations, and doctor
|
|
204
|
+
- resources for `granite.yml`, vault overview, note types, and individual notes via `granite://notes/{slug}`
|
|
205
|
+
- prompts for refining notes and reviewing links/next steps
|
|
206
|
+
|
|
207
|
+
Example stdio client configuration:
|
|
208
|
+
|
|
209
|
+
```json
|
|
210
|
+
{
|
|
211
|
+
"command": "granite",
|
|
212
|
+
"args": ["mcp", "--vault", "/path/to/vault"]
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
178
216
|
## Commands
|
|
179
217
|
|
|
180
218
|
```bash
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
219
|
+
granite init
|
|
220
|
+
granite new <title> [--type <type>] [--json]
|
|
221
|
+
granite add [text] [--json]
|
|
222
|
+
granite list [--type <type>] [--json]
|
|
223
|
+
granite edit <slug>
|
|
224
|
+
granite open <slug>
|
|
225
|
+
granite show <slug> [--json] [--body]
|
|
226
|
+
granite search <query> [--json]
|
|
227
|
+
granite backlinks <slug> [--json]
|
|
228
|
+
granite suggest-links <slug> [--json]
|
|
229
|
+
granite recommend <slug> [--json]
|
|
230
|
+
granite types
|
|
231
|
+
granite doctor
|
|
232
|
+
granite serve [-p <port>]
|
|
233
|
+
granite mcp [--vault <path>] [--transport <stdio|http>]
|
|
195
234
|
```
|
|
196
235
|
|
|
197
236
|
## Development
|