workspai 0.46.0 → 0.48.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 (143) hide show
  1. package/README.md +225 -81
  2. package/contracts/agent-customization-pack.v1.json +11 -1
  3. package/contracts/bootstrap-compliance.v1.json +14 -0
  4. package/contracts/cli-runtime-command-inventory.v1.snapshot.json +4 -0
  5. package/contracts/extension-cli-compatibility.v1.json +13 -2
  6. package/contracts/mirror-ops.v1.json +16 -0
  7. package/contracts/published-contract-catalog.v1.json +59 -1
  8. package/contracts/runtime-command-surface.v1.json +294 -2
  9. package/contracts/transparency-evidence.v1.json +13 -0
  10. package/contracts/workspace-contract.v1.json +78 -0
  11. package/contracts/workspace-intelligence/model-usage-event.v1.json +82 -0
  12. package/contracts/workspace-intelligence/workspace-context.v1.json +20 -0
  13. package/contracts/workspace-intelligence/workspace-graph-token-efficiency.v1.json +72 -0
  14. package/contracts/workspace-intelligence/workspace-intelligence-evaluation-comparison.v1.json +53 -0
  15. package/contracts/workspace-intelligence/workspace-intelligence-evaluation.v1.json +120 -0
  16. package/contracts/workspace-intelligence/workspace-intelligence-run.v1.json +6 -1
  17. package/contracts/workspace-intelligence/workspace-knowledge-graph-change-overlay.v1.json +200 -0
  18. package/contracts/workspace-intelligence/workspace-knowledge-graph.v1.json +260 -0
  19. package/contracts/workspace-intelligence/workspace-knowledge-search.v1.json +60 -0
  20. package/contracts/workspace-intelligence-architecture.v1.json +37 -5
  21. package/contracts/workspace-intelligence-chain.v1.json +58 -6
  22. package/contracts/workspace-share-bundle.v1.json +16 -0
  23. package/dist/analyze-EEEU3MIF.js +1 -0
  24. package/dist/artifact-remediation-plan-SPOUHMK5.js +3 -0
  25. package/dist/autopilot-release-XGVXPOZI.js +1 -0
  26. package/dist/chunk-32OJDBIG.js +2 -0
  27. package/dist/chunk-37CVKXBD.js +1 -0
  28. package/dist/chunk-3NU32T4A.js +2 -0
  29. package/dist/chunk-3VFA7D5T.js +1 -0
  30. package/dist/chunk-4HDYADHT.js +13 -0
  31. package/dist/chunk-54EP5CEV.js +8 -0
  32. package/dist/chunk-5S3DJQEP.js +8 -0
  33. package/dist/chunk-AFL3ACCR.js +2 -0
  34. package/dist/{chunk-VFDM65IE.js → chunk-BFLJ2R4D.js} +22 -22
  35. package/dist/chunk-BGPXQQNY.js +4 -0
  36. package/dist/chunk-BMWFQXGW.js +1 -0
  37. package/dist/{chunk-UQWOVV6V.js → chunk-CRHYBQI3.js} +1 -1
  38. package/dist/chunk-CV5HKU4P.js +1 -0
  39. package/dist/chunk-ESLPI3XZ.js +1 -0
  40. package/dist/chunk-FB7SCXAZ.js +1 -0
  41. package/dist/{chunk-WPEEC5BX.js → chunk-HDXNIN4N.js} +1 -1
  42. package/dist/chunk-HZDXO65G.js +36 -0
  43. package/dist/{chunk-J5PIZCAU.js → chunk-I46XEIPL.js} +1 -1
  44. package/dist/chunk-J5ENLXDF.js +1 -0
  45. package/dist/chunk-KB44JP4M.js +2 -0
  46. package/dist/chunk-LHOZXC2M.js +2 -0
  47. package/dist/chunk-NAJCUQ4X.js +2 -0
  48. package/dist/chunk-OA537ZQ5.js +1 -0
  49. package/dist/chunk-OW42TZFB.js +1 -0
  50. package/dist/chunk-P3D5YQB2.js +1 -0
  51. package/dist/chunk-PHXQR6PX.js +2 -0
  52. package/dist/{chunk-ZKAI3PJE.js → chunk-PRTR2DQ2.js} +1 -1
  53. package/dist/{chunk-QA5BGEQW.js → chunk-QNONOO4F.js} +1 -1
  54. package/dist/chunk-RHQW3DTP.js +1 -0
  55. package/dist/chunk-T4YR4RAI.js +2 -0
  56. package/dist/chunk-THIOE2PB.js +2 -0
  57. package/dist/{chunk-4LGXSBCN.js → chunk-VU7NZHPM.js} +1 -1
  58. package/dist/chunk-WDKNMTJQ.js +1 -0
  59. package/dist/{chunk-YUATNVOT.js → chunk-Y5UJLPS4.js} +16 -16
  60. package/dist/{chunk-6IIZJQLV.js → chunk-YJZOMRAS.js} +1 -1
  61. package/dist/{create-WCV3L6XH.js → create-DBQNAMKP.js} +1 -1
  62. package/dist/{doctor-5BWM2EMJ.js → doctor-4NNUDNGZ.js} +1 -1
  63. package/dist/{dotnet-webapi-clean-6TVFBTVI.js → dotnet-webapi-clean-A6MVDYXX.js} +4 -4
  64. package/dist/{gofiber-standard-2BL7GWZB.js → gofiber-standard-I5YPQG5V.js} +1 -1
  65. package/dist/{gogin-standard-XGP3KBXA.js → gogin-standard-VY2L4QT5.js} +1 -1
  66. package/dist/index.d.ts +56 -14
  67. package/dist/index.js +322 -320
  68. package/dist/pipeline-TQM43A3K.js +5 -0
  69. package/dist/{springboot-standard-JJNUID6M.js → springboot-standard-55XKCBIZ.js} +4 -4
  70. package/dist/{workspace-7OXW5YTJ.js → workspace-NCWRINEF.js} +1 -1
  71. package/dist/{workspace-agent-sync-O4IA6VOA.js → workspace-agent-sync-662QHXGF.js} +1 -1
  72. package/dist/{workspace-archive-H74NBBNW.js → workspace-archive-P76EDIUG.js} +1 -1
  73. package/dist/{workspace-context-R7IPUBPG.js → workspace-context-23YYCUCP.js} +1 -1
  74. package/dist/workspace-contract-TU2I7GC2.js +1 -0
  75. package/dist/workspace-dependency-graph-BP4EXYQ5.js +1 -0
  76. package/dist/workspace-explain-MWUEN643.js +1 -0
  77. package/dist/workspace-explain-contract-ZPI3JXJU.js +1 -0
  78. package/dist/{workspace-feedback-REOS36ZZ.js → workspace-feedback-SUVH2LUJ.js} +1 -1
  79. package/dist/{workspace-foundation-KXT4QI5O.js → workspace-foundation-WXJ6I7ES.js} +1 -1
  80. package/dist/workspace-graph-token-efficiency-CFGFCJ5V.js +1 -0
  81. package/dist/{workspace-history-OGOVSKZG.js → workspace-history-BANOJRQ2.js} +1 -1
  82. package/dist/workspace-intelligence-MFJE7W67.js +1 -0
  83. package/dist/workspace-intelligence-evaluation-IPH7M3WV.js +1 -0
  84. package/dist/workspace-intelligence-runner-THYLHHMF.js +1 -0
  85. package/dist/workspace-knowledge-graph-ARDC6HHG.js +1 -0
  86. package/dist/workspace-knowledge-graph-change-overlay-XG6FC4IX.js +1 -0
  87. package/dist/workspace-knowledge-graph-export-UYAYFTWX.js +10 -0
  88. package/dist/workspace-knowledge-graph-query-VOSPPH4W.js +1 -0
  89. package/dist/workspace-mcp-serve-EZR6O76D.js +3 -0
  90. package/dist/workspace-model-7OU2M3LE.js +1 -0
  91. package/dist/workspace-model-hash-MHXK5MEI.js +1 -0
  92. package/dist/{workspace-registry-summary-SZ46R5PD.js → workspace-registry-summary-ORDK7A36.js} +1 -1
  93. package/dist/workspace-run-RLIYSOTN.js +1 -0
  94. package/dist/{workspace-verify-MFQ7IXGD.js → workspace-verify-EBVL7FWT.js} +1 -1
  95. package/dist/workspace-watch-3BPGLFLB.js +1 -0
  96. package/docs/AI_DYNAMIC_INTEGRATION.md +73 -428
  97. package/docs/AI_EXAMPLES.md +37 -395
  98. package/docs/AI_FEATURES.md +76 -456
  99. package/docs/AI_QUICKSTART.md +49 -212
  100. package/docs/GLOSSARY.md +64 -0
  101. package/docs/OPEN_SOURCE_USER_SCENARIOS.md +68 -7
  102. package/docs/README.md +70 -41
  103. package/docs/README_CONTENT_CONTRACT.md +154 -0
  104. package/docs/commands-reference.md +64 -4
  105. package/docs/config-file-guide.md +6 -2
  106. package/docs/contracts/ARTIFACT_CATALOG.md +76 -37
  107. package/docs/contracts/README.md +47 -8
  108. package/docs/graph-benchmark-methodology.md +121 -0
  109. package/docs/workspace-intelligence-evaluation.md +147 -0
  110. package/docs/workspace-knowledge-graph.md +316 -0
  111. package/docs/workspace-operations.md +49 -0
  112. package/package.json +2 -1
  113. package/dist/analyze-BEBEZSZK.js +0 -1
  114. package/dist/artifact-remediation-plan-FFQSESAM.js +0 -3
  115. package/dist/autopilot-release-WUR4CQIT.js +0 -1
  116. package/dist/chunk-2G7FASAO.js +0 -2
  117. package/dist/chunk-4EPHWD27.js +0 -8
  118. package/dist/chunk-CVHMUSRX.js +0 -1
  119. package/dist/chunk-DIPD72H4.js +0 -2
  120. package/dist/chunk-EFYHGCGX.js +0 -2
  121. package/dist/chunk-FWRXA435.js +0 -2
  122. package/dist/chunk-HDURFXW5.js +0 -2
  123. package/dist/chunk-HMUKBW2S.js +0 -4
  124. package/dist/chunk-K4WNYXKK.js +0 -33
  125. package/dist/chunk-LG6RFLPZ.js +0 -1
  126. package/dist/chunk-N7DV5L7C.js +0 -1
  127. package/dist/chunk-PRBVYW3T.js +0 -1
  128. package/dist/chunk-QZLIURER.js +0 -13
  129. package/dist/chunk-RIEF2DDX.js +0 -8
  130. package/dist/chunk-SXMTSV5M.js +0 -1
  131. package/dist/chunk-SXPY523X.js +0 -1
  132. package/dist/chunk-V3LRQZ36.js +0 -1
  133. package/dist/chunk-WYFPXTTS.js +0 -2
  134. package/dist/pipeline-ORIWVVYM.js +0 -5
  135. package/dist/workspace-contract-HKCMOMFE.js +0 -1
  136. package/dist/workspace-explain-GOPQYTPQ.js +0 -1
  137. package/dist/workspace-explain-contract-SVFJAAEI.js +0 -1
  138. package/dist/workspace-intelligence-7IESQSXY.js +0 -1
  139. package/dist/workspace-intelligence-runner-6GJ5M4HB.js +0 -1
  140. package/dist/workspace-mcp-serve-FRVWBO36.js +0 -3
  141. package/dist/workspace-model-PPYX7B4S.js +0 -1
  142. package/dist/workspace-run-V3KKHTVF.js +0 -1
  143. package/dist/workspace-watch-SOPZHRWA.js +0 -1
