@hiveforge/hivemind-mcp 2.3.0 → 2.5.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.
Files changed (65) hide show
  1. package/README.md +169 -27
  2. package/dist/cli.js +938 -77
  3. package/dist/cli.js.map +1 -1
  4. package/dist/config/schema.d.ts +125 -0
  5. package/dist/config/schema.d.ts.map +1 -0
  6. package/dist/config/schema.js +79 -0
  7. package/dist/config/schema.js.map +1 -0
  8. package/dist/graph/builder.d.ts +7 -3
  9. package/dist/graph/builder.d.ts.map +1 -1
  10. package/dist/graph/builder.js +51 -21
  11. package/dist/graph/builder.js.map +1 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +35 -2
  14. package/dist/index.js.map +1 -1
  15. package/dist/mcp/tool-generator.d.ts +3 -1
  16. package/dist/mcp/tool-generator.d.ts.map +1 -1
  17. package/dist/mcp/tool-generator.js +41 -5
  18. package/dist/mcp/tool-generator.js.map +1 -1
  19. package/dist/search/engine.d.ts +9 -1
  20. package/dist/search/engine.d.ts.map +1 -1
  21. package/dist/search/engine.js +16 -4
  22. package/dist/search/engine.js.map +1 -1
  23. package/dist/templates/builtin/people-management.d.ts +18 -0
  24. package/dist/templates/builtin/people-management.d.ts.map +1 -0
  25. package/dist/templates/builtin/people-management.js +533 -0
  26. package/dist/templates/builtin/people-management.js.map +1 -0
  27. package/dist/templates/builtin/research.d.ts +18 -0
  28. package/dist/templates/builtin/research.d.ts.map +1 -0
  29. package/dist/templates/builtin/research.js +359 -0
  30. package/dist/templates/builtin/research.js.map +1 -0
  31. package/dist/templates/builtin/worldbuilding.d.ts.map +1 -1
  32. package/dist/templates/builtin/worldbuilding.js +148 -0
  33. package/dist/templates/builtin/worldbuilding.js.map +1 -1
  34. package/dist/templates/community/architecture.d.ts +19 -0
  35. package/dist/templates/community/architecture.d.ts.map +1 -0
  36. package/dist/templates/community/architecture.js +296 -0
  37. package/dist/templates/community/architecture.js.map +1 -0
  38. package/dist/templates/community/index.d.ts +37 -0
  39. package/dist/templates/community/index.d.ts.map +1 -0
  40. package/dist/templates/community/index.js +45 -0
  41. package/dist/templates/community/index.js.map +1 -0
  42. package/dist/templates/community/ux-research.d.ts +21 -0
  43. package/dist/templates/community/ux-research.d.ts.map +1 -0
  44. package/dist/templates/community/ux-research.js +347 -0
  45. package/dist/templates/community/ux-research.js.map +1 -0
  46. package/dist/templates/loader.d.ts +65 -8
  47. package/dist/templates/loader.d.ts.map +1 -1
  48. package/dist/templates/loader.js +139 -12
  49. package/dist/templates/loader.js.map +1 -1
  50. package/dist/templates/registry.d.ts +31 -1
  51. package/dist/templates/registry.d.ts.map +1 -1
  52. package/dist/templates/registry.js +64 -0
  53. package/dist/templates/registry.js.map +1 -1
  54. package/dist/templates/types.d.ts +57 -0
  55. package/dist/templates/types.d.ts.map +1 -1
  56. package/dist/templates/validator.d.ts +166 -0
  57. package/dist/templates/validator.d.ts.map +1 -1
  58. package/dist/templates/validator.js +67 -2
  59. package/dist/templates/validator.js.map +1 -1
  60. package/dist/templates/version.d.ts +63 -0
  61. package/dist/templates/version.d.ts.map +1 -0
  62. package/dist/templates/version.js +119 -0
  63. package/dist/templates/version.js.map +1 -0
  64. package/dist/types/index.d.ts +12 -12
  65. package/package.json +1 -1
