@zabaca/lattice 1.3.1 → 1.3.4

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 +99 -22
  2. package/dist/main.js +2319 -2500
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -10,12 +10,11 @@ Lattice turns your markdown documentation into a searchable knowledge graph. Unl
10
10
  ## The Workflow
11
11
 
12
12
  ```bash
13
- /research "knowledge graphs" # Find existing docs or create new research
14
- /graph-sync # Extract entities & sync (automatic)
13
+ /research "knowledge graphs" # Find existing docs, create new research, auto-sync
15
14
  lattice search "your query" # Semantic search your knowledge base
16
15
  ```
17
16
 
18
- That's it. Two commands to build a knowledge base.
17
+ That's it. One command to build a knowledge base.
19
18
 
20
19
  ---
21
20
 
@@ -28,7 +27,7 @@ That's it. Two commands to build a knowledge base.
28
27
  | **Database** | Embedded DuckDB (zero config) | Docker containers required |
29
28
  | **External dependencies** | None | 2-3 (DB + vector + graph) |
30
29
  | **API keys needed** | 1 (Voyage AI for embeddings) | 2-3 (LLM + embedding + rerank) |
31
- | **Workflow** | `/research` → `/graph-sync` | Custom scripts |
30
+ | **Workflow** | `/research` (auto-syncs) | Custom scripts |
32
31
 
33
32
  ---
34
33
 
@@ -53,8 +52,7 @@ That's it. No Docker. No containers. DuckDB is embedded.
53
52
 
54
53
  ```bash
55
54
  claude # Launch Claude Code
56
- /research "your topic" # Find or create documentation
57
- /graph-sync # Build knowledge graph (automatic)
55
+ /research "your topic" # Find or create documentation (auto-syncs)
58
56
  lattice search "your query" # Semantic search
59
57
  ```
60
58
 
@@ -64,11 +62,7 @@ The `/research` command will:
64
62
  - Search your existing docs for related content
65
63
  - Ask if you need new research
66
64
  - Create organized documentation with AI assistance
67
-
68
- The `/graph-sync` command will:
69
- - Detect all new/changed documents
70
- - Extract entities using Claude Code (your subscription)
71
- - Sync to DuckDB for semantic search
65
+ - **Automatically sync** to the knowledge graph
72
66
 
73
67
  ---
74
68
 
@@ -95,22 +89,54 @@ Claude will:
95
89
 
96
90
  If no existing docs match, Claude will:
97
91
  1. Perform web research
98
- 2. Create a new topic directory (`docs/new-topic/`)
92
+ 2. Create a new topic directory (`~/.lattice/docs/new-topic/`)
99
93
  3. Generate README.md index and research document
100
- 4. Remind you to run `/graph-sync`
94
+ 4. Automatically sync to the knowledge graph
95
+
96
+ ---
101
97
 
102
- ### Batch Syncing
98
+ ## Question Tracking
103
99
 
104
- `/graph-sync` doesn't need to run after each research session. It identifies all documents needing sync:
100
+ Track research questions and link them to answers in your knowledge base.
105
101
 
106
102
  ```bash
107
- # After multiple research sessions
108
- /graph-sync
103
+ lattice question:add "How does X work?" # Track a question
104
+ lattice question:link "How does X work?" --doc ~/.lattice/docs/topic/answer.md # Link to answer
105
+ lattice question:unanswered # Find unanswered questions
106
+ ```
107
+
108
+ Questions become searchable entities with `ANSWERED_BY` relationships to documents.
109
+
110
+ ---
109
111
 
110
- # Shows: "4 documents need syncing"
111
- # Extracts entities and syncs all at once
112
+ ## P2P Knowledge Sharing
113
+
114
+ Share your research with others via encrypted peer-to-peer transfer.
115
+
116
+ ```bash
117
+ # Sender
118
+ lattice share duckdb # Share the duckdb topic
119
+ # Output: 5443-madam-bandit-river
120
+
121
+ # Receiver
122
+ lattice receive 5443-madam-bandit-river # Receive and auto-sync to graph
112
123
  ```