@@ -1,484 +1,104 @@
1
- # 🤖 Workspai AI Features
1
+ # AI Module Recommender
2
2
 
3
- AI-powered module recommendations using OpenAI embeddings to help you build faster.
3
+ The AI module recommender translates a natural-language requirement into a
4
+ ranked list of modules. It is an optional catalog-discovery feature; it is not
5
+ the Workspace Intelligence model, graph, context engine, or autonomous repair
6
+ loop.
4
7
 
5
- ## 🚀 Quick Start
8
+ ## Commands
6
9
 
7
- ### Option 1: Bundled embeddings (Recommended)
10
+ | Task | Command |
11
+ | ----------------------------- | ------------------------------------------------------- |
12
+ | Recommend modules | `workspai ai recommend <query> [--number <n>] [--json]` |
13
+ | Show current AI configuration | `workspai ai info` |
14
+ | Generate a missing catalog | `workspai ai generate-embeddings [--force]` |
15
+ | Refresh an existing catalog | `workspai ai update-embeddings` |
16
+ | Enable or disable AI | `workspai config ai <enable\|disable>` |
17
+ | Store a local provider key | `workspai config set-api-key` |
18
+ | Remove the stored key | `workspai config remove-api-key [--yes]` |
8
19
 
9
- Published packages normally include bundled module embeddings. Configure an API
10
- key for query embeddings, then run a recommendation. The missing-embeddings
11
- prompt below is a recovery path, not the normal first-run path.
20
+ Use `npx workspai` instead of `workspai` when the CLI is not installed globally.
12
21
 