package/README.md CHANGED
@@ -12,20 +12,46 @@
12
12
  [![GitHub issues](https://img.shields.io/github/issues/hiveforge-sh/hivemind)](https://github.com/hiveforge-sh/hivemind/issues)
13
13
  [![GitHub stars](https://img.shields.io/github/stars/hiveforge-sh/hivemind)](https://github.com/hiveforge-sh/hivemind/stargazers)
14
14
 
15
- An MCP (Model Context Protocol) server for Obsidian worldbuilding vaults that provides AI tools with consistent, canonical context from your fictional worlds.
15
+ A domain-agnostic MCP (Model Context Protocol) server for Obsidian vaults that provides AI tools with consistent, structured context from your knowledge base.
16
+
17
+ **The AI Memory Firewall**: Hivemind's core value isn't just better answers — it's *preventing AI from inventing context*. Your knowledge graph becomes a truth anchor that keeps AI grounded in facts you control.
16
18
 
17
19
  ## What is Hivemind?
18
20
 
19
- Hivemind bridges your Obsidian vault (where you maintain your worldbuilding canon) and AI tools (Claude, ComfyUI, etc.) via the Model Context Protocol. It ensures AI-generated content stays consistent with your established characters, locations, lore, and approved assets.
21
+ Hivemind bridges your Obsidian vault and AI tools (Claude, ComfyUI, etc.) via the Model Context Protocol. With pluggable templates, it supports multiple domains out of the box:
22
+
23
+ - **Worldbuilding** — Characters, Locations, Events, Factions, Lore, Assets
24
+ - **Research** — Papers, Citations, Concepts, Notes
25
+ - **People Management** — People, Goals, Teams, 1:1 Meetings
26
+ - **Software Architecture** — Systems, Components, ADRs, Constraints *(community)*
27
+ - **UX Research** — Interviews, Insights, Hypotheses, Personas *(community)*
28
+
29
+ Or define your own custom entity types via `config.json` — no code required.
20
30
 
21
31
  ## Features
22
32
 
23
- - 🔍 **HybridRAG Search**: Combines vector, graph, and keyword search for accurate context retrieval
24
- - 📚 **Obsidian Native**: Works with standard markdown, YAML frontmatter, and wikilinks
25
- - 🎨 **Asset Provenance**: Track AI-generated images and their generation settings
26
- - 🔐 **Local-First**: Your data stays on your machine, with optional cloud deployment
27
- - **Canon Management**: Draft Pending Canon approval workflow
28
- - 🚀 **High Performance**: <300ms query latency, supports 1000+ note vaults
33
+ - **Pluggable Templates**: Built-in templates for worldbuilding, research, people management, and software architecture or define your own
34
+ - **HybridRAG Search**: Combines vector, graph, and keyword search for accurate context retrieval
35
+ - **Obsidian Native**: Works with standard markdown, YAML frontmatter, and wikilinks
36
+ - **Custom Relationships**: Define relationship types per template with bidirectionality and validation
37
+ - **Asset Provenance**: Track AI-generated images and their generation settings
38
+ - **Local-First**: Your data stays on your machine — critical for sensitive domains like people management and architecture decisions
39
+ - **Canon Management**: Draft → Pending → Canon approval workflow with consistency validation
40
+ - **High Performance**: <300ms query latency, supports 1000+ note vaults
41
+
42
+ ### Canon Workflow: Not Just for Fiction
43
+
44
+ The canon workflow applies far beyond worldbuilding:
45
+
46
+ | Domain | What Gets Canon Status |
47
+ |--------|----------------------|
48
+ | **Worldbuilding** | Approved lore, character facts, timeline events |
49
+ | **Architecture** | Accepted ADRs, design decisions, constraints |
50
+ | **Brand** | Voice guidelines, approved messaging, visual identity |
51
+ | **Security** | Approved policies, access controls, compliance rules |
52
+ | **People Management** | Finalized goals, approved team structures |
53
+
54
+ AI that references non-canon content gets flagged. AI that violates canon constraints gets corrected. This is **governance without meetings**.
29
55
 
30
56
  ## Quick Start
31
57
 
@@ -110,6 +136,9 @@ If you prefer to configure manually, create a `config.json`:
110
136
  "server": {
111
137
  "transport": "stdio"
112
138
  },
139
+ "template": {
140
+ "activeTemplate": "worldbuilding"
141
+ },
113
142
  "indexing": {
114
143
  "strategy": "incremental",
115
144
  "batchSize": 100,
@@ -119,6 +148,84 @@ If you prefer to configure manually, create a `config.json`:
119
148
  }
120
149
  ```
121
150
 
151
+ ### Choosing a Template
152
+
153
+ Set `activeTemplate` to one of the built-in or community templates:
154
+
155
+ | Template | Use Case | Entity Types |
156
+ |----------|----------|--------------|
157
+ | `worldbuilding` | Fiction writers, game masters | Characters, Locations, Events, Factions, Lore, Assets, References |
158
+ | `research` | Academics, knowledge workers | Papers, Citations, Concepts, Notes |
159
+ | `people-management` | Managers, team leads | People, Goals, Teams, 1:1 Meetings |
160
+ | `software-architecture` | Engineers, architects | Systems, Components, Decisions (ADRs), Constraints, Interfaces |
161
+ | `ux-research` | UX researchers, product teams | Interviews, Insights, Hypotheses, Personas, Experiments |
162
+
163
+ ### Custom Templates
164
+
165
+ Define custom entity types directly in your `config.json`:
166
+
167
+ ```json
168
+ {
169
+ "template": {
170
+ "activeTemplate": "my-template",
171
+ "templates": [{
172
+ "id": "my-template",
173
+ "name": "My Custom Template",
174
+ "version": "1.0.0",
175
+ "entityTypes": [{
176
+ "name": "project",
177
+ "displayName": "Project",
178
+ "pluralName": "Projects",
179
+ "fields": [
180
+ { "name": "title", "type": "string", "required": true },
181
+ { "name": "deadline", "type": "date" },
182
+ { "name": "priority", "type": "enum", "enumValues": ["low", "medium", "high"] }
183
+ ]
184
+ }],
185
+ "relationshipTypes": [{
186
+ "id": "depends_on",
187
+ "displayName": "Depends On",
188
+ "sourceTypes": ["project"],
189
+ "targetTypes": ["project"],
190
+ "bidirectional": true,
191
+ "reverseId": "blocks"
192
+ }]
193
+ }]
194
+ }
195
+ }
196
+ ```
197
+
198
+ See [samples/](samples/) for complete example vaults for each template.
199
+
200
+ ### CLI Template Tools
201
+
202
+ Create, manage, and validate templates using the command line:
203
+
204
+ ```bash
205
+ # List available templates (built-in + community)
206
+ npx @hiveforge/hivemind-mcp list-templates
207
+
208
+ # Add a template from the registry, URL, or local file
209
+ npx @hiveforge/hivemind-mcp add-template software-architecture
210
+ npx @hiveforge/hivemind-mcp add-template https://example.com/template.json
211
+ npx @hiveforge/hivemind-mcp add-template ./my-template.json
212
+
213
+ # Interactive template creation wizard
214
+ npx @hiveforge/hivemind-mcp create-template
215
+
216
+ # Validate a template file
217
+ npx @hiveforge/hivemind-mcp validate-template template.json
218
+
219
+ # Check template compatibility with your Hivemind version
220
+ npx @hiveforge/hivemind-mcp check-compatibility
221
+ npx @hiveforge/hivemind-mcp check-compatibility software-architecture
222
+
223
+ # Generate template catalog JSON (for documentation sites)
224
+ npx @hiveforge/hivemind-mcp generate-catalog
225
+ ```
226
+
227
+ Want to contribute a template? See [CONTRIBUTING_TEMPLATES.md](CONTRIBUTING_TEMPLATES.md).
228
+
122
229
  ## Architecture
123
230
 
124
231
  ```
@@ -140,7 +247,28 @@ Obsidian Vault → File Watcher → Markdown Parser → Knowledge Graph
140
247
 
141
248
  ## Development Status
142
249
 
143
- **Current**: Milestone 1.0 Complete ✅ | **Next**: Milestone 2.0 Template System 🚧
250
+ **Current**: v2.1 Community Templates Complete ✅
251
+
252
+ ### v2.1 — Community Templates (Complete)
253
+
254
+ - [x] CLI tools: `create-template`, `validate-template`, `add-template`, `list-templates`
255
+ - [x] Community templates: software-architecture, ux-research
256
+ - [x] Enhanced metadata: category, tags, author, repository, license
257
+ - [x] Template catalog generation for docs sites
258
+ - [x] Version compatibility checking with `minHivemindVersion`
259
+ - [x] Template contribution guide
260
+
261
+ ### v2.0 — Template System (Complete)
262
+
263
+ Hivemind is now domain-agnostic with pluggable templates:
264
+
265
+ - [x] Template registry with config-driven entity definitions
266
+ - [x] Dynamic Zod schema generation from config
267
+ - [x] Auto-generated MCP tools per entity type (`query_<type>`, `list_<type>`)
268
+ - [x] Worldbuilding template extraction (backwards compatible)
269
+ - [x] Custom relationship types per template with validation
270
+ - [x] Built-in templates: worldbuilding, research, people-management
271
+ - [x] Sample vaults for each template
144
272
 
145
273
  ### v1.0 — MVP + Core Features (Shipped)
146
274
 
@@ -152,27 +280,37 @@ Obsidian Vault → File Watcher → Markdown Parser → Knowledge Graph
152
280
  - [x] Obsidian plugin with image generation
153
281
  - [x] CI/CD with semantic-release and CodeQL scanning
154
282
 
155
- ### v2.0 — Template System (In Progress)
156
-
157
- Make Hivemind domain-agnostic with pluggable templates:
158
-
159
- - [ ] Template registry with config-driven entity definitions
160
- - [ ] Built-in templates: worldbuilding, research, people-management
161
- - [ ] Custom entity types via config (no coding required)
162
- - [ ] Auto-generated MCP tools per entity type
163
- - [ ] Custom relationship types per template
283
+ ### Coming Soon
164
284
 
165
- **Also pending:**
166
285
  - [ ] Obsidian community plugin submission
286
+ - [ ] Timeline queries with date range filtering
287
+ - [ ] Web-based template builder
167
288
 
168
289
  ## MCP Tools
169
290
 
170
- ### Query Tools
291
+ ### Dynamic Entity Tools (Auto-Generated)
292
+
293
+ Tools are automatically generated for each entity type defined in the active template:
294
+
295
+ | Tool Pattern | Description |
296
+ |--------------|-------------|
297
+ | `query_<type>` | Get entity by ID/name with relationships and content |
298
+ | `list_<type>` | List all entities of type with optional filters |
299
+
300
+ **Built-in and community template tools:**
301
+
302
+ | Template | Generated Tools |
303
+ |----------|-----------------|
304
+ | `worldbuilding` | `query_character`, `query_location`, `query_event`, `query_faction`, `query_lore`, `query_asset`, `query_reference` + list variants |
305
+ | `research` | `query_paper`, `query_citation`, `query_concept`, `query_note` + list variants |
306
+ | `people-management` | `query_person`, `query_goal`, `query_team`, `query_one_on_one` + list variants |
307
+ | `software-architecture` | `query_system`, `query_component`, `query_decision`, `query_constraint`, `query_interface` + list variants |
308
+ | `ux-research` | `query_interview`, `query_insight`, `query_hypothesis`, `query_persona`, `query_experiment` + list variants |
309
+
310
+ ### Search
171
311
  | Tool | Description |
172
312
  |------|-------------|
173
- | `query_character` | Get character with relationships and content |
174
- | `query_location` | Get location with hierarchy and connected entities |
175
- | `search_vault` | Hybrid search across all content with filters |
313
+ | `search_vault` | Hybrid search across all content with type/status filters |
176
314
 
177
315
  ### Asset Management
178
316
  | Tool | Description |
@@ -204,10 +342,14 @@ Make Hivemind domain-agnostic with pluggable templates:
204
342
 
205
343
  ## Documentation
206
344
 
207
- - [Setup Guide](docs/SETUP_GUIDE.md)
208
- - [ComfyUI Integration](docs/COMFYUI_INTEGRATION.md)
209
- - [Obsidian Plugin Workflow](docs/OBSIDIAN_PLUGIN_WORKFLOW.md)
210
- - [Vault Templates](sample-vault/Templates/README.md)
345
+ - [Setup Guide](docs/SETUP_GUIDE.md) — Getting started with Hivemind
346
+ - [Vault Migration Guide](docs/VAULT_MIGRATION_GUIDE.md) — Migrating existing vaults
347
+ - [Canon Workflow for Enterprise](docs/CANON_WORKFLOW_ENTERPRISE.md) — Using canon workflow for ADRs, research, and more
348
+ - [MCP Compatibility](docs/MCP_COMPATIBILITY.md) — Supported AI clients
349
+ - [ComfyUI Integration](docs/COMFYUI_INTEGRATION.md) — AI image generation
350
+ - [Obsidian Plugin Workflow](docs/OBSIDIAN_PLUGIN_WORKFLOW.md) — Plugin development
351
+ - [Sample Vaults](samples/README.md) — Example vaults for each template
352
+ - [Contributing Templates](CONTRIBUTING_TEMPLATES.md) — How to create and contribute templates
211
353
 
212
354
  ## License
213
355