113
124
 
125
+ Uses [croc](https://github.com/schollz/croc) for secure transfers. The binary is auto-downloaded on first use.
126
+
127
+ ---
128
+
129
+ ## Site Generation
130
+
131
+ Generate a browsable documentation site from your knowledge base.
132
+
133
+ ```bash
134
+ lattice site # Build and serve at localhost:4321
135
+ lattice site --build # Build only (output to .lattice/site/)
136
+ ```
137
+
138
+ Uses [Astro](https://astro.build/) with a clean documentation theme. Your entities and relationships become navigable pages.
139
+
114
140
  ---
115
141
 
116
142
  ## CLI Reference
@@ -181,6 +207,57 @@ Display the derived ontology from your documents.
181
207
  lattice ontology # Show entity types and relationship types
182
208
  ```
183
209
 
210
+ ### `lattice site`
211
+
212
+ Build and serve a documentation site.
213
+
214
+ ```bash
215
+ lattice site # Build and serve at localhost:4321
216
+ lattice site --build # Build only (output to .lattice/site/)
217
+ ```
218
+
219
+ ### `lattice share`
220
+
221
+ Share a topic directory via P2P transfer.
222
+
223
+ ```bash
224
+ lattice share <path> # Share docs, outputs a receive code
225
+ ```
226
+
227
+ ### `lattice receive`
228
+
229
+ Receive shared documents.
230
+
231
+ ```bash
232
+ lattice receive <code> # Receive and auto-sync to graph
233
+ lattice receive <code> --no-sync # Receive without syncing
234
+ ```
235
+
236
+ ### `lattice question:add`
237
+
238
+ Track a research question.
239
+
240
+ ```bash
241
+ lattice question:add "question" # Create question entity
242
+ lattice question:add "question" --answered-by path # Create and link
243
+ ```
244
+
245
+ ### `lattice question:link`
246
+
247
+ Link a question to an answering document.
248
+
249
+ ```bash
250
+ lattice question:link "question" --doc path
251
+ ```
252
+
253
+ ### `lattice question:unanswered`
254
+
255
+ List questions without answers.
256
+
257
+ ```bash
258
+ lattice question:unanswered
259
+ ```
260
+
184
261
  </details>
185
262
 
186
263
  ---
@@ -192,12 +269,12 @@ lattice ontology # Show entity types and relationship types
192
269
  | Variable | Description | Default |
193
270
  |----------|-------------|---------|
194
271
  | `VOYAGE_API_KEY` | Voyage AI API key for embeddings | *required* |
195
- | `DUCKDB_PATH` | Path to DuckDB database file | `./.lattice.duckdb` |
272
+ | `DUCKDB_PATH` | Path to DuckDB database file | `~/.lattice/lattice.duckdb` |
196
273
  | `EMBEDDING_DIMENSIONS` | Embedding vector dimensions | `512` |
197
274
 
198
275
  ### Database Location
199
276
 
200
- Lattice stores its knowledge graph in a single `.lattice.duckdb` file in your docs directory. This file contains:
277
+ Lattice stores its knowledge graph in `~/.lattice/lattice.duckdb`. This file contains:
201
278
  - All extracted entities (nodes)
202
279
  - Relationships between entities
203
280
  - Vector embeddings for semantic search
@@ -209,7 +286,7 @@ You can back up, copy, or version control this file like any other.
209
286
 
210
287
  ### Entity Extraction
211
288
 
212
- When you run `/graph-sync`, Claude Code extracts entities from your documents and writes them directly to the DuckDB database. No frontmatter required — your markdown files stay clean.
289
+ When you run `/research` or `lattice sync`, Claude Code extracts entities from your documents and writes them directly to the DuckDB database. No frontmatter required — your markdown files stay clean.
213
290
 
214
291
  The extraction identifies:
215
292
  - **Entities**: People, technologies, concepts, tools, etc.