rapidkit 0.37.0 → 0.38.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 +166 -147
  2. package/contracts/create-planner-capabilities.v1.json +251 -0
  3. package/contracts/runtime-command-surface.v1.json +52 -0
  4. package/dist/autopilot-release-SBPGNGAB.js +1 -0
  5. package/dist/chunk-2ED6SPXP.js +1 -0
  6. package/dist/chunk-3R7UJAX5.js +1 -0
  7. package/dist/{chunk-RUUDLAKJ.js → chunk-5NBYSXOZ.js} +1 -1
  8. package/dist/chunk-7XW2I6MP.js +13 -0
  9. package/dist/{chunk-U6QUN6V2.js → chunk-ABPDGFVD.js} +1 -1
  10. package/dist/chunk-IW3KLQXE.js +2 -0
  11. package/dist/{chunk-7VSYTOOG.js → chunk-NKNMGWAZ.js} +1 -1
  12. package/dist/{chunk-IOIWVHRO.js → chunk-TVIOAZ6E.js} +13 -13
  13. package/dist/chunk-XESEBTPE.js +1 -0
  14. package/dist/{create-HN5HOGQ4.js → create-Y3XJOKL5.js} +1 -1
  15. package/dist/index.js +150 -144
  16. package/dist/{pipeline-BOU4KETN.js → pipeline-C4UCLETO.js} +1 -1
  17. package/dist/{workspace-2AL5C3QZ.js → workspace-WBKFXH4Z.js} +1 -1
  18. package/dist/{workspace-agent-sync-V2H6NTGD.js → workspace-agent-sync-3FFFJYKF.js} +1 -1
  19. package/dist/{workspace-context-KCKNV5VQ.js → workspace-context-V4UGIHSC.js} +1 -1
  20. package/dist/{workspace-foundation-L6ZBGMVE.js → workspace-foundation-T45HAWKL.js} +1 -1
  21. package/dist/{workspace-intelligence-3TWXJQ7Y.js → workspace-intelligence-MGL3Z25K.js} +1 -1
  22. package/dist/{workspace-model-NQVZN5W4.js → workspace-model-IKMGY2BX.js} +1 -1
  23. package/dist/workspace-run-HOR56FON.js +1 -0
  24. package/dist/workspace-verify-A3J6D7T2.js +1 -0
  25. package/docs/AI_DYNAMIC_INTEGRATION.md +440 -0
  26. package/docs/AI_EXAMPLES.md +419 -0
  27. package/docs/AI_FEATURES.md +460 -0
  28. package/docs/AI_QUICKSTART.md +245 -0
  29. package/docs/DEVELOPMENT.md +88 -0
  30. package/docs/From Code to Shared Understanding.png +0 -0
  31. package/docs/OPEN_SOURCE_USER_SCENARIOS.md +170 -0
  32. package/docs/OPTIMIZATION_GUIDE.md +504 -0
  33. package/docs/PACKAGE_MANAGER_POLICY.md +25 -0
  34. package/docs/README.md +121 -0
  35. package/docs/SECURITY.md +63 -0
  36. package/docs/SETUP.md +107 -0
  37. package/docs/UTILITIES.md +221 -0
  38. package/docs/WORKSPACE_MARKER_SPEC.md +276 -0
  39. package/docs/ci-workflows.md +56 -0
  40. package/docs/commands-reference.md +136 -0
  41. package/docs/config-file-guide.md +295 -0
  42. package/docs/contracts/ARTIFACT_CATALOG.md +111 -0
  43. package/docs/contracts/COMMAND_OWNERSHIP_MATRIX.md +138 -0
  44. package/docs/contracts/README.md +71 -0
  45. package/docs/contracts/RUNTIME_ACCEPTANCE_MATRIX.md +98 -0
  46. package/docs/contracts/RUNTIME_SUPPORT_MATRIX.md +74 -0
  47. package/docs/contracts/rapidkit-cli-contracts.json +239 -0
  48. package/docs/create-planner-capabilities.md +81 -0
  49. package/docs/doctor-command.md +263 -0
  50. package/docs/examples/ci-agent-grounding.yml +62 -0
  51. package/docs/from-code-to-shared-understanding.md +46 -0
  52. package/docs/governance-policy.enterprise.example.json +40 -0
  53. package/docs/mirror-config.enterprise.example.json +60 -0
  54. package/docs/policies.workspace.example.yml +23 -0
  55. package/docs/workspace-operations.md +160 -0
  56. package/docs/workspace-run.md +80 -0
  57. package/package.json +3 -2
  58. package/dist/autopilot-release-AUXP2ZIF.js +0 -1
  59. package/dist/chunk-C7OVQQXT.js +0 -1
  60. package/dist/chunk-EJGKBFV4.js +0 -2
  61. package/dist/chunk-UXKB4KGZ.js +0 -13
  62. package/dist/chunk-YJ24EV3P.js +0 -1
  63. package/dist/workspace-run-DEXI52KO.js +0 -1
  64. package/dist/workspace-verify-HBCQNNGU.js +0 -1
  65. /package/dist/{chunk-D23L2GFT.js → chunk-6E5TBB2C.js} +0 -0
