granite-mem 0.1.1 → 0.1.3

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 (3) hide show
  1. package/README.md +230 -0
  2. package/dist/index.js +1168 -321
  3. package/package.json +1 -1
package/README.md ADDED
@@ -0,0 +1,230 @@
1
+ # Granite
2
+
3
+ > A local-first markdown memory system for humans and agents.
4
+
5
+ Granite is a simple PKM tool built around plain Markdown files, a small set of opinionated note types, and a fast loop for turning raw notes into useful memory.
6
+
7
+ Most PKM tools give you a blank canvas. Granite gives you a working system:
8
+
9
+ - capture quickly
10
+ - structure ideas without over-designing your workflow
11
+ - link people, meetings, projects, and decisions
12
+ - surface what to connect or write next
13
+ - stay fully local, scriptable, and agent-friendly
14
+
15
+ If you want a flexible framework, there are already many options. Granite is for people who want plain files, strong defaults, and a memory system that starts helping immediately.
16
+
17
+ ![Granite note view](docs/screenshots/granite-note.png)
18
+
19
+ ## Why Granite
20
+
21
+ Granite is built around a simple loop:
22
+
23
+ `capture -> link -> recommend -> resurface`
24
+
25
+ That means:
26
+
27
+ - your notes live as plain Markdown files with YAML frontmatter
28
+ - the index is derived state, not the source of truth
29
+ - the default note types create just enough structure to stay useful
30
+ - custom note types are easy to add in `granite.yml`
31
+ - the CLI is predictable for both humans and agents
32
+ - the local web UI makes the vault browseable without adding cloud lock-in
33
+
34
+ Granite is opinionated where it matters and flexible where it should be.
35
+
36
+ ## What Makes It Different
37
+
38
+ ### 1. Simple by default
39
+
40
+ Granite ships with a small working model instead of an empty workspace:
41
+
42
+ - `fleeting` for quick capture
43
+ - `permanent` for durable ideas
44
+ - `reference` for external sources
45
+ - `person` for people and relationships
46
+ - `meeting` for notes with attendees, decisions, and actions
47
+ - `project` for active work
48
+ - `decision` for durable decision records
49
+
50
+ This is enough structure to make your notes connect naturally, without forcing you into a heavyweight system.
51
+
52
+ ### 2. Custom types without losing the plot
53
+
54
+ You can add your own note types in `granite.yml`, but Granite still works out of the box. The product stays simple because the core model is small and every type shares the same mechanics: folder, template, line limit, guidance, and slug strategy.
55
+
56
+ ### 3. Agent-native, not just agent-compatible
57
+
58
+ Granite is designed to be easy for agents to read and act on:
59
+
60
+ - notes are plain files
61
+ - metadata is explicit
62
+ - commands support `--json`
63
+ - vault structure is predictable
64
+ - search, backlinks, and recommendations are available from the CLI
65
+
66
+ It works well as a personal system, and it also works as a memory layer for coding agents, assistants, or local automation.
67
+
68
+ ## Quickstart
69
+
70
+ Clone the repo and install dependencies:
71
+
72
+ ```bash
73
+ git clone https://github.com/The-Vibe-Company/Granite
74
+ cd Granite
75
+ npm install
76
+ npm run build
77
+ npm link
78
+ ```
79
+
80
+ Create the default vault in `~/.granite` and start capturing:
81
+
82
+ ```bash
83
+ mem init
84
+ mem add "Talked to Alice about local-first sync tradeoffs"
85
+ mem new "Local-first sync tradeoffs" --type permanent
86
+ mem list
87
+ mem search "sync"
88
+ mem serve
89
+ ```
90
+
91
+ `mem 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
+
93
+ ## Example Workflow
94
+
95
+ Capture something quickly:
96
+
97
+ ```bash
98
+ mem add "Users want fewer note types, but stronger defaults."
99
+ ```
100
+
101
+ Turn it into a durable note:
102
+
103
+ ```bash
104
+ mem new "Strong defaults beat infinite flexibility" --type permanent
105
+ ```
106
+
107
+ Find connections:
108
+
109
+ ```bash
110
+ mem suggest-links strong-defaults-beat-infinite-flexibility
111
+ mem recommend strong-defaults-beat-infinite-flexibility
112
+ mem backlinks strong-defaults-beat-infinite-flexibility
113
+ ```
114
+
115
+ Open the local UI:
116
+
117
+ ```bash
118
+ mem serve
119
+ ```
120
+
121
+ Then browse notes, search the vault, inspect backlinks, and explore the graph locally.
122
+
123
+ ![Granite graph view](docs/screenshots/granite-graph.png)
124
+
125
+ ## Custom Note Types
126
+
127
+ Granite is intentionally small, but not rigid. Add a type in `granite.yml` when your workflow genuinely needs it:
128
+
129
+ ```yaml
130
+ note_types:
131
+ idea:
132
+ folder: notes/ideas
133
+ description: Early product ideas worth pressure-testing
134
+ template: |
135
+ ## Problem
136
+
137
+ ## Insight
138
+
139
+ ## Why now
140
+
141
+ ## Next step
142
+ line_limit: 120
143
+ warn_only: true
144
+ slug_format: title
145
+ instructions: Capture the idea clearly, then link it to a project, person, or permanent note.
146
+ ```
147
+
148
+ The point is not to create 30 note types. The point is to add a type only when it makes your memory system sharper.
149
+
150
+ ## Local-First Architecture
151
+
152
+ Granite keeps the source of truth boring and durable:
153
+
154
+ - notes are Markdown files
155
+ - metadata lives in YAML frontmatter
156
+ - the default vault lives in `~/.granite`
157
+ - vault configuration lives in `~/.granite/granite.yml`
158
+ - full-text search and link resolution are backed by a local SQLite index in `~/.granite/index.db`
159
+ - the index can be rebuilt from the files at any time
160
+
161
+ This keeps the system transparent, portable, and inspectable.
162
+
163
+ ## Agent-Friendly CLI
164
+
165
+ Many commands support JSON output:
166
+
167
+ ```bash
168
+ mem new "Sync constraints" --type permanent --json
169
+ mem list --json
170
+ mem show sync-constraints --json
171
+ mem search "constraints" --json
172
+ mem backlinks sync-constraints --json
173
+ mem recommend sync-constraints --json
174
+ ```
175
+
176
+ That makes Granite a useful substrate for local workflows, scripts, and agent memory.
177
+
178
+ ## Commands
179
+
180
+ ```bash
181
+ mem init
182
+ mem new <title> [--type <type>] [--json]
183
+ mem add [text] [--json]
184
+ mem list [--type <type>] [--json]
185
+ mem edit <slug>
186
+ mem open <slug>
187
+ mem show <slug> [--json] [--body]
188
+ mem search <query> [--json]
189
+ mem backlinks <slug> [--json]
190
+ mem suggest-links <slug> [--json]
191
+ mem recommend <slug> [--json]
192
+ mem types
193
+ mem doctor
194
+ mem serve [-p <port>]
195
+ ```
196
+
197
+ ## Development
198
+
199
+ ```bash
200
+ npm run build
201
+ npm run dev
202
+ npm run test
203
+ npm run test:watch
204
+ npm run lint
205
+ ```
206
+
207
+ Run a single test file:
208
+
209
+ ```bash
210
+ npx vitest run test/core/note.test.ts
211
+ ```
212
+
213
+ Run the CLI without building:
214
+
215
+ ```bash
216
+ npx tsx src/index.ts <command>
217
+ ```
218
+
219
+ ## Philosophy
220
+
221
+ Granite is built on a few beliefs:
222
+
223
+ - local-first beats cloud dependence for personal memory
224
+ - plain Markdown beats proprietary formats
225
+ - strong defaults beat blank canvases
226
+ - relationships between notes matter more than visual chrome
227
+ - a good PKM should help you decide what to connect or write next
228
+ - tools for humans should also be legible to agents
229
+
230
+ If that sounds right, Granite is the tool.