13
- ```bash
14
- # If bundled embeddings are missing, AI offers to regenerate them
15
- npx workspai ai recommend "user authentication with social login"
16
-
17
- # Output:
18
- # ⚠️ Module embeddings not found
19
- # AI recommendations require embeddings to be generated.
20
- #
21
- # ? What would you like to do?
22
- # 🚀 Generate embeddings now (requires OpenAI API key)
23
- # 📝 Show me how to generate them manually
24
- # ❌ Cancel
25
-
26
- # Choose option 1, provide API key, and embeddings will be generated automatically!
27
- ```
28
-
29
- ### Option 2: Manual Setup
30
-
31
- **Step 1:** Get OpenAI API key from [OpenAI Platform](https://platform.openai.com/api-keys)
32
-
33
- **Step 2:** Configure API key
34
-
35
- ```bash
36
- npx workspai config set-api-key
37
- # Or (non-interactive environments):
38
- export OPENAI_API_KEY="<YOUR_OPENAI_API_KEY>"
39
- ```
40
-
41
- **Step 3:** Generate embeddings (one-time, provider-cost dependent)
42
-
43
- ```bash
44
- npx workspai ai generate-embeddings
45
-
46
- # Output:
47
- # 🤖 Generating AI embeddings for Workspai modules...
48
- # 📡 Fetching modules from Workspai...
49
- # ✓ Found <N> modules
50
- #
51
- # 💰 Estimated cost: shown by CLI at runtime
52
- # (depends on provider pricing, model, and module count)
53
- #
54
- # ? Generate embeddings now? Yes
55
- # ✔ Generated embeddings for <N> modules
56
- # ✅ Embeddings generated successfully!
57
- ```
58
-
59
- **Step 4:** Use AI recommendations
60
-
61
- ```bash
62
- npx workspai ai recommend "user authentication"
63
- ```
64
-
65
- ### Option 3: Mock Mode (Testing Without API Key)
66
-
67
- Test AI features without an OpenAI API key using deterministic embeddings:
68
-
69
- ```bash
70
- # No API key? No problem! Mock mode activates automatically
71
- npx workspai ai recommend "authentication"
72
-
73
- # Output:
74
- # ⚠️ OpenAI API key not configured - using MOCK MODE for testing
75
- #
76
- # 📝 Note: Mock embeddings provide approximate results for testing.
77
- # For production, configure your OpenAI API key:
78
- # ...
79
- ```
80
-
81
- Mock mode provides realistic (but not perfect) results for development and testing.
82
-
83
- ## 📦 Features
84
-
85
- ### AI Module Recommender
86
-
87
- Get intelligent module suggestions based on natural language descriptions.
88
-
89
- **Example:**
90
-
91
- ```bash
92
- $ npx workspai ai recommend "I need user authentication with email"
93
-
94
- 📦 Recommended Modules:
95
-
96
- 1. authentication-core ⭐
97
- Complete authentication system with password hashing, JWT tokens, OAuth 2.0
98
- Match: 98% - Matches: auth, login, password
99
-
100
- 2. email ⭐
101
- Email sending with templates, SMTP/SendGrid/AWS SES support
102
- Match: 95% - Matches: email, notification
103
-
104
- 3. users-core
105
- User management system with profiles, roles, permissions
106
- Match: 92% - Matches: user, profile
107
-
108
- 💡 Quick install (top 3):
109
- workspai add module authentication-core email users-core
110
- ```
111
-
112
- ## 💰 Pricing
113
-
114
- ### One-Time Setup Cost (Estimates)
115
-
116
- | Item | Cost | Notes |
117
- | ------------------- | ------ | ------------------------------------------------ |
118
- | Generate embeddings | Varies | One-time only, depends on model and module count |
119
- | Update embeddings | Varies | Only when catalog changes |
120
-
121
- ### Per-Query Cost (After Setup, Estimates)
122
-
123
- | Usage | Cost | Notes |
124
- | -------------- | -------- | ------------------------- |
125
- | Single query | Very low | Depends on provider/model |
126
- | 100 queries | Low | Depends on provider/model |
127
- | 1,000 queries | Moderate | Depends on provider/model |
128
- | 10,000 queries | Higher | Depends on provider/model |
129
-
130
- **Important:** Provider pricing and limits change over time. Always validate current pricing/limits in the provider dashboard before budgeting.
131
-
132
- 💡 **Tip:** Embeddings are generated once and reused, so ongoing query cost is typically much lower than initial setup.
133
-
134
- ## 🔧 Configuration
135
-
136
- ### View Current Config
137
-
138
- ```bash
139
- npx workspai config show
140
- ```
141
-
142
- ### Set API Key
143
-
144
- ```bash
145
- npx workspai config set-api-key
146
- ```
147
-
148
- ### Remove API Key
149
-
150
- ```bash
151
- npx workspai config remove-api-key
152
- ```
153
-
154
- ### Enable/Disable AI
155
-
156
- ```bash
157
- npx workspai config ai enable
158
- npx workspai config ai disable
159
- ```
160
-
161
- ## 📊 How It Works
162
-
163
- ### Architecture Overview
164
-
165
- ```
166
- ┌─────────────────┐
167
- │ User Query │ "I need authentication"
168
- └────────┬────────┘
169
-
170
-
171
- ┌─────────────────┐
172
- │ OpenAI API │ Convert text → embedding vector (1536 dims)
173
- └────────┬────────┘
174
-
175
-
176
- ┌─────────────────┐
177
- │ Module Catalog │ Runtime-dependent modules and bundled embeddings
178
- │ (Dynamic) │ Fetched from RapidKit Python Core
179
- └────────┬────────┘
180
-
181
-
182
- ┌─────────────────┐
183
- │ Cosine │ Calculate similarity scores
184
- │ Similarity │ Find closest matches
185
- └────────┬────────┘
186
-
187
-
188
- ┌─────────────────┐
189
- │ Ranked Results │ Top N modules with scores & reasons
190
- └─────────────────┘
191
- ```
192
-
193
- ### Technical Details
194
-
195
- 1. **Module Catalog**:
196
- - Runtime catalog from Python Core when available
197
- - Bundled fallback catalog when Python is unavailable
198
- - 5-minute cache for performance
199
-
200
- 2. **Embeddings**:
201
- - AI converts module descriptions to 1536-dimensional vectors
202
- - Generated once, reused for all queries
203
- - Stored in `data/modules-embeddings.json`; size depends on catalog and model
204
-
205
- 3. **Semantic Search**:
206
- - User query → embedding vector
207
- - Cosine similarity with all modules
208
- - Results sorted by relevance score (0-100%)
209
-
210
- 4. **Smart Features**:
211
- - Dependency detection (shows required modules)
212
- - Match explanation (shows why module matched)
213
- - Category grouping (auth, database, payment, etc.)
214
- - Installation order calculation
215
-
216
- **Technology Stack:**
217
-
218
- - Model: `text-embedding-3-small` (OpenAI)
219
- - Dimension: 1536 vectors
220
- - Match scores are similarity estimates, not a versioned accuracy benchmark
221
- - Cost: provider-dependent (check current provider pricing)
222
-
223
- Performance depends on provider latency, machine state, catalog size, and cache
224
- state. The runtime catalog uses a five-minute in-process cache.
225
-
226
- ## 🎯 Use Cases
227
-
228
- ### E-commerce Platform
229
-
230
- ```bash
231
- workspai ai recommend "e-commerce with payments and inventory"
232
- ```
233
-
234
- ### SaaS Application
235
-
236
- ```bash
237
- workspai ai recommend "SaaS platform with subscriptions"
238
- ```
239
-
240
- ### Real-time Chat
241
-
242
- ```bash
243
- workspai ai recommend "real-time chat application"
244
- ```
245
-
246
- ### API Gateway
247
-
248
- ```bash
249
- workspai ai recommend "API gateway with rate limiting"
250
- ```
251
-
252
- ## 🔒 Security
253
-
254
- - API keys stored in `$HOME/.workspairc.json` (legacy `$HOME/.rapidkit/config.json` is still read)
255
- - File permissions: `600` (owner read/write only)
256
- - Never committed to git (`.workspai/` in `.gitignore` where local-only evidence is generated)
257
- - Environment variable supported (`OPENAI_API_KEY`)
258
-
259
- ## 🐛 Troubleshooting
260
-
261
- ### "Module embeddings not found"
262
-
263
- **Solution:** Embeddings generate automatically on first use! Just follow the prompts:
264
-
265
- ```bash
266
- npx workspai ai recommend "auth"
267
-
268
- # You'll see:
269
- # ⚠️ Module embeddings not found
270
- # ? What would you like to do?
271
- # 🚀 Generate embeddings now (requires OpenAI API key)
272
- # 📝 Show me how to generate them manually
273
- # ❌ Cancel
274
- ```
275
-
276
- Or generate manually:
277
-
278
- ```bash
279
- npx workspai ai generate-embeddings
280
- ```
281
-
282
- ### "OpenAI API key not configured"
283
-
284
- **Option 1:** Mock mode (no key needed, for testing)
285
-
286
- ```bash
287
- # Just use it! Mock mode activates automatically
288
- npx workspai ai recommend "database"
289
- ```
290
-
291
- **Option 2:** Get a real API key
292
-
293
- ```bash
294
- # 1. Get key: https://platform.openai.com/api-keys
295
- # 2. Configure it:
296
- npx workspai config set-api-key
297
-
298
- # Or set environment variable:
299
- export OPENAI_API_KEY="<YOUR_OPENAI_API_KEY>"
300
- ```
301
-
302
- ### "Invalid API key" or "401 Error"
303
-
304
- **Cause:** API key is incorrect or expired
305
-
306
- **Solution:**
307
-
308
- ```bash
309
- # Update your API key
310
- npx workspai config set-api-key
311
-
312
- # Verify it's set correctly
313
- npx workspai config show
314
- ```
315
-
316
- ### "429 Rate Limited" or "Quota Exceeded"
22
+ ## How ranking works
317
23
 
318
- **Cause:** OpenAI API quota or rate limit reached
319
-
320
- **Solutions:**
321
-
322
- 1. **Check billing:** https://platform.openai.com/account/billing
323
- 2. **Check limits:** https://platform.openai.com/account/limits
324
- 3. **Upgrade tier:** Free tier has lower limits
325
- 4. **Wait:** Rate limits reset automatically
326
-
327
- **Rate Limits:**
328
-
329
- - Limits vary by provider account tier and can change over time
330
- - Check your provider dashboard for current request/token limits
331
-
332
- ### "Failed to fetch modules from Python Core"
333
-
334
- **Cause:** RapidKit Python not installed or not in PATH
335
-
336
- **Impact:** Uses fallback catalog instead of the full runtime catalog
337
-
338
- **Solution (optional):**
339
-
340
- ```bash
341
- # Install RapidKit Python Core
342
- pip install -e /path/to/rapidkit-core
343
-
344
- # Verify installation
345
- rapidkit modules list --json-schema 1
24
+ ```text
25
+ Natural-language requirement
26
+
27
+ Query embedding (provider or deterministic mock)
28
+
29
+ Bundled/runtime module embedding catalog
30
+
31
+ Cosine similarity + dependency metadata
32
+
33
+ Ranked suggestions
346
34
  ```
347
35
 
348
- **Note:** Fallback still provides good results with core modules!
36
+ The catalog is loaded from the published package when available. Development and
37
+ refresh workflows can obtain current module metadata through the validated
38
+ Python Core bridge. A bounded fallback catalog keeps discovery available when
39
+ Core is absent.
349
40
 
350
- ### Embeddings Out of Date
41
+ ## Interpreting a result
351
42
 
352
- **Symptom:** New modules not appearing in recommendations
43
+ A recommendation contains module identity, description, category, declared
44
+ dependencies, similarity score, and a short match reason.
353
45
 
354
- **Solution:** Update embeddings with latest modules
46
+ Treat the score as a ranking signal only:
355
47
 
356
- ```bash
357
- npx workspai ai update-embeddings
358
-
359
- # This will:
360
- # 1. Fetch latest modules from Python Core
361
- # 2. Generate embeddings for new modules
362
- # 3. Update data/modules-embeddings.json
363
- ```
364
-
365
- ### Low Match Scores
366
-
367
- **Symptom:** All results show <70% match
48
+ - it is not a probability that the module is correct;
49
+ - it does not prove framework/runtime compatibility;
50
+ - it does not approve licensing, security, or production readiness;
51
+ - it is not comparable across embedding models or catalog revisions without a
52
+ controlled benchmark.
368
53
 
369
- **Possible Causes:**
54
+ Before installation, inspect the project capability and the selected module's
55
+ dependencies. Workspai refuses Core-backed installation when the current project
56
+ does not advertise the required command surface.
370
57
 
371
- 1. Query too vague: "build something"
372
- 2. Query too specific: "blockchain NFT marketplace with AI"
373
- 3. No matching modules exist
58
+ ## Provider and mock behavior
374
59
 
375
- **Solutions:**
60
+ - With `OPENAI_API_KEY` or a stored key, the current implementation uses the
61
+ configured OpenAI embedding client.
62
+ - Without a key, deterministic mock mode exercises the workflow without a
63
+ network request.
64
+ - Mock results are for development and UI testing, not production selection.
65
+ - Provider latency, limits, model availability, and prices can change. Consult
66
+ the provider dashboard rather than relying on hard-coded cost estimates.
376
67
 
377
- - Make query more specific: "authentication" "user authentication with JWT"
378
- - Try different keywords: "storage" instead of "blockchain"
379
- - Check available modules: `npx workspai ai info`
68
+ The current default embedding model and vector dimensions are implementation
69
+ details recorded with generated catalog data. Consumers must read that metadata
70
+ instead of assuming every catalog uses the same model.
380
71
 
381
- ### Mock Mode Results Not Accurate
72
+ ## Key storage and security
382
73
 
383
- **Cause:** Mock embeddings are deterministic but not trained
74
+ The preferred order is:
384
75
 
385
- **Solution:** Use real OpenAI API for production
76
+ 1. environment secret (`OPENAI_API_KEY`) for CI and ephemeral sessions;
77
+ 2. interactive user configuration for a trusted local machine;
78
+ 3. never a committed workspace file, shell history entry, screenshot, or issue.
386
79
 
387
- ```bash
388
- # Get API key and generate real embeddings
389
- npx workspai config set-api-key
390
- npx workspai ai generate-embeddings
391
- ```
80
+ `workspai config show` masks a stored key. `config remove-api-key --yes` supports
81
+ non-interactive cleanup. See [config-file-guide.md](./config-file-guide.md) for
82
+ configuration precedence and locations.
392
83
 
393
- ### Check Current Configuration
84
+ ## JSON automation
394
85
 
395
86
  ```bash
396
- # View all settings
397
- npx workspai config show
398
-
399
- # Output shows:
400
- # - AI enabled: true/false
401
- # - API key: <masked>
402
- # - Embeddings status: exists/not found
403
- # - Module count: <N> modules
87
+ npx workspai ai recommend "PostgreSQL with migrations" --number 3 --json
404
88
  ```
405
89
 
406
- ### Still Having Issues?
407
-
408
- 1. **Enable CLI debug logging where supported:**
409
-
410
- ```bash
411
- npx workspai --debug ai recommend "auth"
412
- ```
413
-
414
- 2. **Check for updates:**
415
-
416
- ```bash
417
- npm outdated workspai
418
- npm update workspai
419
- ```
420
-
421
- 3. **Report issue:**
422
- - GitHub: https://github.com/rapidkitlabs/workspai/issues
423
- - Include: error message, OS, Node version, command used
424
-
425
- ## 📚 Commands Reference
426
-
427
- ### AI Commands
428
-
429
- | Command | Description | Example |
430
- | ----------------------------------------- | ------------------------------ | ----------------------------------------- |
431
- | `workspai ai recommend [query]` | Get module recommendations | `workspai ai recommend "auth"` |
432
- | `workspai ai recommend [query] -n <N>` | Get top N recommendations | `workspai ai recommend "database" -n 3` |
433
- | `workspai ai recommend [query] --json` | Get JSON output | `workspai ai recommend "auth" --json` |
434
- | `workspai ai generate-embeddings` | Generate or refresh embeddings | `workspai ai generate-embeddings` |
435
- | `workspai ai update-embeddings` | Update with latest modules | `workspai ai update-embeddings` |
436
- | `workspai ai info` | Show AI features info | `workspai ai info` |
437
-
438
- ### Configuration Commands
439
-
440
- | Command | Description | Example |
441
- | -------------------------------- | -------------------------------- | -------------------------------- |
442
- | `workspai config set-api-key` | Set OpenAI API key (interactive) | `workspai config set-api-key` |
443
- | `workspai config show` | Show current config | `workspai config show` |
444
- | `workspai config remove-api-key` | Remove API key | `workspai config remove-api-key` |
445
- | `workspai config ai enable` | Enable AI features | `workspai config ai enable` |
446
- | `workspai config ai disable` | Disable AI features | `workspai config ai disable` |
447
-
448
- ### Recommend Command Options
449
-
450
- ```bash
451
- workspai ai recommend [query] [options]
452
-
453
- Options:
454
- -n, --number <count> Number of recommendations (default: 5)
455
- --json Output as JSON
456
- -h, --help Display help
457
- ```
458
-
459
- `generate-embeddings` currently regenerates when invoked. The accepted `--force`
460
- flag does not alter that behavior and should not be used as a workflow branch.
461
-
462
- ## 🚀 Planned Workspace Intelligence Extensions
463
-
464
- These are roadmap ideas, not current CLI claims. New AI-facing surfaces must be
465
- grounded in `contracts/workspace-intelligence-architecture.v1.json` before they
466
- are documented as available features.
467
-
468
- - [ ] Workspace Atlas generated from Workspace Intelligence evidence
469
- - [ ] Repository/project chat over generated evidence artifacts
470
- - [ ] Bug detection grounded in doctor, verify, and impact reports
471
- - [ ] Test generation informed by workspace model, runtime signals, and affected subgraphs
472
- - [ ] Architecture suggestions with evidence/freshness labels
473
-
474
- ## 🤝 Contributing
475
-
476
- See [CONTRIBUTING.md](../CONTRIBUTING.md)
477
-
478
- ## 📄 License
90
+ JSON mode is intended for scripts. Treat non-zero exit codes and structured error
91
+ codes as failures; do not scrape human-formatted output.
479
92
 
480
- MIT - See [LICENSE](../LICENSE)
93
+ ## Relationship to Workspace Intelligence
481
94
 
482
- ---
95
+ | Capability | Requires provider AI? | Durable evidence? | Main purpose |
96
+ | ----------------------- | --------------------- | ----------------- | ------------------------------------ |
97
+ | Module recommender | Optional | No | Discover modules from requirements |
98
+ | Workspace model/graph | No | Yes | Describe the current software system |
99
+ | Context and agent sync | No | Yes | Ground AI tools in shared evidence |
100
+ | Impact/verify/readiness | No | Yes | Govern changes and releases |
483
101
 
484
- **Questions?** Open an issue on [GitHub](https://github.com/rapidkitlabs/workspai/issues)
102
+ For the main Workspai architecture, start with
103
+ [workspace-knowledge-graph.md](./workspace-knowledge-graph.md) and
104
+ [workspace-intelligence-runner.md](./workspace-intelligence-runner.md).