granite-mem 0.1.1 → 0.1.2
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 +229 -0
- package/dist/index.js +1116 -286
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,229 @@
|
|
|
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
|
+

|
|
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 a vault 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
|
+

|
|
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
|
+
- vault configuration lives in `granite.yml`
|
|
157
|
+
- full-text search and link resolution are backed by a local SQLite index in `.granite/index.db`
|
|
158
|
+
- the index can be rebuilt from the files at any time
|
|
159
|
+
|
|
160
|
+
This keeps the system transparent, portable, and inspectable.
|
|
161
|
+
|
|
162
|
+
## Agent-Friendly CLI
|
|
163
|
+
|
|
164
|
+
Many commands support JSON output:
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
mem new "Sync constraints" --type permanent --json
|
|
168
|
+
mem list --json
|
|
169
|
+
mem show sync-constraints --json
|
|
170
|
+
mem search "constraints" --json
|
|
171
|
+
mem backlinks sync-constraints --json
|
|
172
|
+
mem recommend sync-constraints --json
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
That makes Granite a useful substrate for local workflows, scripts, and agent memory.
|
|
176
|
+
|
|
177
|
+
## Commands
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
mem init
|
|
181
|
+
mem new <title> [--type <type>] [--json]
|
|
182
|
+
mem add [text] [--json]
|
|
183
|
+
mem list [--type <type>] [--json]
|
|
184
|
+
mem edit <slug>
|
|
185
|
+
mem open <slug>
|
|
186
|
+
mem show <slug> [--json] [--body]
|
|
187
|
+
mem search <query> [--json]
|
|
188
|
+
mem backlinks <slug> [--json]
|
|
189
|
+
mem suggest-links <slug> [--json]
|
|
190
|
+
mem recommend <slug> [--json]
|
|
191
|
+
mem types
|
|
192
|
+
mem doctor
|
|
193
|
+
mem serve [-p <port>]
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
## Development
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
npm run build
|
|
200
|
+
npm run dev
|
|
201
|
+
npm run test
|
|
202
|
+
npm run test:watch
|
|
203
|
+
npm run lint
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Run a single test file:
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
npx vitest run test/core/note.test.ts
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
Run the CLI without building:
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
npx tsx src/index.ts <command>
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Philosophy
|
|
219
|
+
|
|
220
|
+
Granite is built on a few beliefs:
|
|
221
|
+
|
|
222
|
+
- local-first beats cloud dependence for personal memory
|
|
223
|
+
- plain Markdown beats proprietary formats
|
|
224
|
+
- strong defaults beat blank canvases
|
|
225
|
+
- relationships between notes matter more than visual chrome
|
|
226
|
+
- a good PKM should help you decide what to connect or write next
|
|
227
|
+
- tools for humans should also be legible to agents
|
|
228
|
+
|
|
229
|
+
If that sounds right, Granite is the tool.
|