@@ -0,0 +1,460 @@
1
+ # 🤖 RapidKit AI Features
2
+
3
+ AI-powered module recommendations using OpenAI embeddings to help you build faster.
4
+
5
+ ## 🚀 Quick Start
6
+
7
+ ### Option 1: Automatic Setup (Recommended)
8
+
9
+ Just use AI recommendations - it will guide you through setup automatically!
10
+
11
+ ```bash
12
+ # First time - AI will detect missing embeddings and offer to generate them
13
+ npx rapidkit ai recommend "user authentication with social login"
14
+
15
+ # Output:
16
+ # ⚠️ Module embeddings not found
17
+ # AI recommendations require embeddings to be generated.
18
+ #
19
+ # ? What would you like to do?
20
+ # 🚀 Generate embeddings now (requires OpenAI API key)
21
+ # 📝 Show me how to generate them manually
22
+ # ❌ Cancel
23
+
24
+ # Choose option 1, provide API key, and embeddings will be generated automatically!
25
+ ```
26
+
27
+ ### Option 2: Manual Setup
28
+
29
+ **Step 1:** Get OpenAI API key from [OpenAI Platform](https://platform.openai.com/api-keys)
30
+
31
+ **Step 2:** Configure API key
32
+ ```bash
33
+ npx rapidkit config set-api-key
34
+ # Or (non-interactive environments):
35
+ export OPENAI_API_KEY="<YOUR_OPENAI_API_KEY>"
36
+ ```
37
+
38
+ **Step 3:** Generate embeddings (one-time, provider-cost dependent)
39
+ ```bash
40
+ npx rapidkit ai generate-embeddings
41
+
42
+ # Output:
43
+ # 🤖 Generating AI embeddings for RapidKit modules...
44
+ # 📡 Fetching modules from RapidKit...
45
+ # ✓ Found <N> modules
46
+ #
47
+ # 💰 Estimated cost: shown by CLI at runtime
48
+ # (depends on provider pricing, model, and module count)
49
+ #
50
+ # ? Generate embeddings now? Yes
51
+ # ✔ Generated embeddings for <N> modules
52
+ # ✅ Embeddings generated successfully!
53
+ ```
54
+
55
+ **Step 4:** Use AI recommendations
56
+ ```bash
57
+ npx rapidkit ai recommend "user authentication"
58
+ ```
59
+
60
+ ### Option 3: Mock Mode (Testing Without API Key)
61
+
62
+ Test AI features without an OpenAI API key using deterministic embeddings:
63
+
64
+ ```bash
65
+ # No API key? No problem! Mock mode activates automatically
66
+ npx rapidkit ai recommend "authentication"
67
+
68
+ # Output:
69
+ # ⚠️ OpenAI API key not configured - using MOCK MODE for testing
70
+ #
71
+ # 📝 Note: Mock embeddings provide approximate results for testing.
72
+ # For production, configure your OpenAI API key:
73
+ # ...
74
+ ```
75
+
76
+ Mock mode provides realistic (but not perfect) results for development and testing.
77
+
78
+ ## 📦 Features
79
+
80
+ ### AI Module Recommender
81
+
82
+ Get intelligent module suggestions based on natural language descriptions.
83
+
84
+ **Example:**
85
+ ```bash
86
+ $ npx rapidkit ai recommend "I need user authentication with email"
87
+
88
+ 📦 Recommended Modules:
89
+
90
+ 1. authentication-core ⭐
91
+ Complete authentication system with password hashing, JWT tokens, OAuth 2.0
92
+ Match: 98% - Matches: auth, login, password
93
+
94
+ 2. email ⭐
95
+ Email sending with templates, SMTP/SendGrid/AWS SES support
96
+ Match: 95% - Matches: email, notification
97
+
98
+ 3. users-core
99
+ User management system with profiles, roles, permissions
100
+ Match: 92% - Matches: user, profile
101
+
102
+ 💡 Quick install (top 3):
103
+ rapidkit add module authentication-core email users-core
104
+ ```
105
+
106
+ ## 💰 Pricing
107
+
108
+ ### One-Time Setup Cost (Estimates)
109
+ | Item | Cost | Notes |
110
+ |------|------|-------|
111
+ | Generate embeddings | Varies | One-time only, depends on model and module count |
112
+ | Update embeddings | Varies | Only when catalog changes |
113
+
114
+ ### Per-Query Cost (After Setup, Estimates)
115
+ | Usage | Cost | Notes |
116
+ |-------|------|-------|
117
+ | Single query | Very low | Depends on provider/model |
118
+ | 100 queries | Low | Depends on provider/model |
119
+ | 1,000 queries | Moderate | Depends on provider/model |
120
+ | 10,000 queries | Higher | Depends on provider/model |
121
+
122
+ **Important:** Provider pricing and limits change over time. Always validate current pricing/limits in the provider dashboard before budgeting.
123
+
124
+ 💡 **Tip:** Embeddings are generated once and reused, so ongoing query cost is typically much lower than initial setup.
125
+
126
+ ## 🔧 Configuration
127
+
128
+ ### View Current Config
129
+ ```bash
130
+ npx rapidkit config show
131
+ ```
132
+
133
+ ### Set API Key
134
+ ```bash
135
+ npx rapidkit config set-api-key
136
+ ```
137
+
138
+ ### Remove API Key
139
+ ```bash
140
+ npx rapidkit config remove-api-key
141
+ ```
142
+
143
+ ### Enable/Disable AI
144
+ ```bash
145
+ npx rapidkit config ai enable
146
+ npx rapidkit config ai disable
147
+ ```
148
+
149
+ ## 📊 How It Works
150
+
151
+ ### Architecture Overview
152
+
153
+ ```
154
+ ┌─────────────────┐
155
+ │ User Query │ "I need authentication"
156
+ └────────┬────────┘
157
+
158
+
159
+ ┌─────────────────┐
160
+ │ OpenAI API │ Convert text → embedding vector (1536 dims)
161
+ └────────┬────────┘
162
+
163
+
164
+ ┌─────────────────┐
165
+ │ Module Catalog │ 27+ modules with pre-generated embeddings
166
+ │ (Dynamic) │ Fetched from RapidKit Python Core
167
+ └────────┬────────┘
168
+
169
+
170
+ ┌─────────────────┐
171
+ │ Cosine │ Calculate similarity scores
172
+ │ Similarity │ Find closest matches
173
+ └────────┬────────┘
174
+
175
+
176
+ ┌─────────────────┐
177
+ │ Ranked Results │ Top N modules with scores & reasons
178
+ └─────────────────┘
179
+ ```
180
+
181
+ ### Technical Details
182
+
183
+ 1. **Module Catalog**:
184
+ - 27+ production-ready modules (dynamic from Python Core)
185
+ - Fallback to 11 hardcoded modules if Python unavailable
186
+ - 5-minute cache for performance
187
+
188
+ 2. **Embeddings**:
189
+ - AI converts module descriptions to 1536-dimensional vectors
190
+ - Generated once, reused for all queries
191
+ - Stored in `data/modules-embeddings.json` (508KB)
192
+
193
+ 3. **Semantic Search**:
194
+ - User query → embedding vector
195
+ - Cosine similarity with all modules
196
+ - Results sorted by relevance score (0-100%)
197
+
198
+ 4. **Smart Features**:
199
+ - Dependency detection (shows required modules)
200
+ - Match explanation (shows why module matched)
201
+ - Category grouping (auth, database, payment, etc.)
202
+ - Installation order calculation
203
+
204
+ **Technology Stack:**
205
+ - Model: `text-embedding-3-small` (OpenAI)
206
+ - Dimension: 1536 vectors
207
+ - Accuracy: 92%+ match scores
208
+ - Cost: provider-dependent (check current provider pricing)
209
+
210
+ **Performance:**
211
+ - First query: ~200ms (embedding generation)
212
+ - Subsequent queries: ~50ms (cached embeddings)
213
+ - Catalog refresh: Every 5 minutes
214
+
215
+ ## 🎯 Use Cases
216
+
217
+ ### E-commerce Platform
218
+ ```bash
219
+ rapidkit ai recommend "e-commerce with payments and inventory"
220
+ ```
221
+
222
+ ### SaaS Application
223
+ ```bash
224
+ rapidkit ai recommend "SaaS platform with subscriptions"
225
+ ```
226
+
227
+ ### Real-time Chat
228
+ ```bash
229
+ rapidkit ai recommend "real-time chat application"
230
+ ```
231
+
232
+ ### API Gateway
233
+ ```bash
234
+ rapidkit ai recommend "API gateway with rate limiting"
235
+ ```
236
+
237
+ ## 🔒 Security
238
+
239
+ - API keys stored in `$HOME/.rapidkit/config.json`
240
+ - File permissions: `600` (owner read/write only)
241
+ - Never committed to git (`.rapidkit/` in `.gitignore`)
242
+ - Environment variable supported (`OPENAI_API_KEY`)
243
+
244
+ ## 🐛 Troubleshooting
245
+
246
+ ### "Module embeddings not found"
247
+
248
+ **Solution:** Embeddings generate automatically on first use! Just follow the prompts:
249
+
250
+ ```bash
251
+ npx rapidkit ai recommend "auth"
252
+
253
+ # You'll see:
254
+ # ⚠️ Module embeddings not found
255
+ # ? What would you like to do?
256
+ # 🚀 Generate embeddings now (requires OpenAI API key)
257
+ # 📝 Show me how to generate them manually
258
+ # ❌ Cancel
259
+ ```
260
+
261
+ Or generate manually:
262
+ ```bash
263
+ npx rapidkit ai generate-embeddings
264
+ ```
265
+
266
+ ### "OpenAI API key not configured"
267
+
268
+ **Option 1:** Mock mode (no key needed, for testing)
269
+ ```bash
270
+ # Just use it! Mock mode activates automatically
271
+ npx rapidkit ai recommend "database"
272
+ ```
273
+
274
+ **Option 2:** Get a real API key
275
+ ```bash
276
+ # 1. Get key: https://platform.openai.com/api-keys
277
+ # 2. Configure it:
278
+ npx rapidkit config set-api-key
279
+
280
+ # Or set environment variable:
281
+ export OPENAI_API_KEY="<YOUR_OPENAI_API_KEY>"
282
+ ```
283
+
284
+ ### "Invalid API key" or "401 Error"
285
+
286
+ **Cause:** API key is incorrect or expired
287
+
288
+ **Solution:**
289
+ ```bash
290
+ # Update your API key
291
+ npx rapidkit config set-api-key
292
+
293
+ # Verify it's set correctly
294
+ npx rapidkit config show
295
+ ```
296
+
297
+ ### "429 Rate Limited" or "Quota Exceeded"
298
+
299
+ **Cause:** OpenAI API quota or rate limit reached
300
+
301
+ **Solutions:**
302
+ 1. **Check billing:** https://platform.openai.com/account/billing
303
+ 2. **Check limits:** https://platform.openai.com/account/limits
304
+ 3. **Upgrade tier:** Free tier has lower limits
305
+ 4. **Wait:** Rate limits reset automatically
306
+
307
+ **Rate Limits:**
308
+ - Limits vary by provider account tier and can change over time
309
+ - Check your provider dashboard for current request/token limits
310
+
311
+ ### "Failed to fetch modules from Python Core"
312
+
313
+ **Cause:** RapidKit Python not installed or not in PATH
314
+
315
+ **Impact:** Uses fallback catalog instead of the full runtime catalog
316
+
317
+ **Solution (optional):**
318
+ ```bash
319
+ # Install RapidKit Python Core
320
+ pip install -e /path/to/rapidkit-core
321
+
322
+ # Verify installation
323
+ rapidkit modules list --json
324
+ ```
325
+
326
+ **Note:** Fallback still provides good results with core modules!
327
+
328
+ ### Embeddings Out of Date
329
+
330
+ **Symptom:** New modules not appearing in recommendations
331
+
332
+ **Solution:** Update embeddings with latest modules
333
+ ```bash
334
+ npx rapidkit ai update-embeddings
335
+
336
+ # This will:
337
+ # 1. Fetch latest modules from Python Core
338
+ # 2. Generate embeddings for new modules
339
+ # 3. Update data/modules-embeddings.json
340
+ ```
341
+
342
+ ### Low Match Scores
343
+
344
+ **Symptom:** All results show <70% match
345
+
346
+ **Possible Causes:**
347
+ 1. Query too vague: "build something"
348
+ 2. Query too specific: "blockchain NFT marketplace with AI"
349
+ 3. No matching modules exist
350
+
351
+ **Solutions:**
352
+ - Make query more specific: "authentication" → "user authentication with JWT"
353
+ - Try different keywords: "storage" instead of "blockchain"
354
+ - Check available modules: `npx rapidkit ai info`
355
+
356
+ ### Mock Mode Results Not Accurate
357
+
358
+ **Cause:** Mock embeddings are deterministic but not trained
359
+
360
+ **Solution:** Use real OpenAI API for production
361
+ ```bash
362
+ # Get API key and generate real embeddings
363
+ npx rapidkit config set-api-key
364
+ npx rapidkit ai generate-embeddings
365
+ ```
366
+
367
+ ### Check Current Configuration
368
+
369
+ ```bash
370
+ # View all settings
371
+ npx rapidkit config show
372
+
373
+ # Output shows:
374
+ # - AI enabled: true/false
375
+ # - API key: <masked>
376
+ # - Embeddings status: exists/not found
377
+ # - Module count: <N> modules
378
+ ```
379
+
380
+ ### Still Having Issues?
381
+
382
+ 1. **Enable debug logging:**
383
+ ```bash
384
+ DEBUG=rapidkit:* npx rapidkit ai recommend "auth"
385
+ ```
386
+
387
+ 2. **Check for updates:**
388
+ ```bash
389
+ npm outdated rapidkit
390
+ npm update rapidkit
391
+ ```
392
+
393
+ 3. **Report issue:**
394
+ - GitHub: https://github.com/rapidkitlabs/rapidkit-npm/issues
395
+ - Include: error message, OS, Node version, command used
396
+
397
+ ## 📚 Commands Reference
398
+
399
+ ### AI Commands
400
+
401
+ | Command | Description | Example |
402
+ |---------|-------------|---------|
403
+ | `rapidkit ai recommend [query]` | Get module recommendations | `rapidkit ai recommend "auth"` |
404
+ | `rapidkit ai recommend [query] -n <N>` | Get top N recommendations | `rapidkit ai recommend "database" -n 3` |
405
+ | `rapidkit ai recommend [query] --json` | Get JSON output | `rapidkit ai recommend "auth" --json` |
406
+ | `rapidkit ai generate-embeddings` | Generate embeddings (one-time) | `rapidkit ai generate-embeddings` |
407
+ | `rapidkit ai generate-embeddings --force` | Force regenerate embeddings | `rapidkit ai generate-embeddings --force` |
408
+ | `rapidkit ai update-embeddings` | Update with latest modules | `rapidkit ai update-embeddings` |
409
+ | `rapidkit ai info` | Show AI features info | `rapidkit ai info` |
410
+
411
+ ### Configuration Commands
412
+
413
+ | Command | Description | Example |
414
+ |---------|-------------|---------|
415
+ | `rapidkit config set-api-key` | Set OpenAI API key (interactive) | `rapidkit config set-api-key` |
416
+ | `rapidkit config show` | Show current config | `rapidkit config show` |
417
+ | `rapidkit config remove-api-key` | Remove API key | `rapidkit config remove-api-key` |
418
+ | `rapidkit config ai enable` | Enable AI features | `rapidkit config ai enable` |
419
+ | `rapidkit config ai disable` | Disable AI features | `rapidkit config ai disable` |
420
+
421
+ ### Recommend Command Options
422
+
423
+ ```bash
424
+ rapidkit ai recommend [query] [options]
425
+
426
+ Options:
427
+ -n, --number <count> Number of recommendations (default: 5)
428
+ --json Output as JSON
429
+ -h, --help Display help
430
+ ```
431
+
432
+ ### Generate-Embeddings Command Options
433
+
434
+ ```bash
435
+ rapidkit ai generate-embeddings [options]
436
+
437
+ Options:
438
+ --force Force regeneration even if embeddings exist
439
+ -h, --help Display help
440
+ ```
441
+
442
+ ## 🚀 Coming Soon
443
+
444
+ - [ ] Code completion (GPT-4)
445
+ - [ ] Codebase chat
446
+ - [ ] Bug detection
447
+ - [ ] Test generation
448
+ - [ ] Architecture suggestions
449
+
450
+ ## 🤝 Contributing
451
+
452
+ See [CONTRIBUTING.md](../CONTRIBUTING.md)
453
+
454
+ ## 📄 License
455
+
456
+ MIT - See [LICENSE](../LICENSE)
457
+
458
+ ---
459
+
460
+ **Questions?** Open an issue on [GitHub](https://github.com/rapidkitlabs/rapidkit-npm/issues)
@@ -0,0 +1,245 @@
1
+ # 🚀 AI Features - Quick Start Guide
2
+
3
+ Get started with RapidKit AI recommendations in 60 seconds!
4
+
5
+ ## Option 1: Zero-Config Start (Recommended) ⚡
6
+
7
+ Just run it - AI will guide you through everything:
8
+
9
+ ```bash
10
+ npx rapidkit ai recommend "user authentication"
11
+ ```
12
+
13
+ **First time?** You'll see this:
14
+
15
+ ```
16
+ ⚠️ Module embeddings not found
17
+ AI recommendations require embeddings to be generated.
18
+
19
+ ? What would you like to do?
20
+ 🚀 Generate embeddings now (requires OpenAI API key)
21
+ 📝 Show me how to generate them manually
22
+ ❌ Cancel
23
+ ```
24
+
25
+ Select option 1, provide your OpenAI API key, and you're done! 🎉
26
+
27
+ ## Option 2: Manual Setup (For Advanced Users)
28
+
29
+ ### Step 1: Get API Key (2 minutes)
30
+
31
+ 1. Visit [OpenAI Platform](https://platform.openai.com/api-keys)
32
+ 2. Click "Create new secret key"
33
+ 3. Copy your key
34
+
35
+ ### Step 2: Configure Key (30 seconds)
36
+
37
+ ```bash
38
+ npx rapidkit config set-api-key
39
+ # Paste your API key when prompted
40
+ ```
41
+
42
+ Or set as environment variable:
43
+ ```bash
44
+ export OPENAI_API_KEY="<YOUR_OPENAI_API_KEY>"
45
+ ```
46
+
47
+ ### Step 3: Generate Embeddings (typically about a minute, provider-cost dependent)
48
+
49
+ ```bash
50
+ npx rapidkit ai generate-embeddings
51
+ ```
52
+
53
+ You'll see:
54
+ ```
55
+ 🤖 Generating AI embeddings for RapidKit modules...
56
+ 📡 Fetching modules from RapidKit...
57
+ ✓ Found <N> modules
58
+
59
+ 💰 Estimated cost: shown by CLI at runtime
60
+ (depends on current provider pricing and module count)
61
+
62
+ ? Generate embeddings now? Yes
63
+ ```
64
+
65
+ **This is a ONE-TIME cost!** Embeddings last forever.
66
+
67
+ ### Step 4: Use It! (Instant)
68
+
69
+ ```bash
70
+ npx rapidkit ai recommend "authentication with social login"
71
+ ```
72
+
73
+ Output:
74
+ ```
75
+ 📦 Recommended Modules:
76
+
77
+ 1. Authentication Core
78
+ Complete authentication with JWT, OAuth 2.0, secure sessions
79
+ Match: 95.2% - Matches: auth, login, oauth
80
+ Category: auth
81
+
82
+ 2. Users Core
83
+ User management with profiles, roles, permissions
84
+ Match: 88.7% - Matches: user, social
85
+ Category: auth
86
+ Requires: authentication-core
87
+
88
+ 💡 Quick install (top 3):
89
+ rapidkit add module authentication-core users-core
90
+
91
+ ? Would you like to install these modules now? Yes
92
+ ✅ Selected modules installed successfully
93
+ ```
94
+
95
+ ## Option 3: Test Without API Key (Mock Mode)
96
+
97
+ No API key? No problem! Try it in mock mode:
98
+
99
+ ```bash
100
+ npx rapidkit ai recommend "database with caching"
101
+ ```
102
+
103
+ You'll see:
104
+ ```
105
+ ⚠️ OpenAI API key not configured - using MOCK MODE for testing
106
+
107
+ 📝 Note: Mock embeddings provide approximate results for testing.
108
+ For production, configure your OpenAI API key:
109
+ ...
110
+ ```
111
+
112
+ Mock mode gives realistic (but not perfect) results for free!
113
+
114
+ ## 🎯 Common Use Cases
115
+
116
+ ### Find Authentication Modules
117
+ ```bash
118
+ npx rapidkit ai recommend "user authentication with email and password"
119
+ npx rapidkit ai recommend "social login with Google and Facebook"
120
+ npx rapidkit ai recommend "two-factor authentication"
121
+ ```
122
+
123
+ ### Find Database Modules
124
+ ```bash
125
+ npx rapidkit ai recommend "PostgreSQL database with migrations"
126
+ npx rapidkit ai recommend "MongoDB with async operations"
127
+ npx rapidkit ai recommend "database caching with Redis"
128
+ ```
129
+
130
+ ### Find Payment Modules
131
+ ```bash
132
+ npx rapidkit ai recommend "payment processing with Stripe"
133
+ npx rapidkit ai recommend "subscription billing"
134
+ npx rapidkit ai recommend "invoice generation"
135
+ ```
136
+
137
+ ### Find Communication Modules
138
+ ```bash
139
+ npx rapidkit ai recommend "email notifications with templates"
140
+ npx rapidkit ai recommend "SMS verification codes"
141
+ npx rapidkit ai recommend "real-time notifications"
142
+ ```
143
+
144
+ ### Find Infrastructure Modules
145
+ ```bash
146
+ npx rapidkit ai recommend "background job processing"
147
+ npx rapidkit ai recommend "file storage with S3"
148
+ npx rapidkit ai recommend "rate limiting for APIs"
149
+ ```
150
+
151
+ ## 💡 Pro Tips
152
+
153
+ ### 1. Be Specific
154
+ ❌ Bad: "authentication"
155
+ ✅ Good: "user authentication with JWT and OAuth 2.0"
156
+
157
+ ### 2. Mention Technologies
158
+ ❌ Bad: "database"
159
+ ✅ Good: "PostgreSQL database with async support"
160
+
161
+ ### 3. Describe Your Use Case
162
+ ❌ Bad: "payments"
163
+ ✅ Good: "subscription payments with recurring billing"
164
+
165
+ ### 4. Use Natural Language
166
+ ❌ Don't: "auth jwt oauth session redis"
167
+ ✅ Do: "I need authentication with JWT tokens and Redis sessions"
168
+
169
+ ### 5. Get More/Less Results
170
+ ```bash
171
+ # Get top 3 only
172
+ npx rapidkit ai recommend "auth" --number 3
173
+
174
+ # Get top 10
175
+ npx rapidkit ai recommend "auth" --number 10
176
+ ```
177
+
178
+ ### 6. JSON Output for Scripts
179
+ ```bash
180
+ npx rapidkit ai recommend "database" --json | jq '.recommendations[0].module.id'
181
+ ```
182
+
183
+ ## 🔧 Quick Commands
184
+
185
+ ```bash
186
+ # Get recommendations
187
+ npx rapidkit ai recommend "query here"
188
+
189
+ # Generate embeddings (one-time)
190
+ npx rapidkit ai generate-embeddings
191
+
192
+ # Update embeddings (after RapidKit update)
193
+ npx rapidkit ai update-embeddings
194
+
195
+ # View info and pricing
196
+ npx rapidkit ai info
197
+
198
+ # Configure API key
199
+ npx rapidkit config set-api-key
200
+
201
+ # Check current config
202
+ npx rapidkit config show
203
+ ```
204
+
205
+ ## 💰 Pricing Summary
206
+
207
+ | Item | Cost | When |
208
+ |------|------|------|
209
+ | Setup (embeddings) | Varies | One-time only |
210
+ | Per query | Varies | Every query |
211
+ | Ongoing usage | Varies | After setup |
212
+
213
+ **Note:** pricing changes over time. Check your provider dashboard for current rates.
214
+
215
+ ## ❓ Troubleshooting
216
+
217
+ ### "Module embeddings not found"
218
+ 👉 Just follow the interactive prompts - they'll guide you!
219
+
220
+ ### "Invalid API key"
221
+ ```bash
222
+ npx rapidkit config set-api-key
223
+ # Enter your correct API key
224
+ ```
225
+
226
+ ### "Quota exceeded"
227
+ 👉 Check your billing: https://platform.openai.com/account/billing
228
+
229
+ ### Want to test without spending money?
230
+ 👉 Use mock mode - it works without an API key!
231
+
232
+ ## 🎓 Learn More
233
+
234
+ - **Full Guide:** [AI_FEATURES.md](AI_FEATURES.md)
235
+ - **Technical Details:** [AI_DYNAMIC_INTEGRATION.md](AI_DYNAMIC_INTEGRATION.md)
236
+ - **Main README:** [../README.md](../README.md)
237
+
238
+ ## 🚀 Ready to Build?
239
+
240
+ Start exploring modules with AI:
241
+ ```bash
242
+ npx rapidkit ai recommend "what I want to build"
243
+ ```
244
+
245
+ That's it! Happy building! 🎉