vectra-client 0.2.1 → 0.3.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 (55) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +77 -37
  3. data/CHANGELOG.md +49 -6
  4. data/README.md +52 -393
  5. data/docs/Gemfile +9 -0
  6. data/docs/_config.yml +37 -0
  7. data/docs/_layouts/default.html +14 -0
  8. data/docs/_layouts/home.html +187 -0
  9. data/docs/_layouts/page.html +82 -0
  10. data/docs/_site/api/overview/index.html +145 -0
  11. data/docs/_site/assets/main.css +649 -0
  12. data/docs/_site/assets/main.css.map +1 -0
  13. data/docs/_site/assets/minima-social-icons.svg +33 -0
  14. data/docs/_site/assets/style.css +295 -0
  15. data/docs/_site/community/contributing/index.html +110 -0
  16. data/docs/_site/examples/basic-usage/index.html +117 -0
  17. data/docs/_site/examples/index.html +58 -0
  18. data/docs/_site/feed.xml +1 -0
  19. data/docs/_site/guides/getting-started/index.html +106 -0
  20. data/docs/_site/guides/installation/index.html +82 -0
  21. data/docs/_site/index.html +92 -0
  22. data/docs/_site/providers/index.html +119 -0
  23. data/docs/_site/providers/pgvector/index.html +155 -0
  24. data/docs/_site/providers/pinecone/index.html +121 -0
  25. data/docs/_site/providers/qdrant/index.html +124 -0
  26. data/docs/_site/providers/weaviate/index.html +123 -0
  27. data/docs/_site/robots.txt +1 -0
  28. data/docs/_site/sitemap.xml +39 -0
  29. data/docs/api/overview.md +126 -0
  30. data/docs/assets/style.css +927 -0
  31. data/docs/community/contributing.md +89 -0
  32. data/docs/examples/basic-usage.md +102 -0
  33. data/docs/examples/index.md +54 -0
  34. data/docs/guides/getting-started.md +90 -0
  35. data/docs/guides/installation.md +67 -0
  36. data/docs/guides/performance.md +200 -0
  37. data/docs/index.md +37 -0
  38. data/docs/providers/index.md +81 -0
  39. data/docs/providers/pgvector.md +95 -0
  40. data/docs/providers/pinecone.md +72 -0
  41. data/docs/providers/qdrant.md +73 -0
  42. data/docs/providers/weaviate.md +72 -0
  43. data/lib/vectra/batch.rb +148 -0
  44. data/lib/vectra/cache.rb +261 -0
  45. data/lib/vectra/configuration.rb +6 -1
  46. data/lib/vectra/pool.rb +256 -0
  47. data/lib/vectra/streaming.rb +153 -0
  48. data/lib/vectra/version.rb +1 -1
  49. data/lib/vectra.rb +4 -0
  50. data/netlify.toml +12 -0
  51. metadata +58 -5
  52. data/IMPLEMENTATION_GUIDE.md +0 -686
  53. data/NEW_FEATURES_v0.2.0.md +0 -459
  54. data/RELEASE_CHECKLIST_v0.2.0.md +0 -383
  55. data/USAGE_EXAMPLES.md +0 -787
@@ -1,383 +0,0 @@
1
- # 🚀 RELEASE CHECKLIST v0.2.0
2
-
3
- Status quo: **85% complete** - Ready for release with minor gaps
4
-
5
- ---
6
-
7
- ## ✅ COMPLETED (Ready for release)
8
-
9
- ### Core Features
10
- - [x] **Instrumentation system** - Core event tracking
11
- - [x] **New Relic adapter** - APM integration
12
- - [x] **Datadog adapter** - StatsD metrics
13
- - [x] **ActiveRecord integration** - `has_vector` DSL
14
- - [x] **Rails generator** - `rails g vectra:install`
15
- - [x] **Retry logic** - Exponential backoff
16
- - [x] **Performance benchmarks** - Batch & pooling
17
- - [x] **Client instrumentation** - All methods tracked
18
- - [x] **pgvector retry** - Connection module integrated
19
-
20
- ### Documentation
21
- - [x] **USAGE_EXAMPLES.md** - 10 practical examples
22
- - [x] **IMPLEMENTATION_GUIDE.md** - Developer guide
23
- - [x] **NEW_FEATURES_v0.2.0.md** - Feature overview
24
- - [x] **Examples** - instrumentation_demo.rb, active_record_demo.rb
25
- - [x] **CHANGELOG.md** - Updated for v0.2.0
26
- - [x] **Gemspec** - Updated dependencies
27
-
28
- ### Code Quality
29
- - [x] **RuboCop** - 0 offenses
30
- - [x] **Configuration** - All new options added
31
- - [x] **lib/vectra.rb** - All modules required
32
- - [x] **Error handling** - Proper error types
33
-
34
- ---
35
-
36
- ## 🟡 IN PROGRESS (Recommended before release)
37
-
38
- ### Testing (2-3 hours)
39
- - [x] **spec/vectra/instrumentation_spec.rb** - ✅ CREATED (comprehensive)
40
- - [x] **spec/vectra/retry_spec.rb** - ✅ CREATED (comprehensive)
41
- - [ ] **spec/vectra/active_record_spec.rb** - ⚠️ NEEDS CREATION
42
- - [ ] **spec/generators/install_generator_spec.rb** - ⚠️ NEEDS CREATION
43
- - [ ] **Run full test suite** - Ensure >90% coverage
44
- - [ ] **Integration tests** - Test with real database
45
-
46
- **Time estimate:** 2-3 hours for AR and generator tests
47
-
48
- ### Documentation Polish (30 min)
49
- - [ ] **README.md** - Add "What's New in v0.2.0" section
50
- - [ ] **README.md** - Link to NEW_FEATURES_v0.2.0.md
51
- - [ ] **YARD docs** - Generate and check completeness
52
-
53
- ### Minor Fixes
54
- - [ ] **Fix gemspec name** - Change `vectra-client` to `vectra` (if needed)
55
- - [ ] **Version bump** - Update lib/vectra/version.rb to "0.2.0"
56
- - [ ] **Git tag** - Create v0.2.0 tag
57
-
58
- ---
59
-
60
- ## 🔴 NICE TO HAVE (Can be v0.2.1)
61
-
62
- ### Additional Tests
63
- - [ ] ActiveRecord thread safety tests
64
- - [ ] Instrumentation performance overhead tests
65
- - [ ] Retry logic with real PG errors
66
- - [ ] Generator output validation
67
-
68
- ### Features
69
- - [ ] Qdrant provider implementation (planned v0.3.0)
70
- - [ ] HNSW index support for pgvector (planned v0.3.0)
71
- - [ ] Async operations (planned v0.3.0)
72
- - [ ] Query builder DSL (planned v0.4.0)
73
-
74
- ### Documentation
75
- - [ ] Video tutorial
76
- - [ ] Blog post announcing features
77
- - [ ] Example Rails app in separate repo
78
-
79
- ---
80
-
81
- ## 📋 RELEASE STEPS
82
-
83
- ### 1. Final Testing (1-2 hours)
84
-
85
- ```bash
86
- # Create missing tests
87
- touch spec/vectra/active_record_spec.rb
88
- touch spec/generators/install_generator_spec.rb
89
-
90
- # Run full suite
91
- bundle exec rspec
92
-
93
- # Check coverage
94
- open coverage/index.html
95
-
96
- # Run RuboCop
97
- bundle exec rubocop
98
-
99
- # Manual testing
100
- ruby examples/instrumentation_demo.rb
101
- ruby examples/active_record_demo.rb
102
-
103
- # Run benchmarks
104
- DATABASE_URL=postgres://localhost/vectra_bench \
105
- ruby benchmarks/batch_operations_benchmark.rb
106
- ```
107
-
108
- ### 2. Update Documentation (30 min)
109
-
110
- ```bash
111
- # Update README.md
112
- # Add section after Features:
113
- ```markdown
114
- ## 🆕 What's New in v0.2.0
115
-
116
- Major release with enterprise features:
117
-
118
- - **📊 Instrumentation** - New Relic, Datadog, custom handlers
119
- - **💎 ActiveRecord** - Seamless Rails integration with `has_vector`
120
- - **🎨 Rails Generator** - `rails g vectra:install`
121
- - **🔄 Retry Logic** - Automatic resilience
122
- - **⚡ Benchmarks** - Performance testing tools
123
-
124
- 👉 See [NEW_FEATURES_v0.2.0.md](NEW_FEATURES_v0.2.0.md) for details.
125
- ```
126
-
127
- ```bash
128
- # Generate YARD docs
129
- bundle exec yard doc
130
-
131
- # Check docs completeness
132
- bundle exec yard stats --list-undoc
133
- ```
134
-
135
- ### 3. Version Bump (2 min)
136
-
137
- ```ruby
138
- # lib/vectra/version.rb
139
- module Vectra
140
- VERSION = "0.2.0"
141
- end
142
- ```
143
-
144
- ### 4. Build & Test Gem (5 min)
145
-
146
- ```bash
147
- # Build gem
148
- gem build vectra.gemspec
149
-
150
- # Install locally and test
151
- gem install vectra-0.2.0.gem
152
-
153
- # Quick smoke test
154
- ruby -e "require 'vectra'; puts Vectra::VERSION"
155
- ```
156
-
157
- ### 5. Git Commit & Tag (2 min)
158
-
159
- ```bash
160
- git add .
161
- git commit -m "Release v0.2.0
162
-
163
- - Add instrumentation (New Relic, Datadog, custom handlers)
164
- - Add ActiveRecord integration with has_vector DSL
165
- - Add Rails generator (rails g vectra:install)
166
- - Add automatic retry logic with exponential backoff
167
- - Add performance benchmarks
168
- - Add comprehensive documentation (USAGE_EXAMPLES.md, IMPLEMENTATION_GUIDE.md)
169
- - Update all Client methods with instrumentation
170
- - Add retry logic to pgvector Connection module
171
-
172
- See CHANGELOG.md for full details.
173
- "
174
-
175
- git tag v0.2.0
176
- git push origin main
177
- git push origin v0.2.0
178
- ```
179
-
180
- ### 6. Publish to RubyGems (2 min)
181
-
182
- ```bash
183
- # Push to RubyGems
184
- gem push vectra-0.2.0.gem
185
-
186
- # Verify on RubyGems.org
187
- open https://rubygems.org/gems/vectra
188
- ```
189
-
190
- ### 7. GitHub Release (5 min)
191
-
192
- ```markdown
193
- # Go to: https://github.com/stokry/vectra/releases/new
194
-
195
- Tag: v0.2.0
196
- Title: Vectra v0.2.0 - Enterprise Features
197
-
198
- ## 🎉 Major Release: Enterprise-Grade Features
199
-
200
- Version 0.2.0 adds production-ready features for monitoring, Rails integration, and resilience.
201
-
202
- ### ✨ New Features
203
-
204
- **📊 Instrumentation & Monitoring**
205
- - New Relic integration
206
- - Datadog integration
207
- - Custom handler API
208
- - Track all vector operations (duration, success/failure, metadata)
209
-
210
- **💎 ActiveRecord Integration**
211
- - `has_vector` DSL for Rails models
212
- - Automatic indexing on create/update
213
- - Vector search with AR object loading
214
- - Find similar records
215
-
216
- **🎨 Rails Generator**
217
- - Quick setup: `rails g vectra:install`
218
- - Creates initializer with smart defaults
219
- - Generates pgvector migration
220
-
221
- **🔄 Automatic Retry Logic**
222
- - Exponential backoff with jitter
223
- - Handles connection errors, timeouts, deadlocks
224
- - Already integrated in pgvector provider
225
-
226
- **⚡ Performance Tools**
227
- - Batch operations benchmark
228
- - Connection pooling benchmark
229
- - Measure and optimize your setup
230
-
231
- ### 📚 Documentation
232
-
233
- - **USAGE_EXAMPLES.md** - 10 real-world examples
234
- - **IMPLEMENTATION_GUIDE.md** - Developer guide
235
- - **NEW_FEATURES_v0.2.0.md** - Migration guide
236
-
237
- ### 🚀 Getting Started
238
-
239
- ```bash
240
- gem install vectra
241
-
242
- # Rails app
243
- rails g vectra:install --provider=pgvector --instrumentation=true
244
- ```
245
-
246
- See [NEW_FEATURES_v0.2.0.md](https://github.com/stokry/vectra/blob/main/NEW_FEATURES_v0.2.0.md) for full details.
247
-
248
- ### 📦 What's Included
249
-
250
- - 16 new files (instrumentation, AR integration, generators, benchmarks)
251
- - 2 comprehensive tests (instrumentation, retry)
252
- - 3 documentation guides
253
- - 2 example scripts
254
- - Full backward compatibility with v0.1.x
255
-
256
- ### 🙏 Thanks
257
-
258
- Thanks to everyone who provided feedback and tested early versions!
259
- ```
260
-
261
- ### 8. Announce (30 min)
262
-
263
- **Reddit Posts:**
264
- ```markdown
265
- # r/ruby
266
- Title: Vectra v0.2.0 - Unified Ruby Client for Vector Databases (Now with Rails Integration!)
267
-
268
- I just released v0.2.0 of Vectra, a gem for working with vector databases (Pinecone, pgvector).
269
-
270
- New in this release:
271
- - ActiveRecord integration with `has_vector` DSL
272
- - Rails generator for quick setup
273
- - Production monitoring (New Relic, Datadog)
274
- - Automatic retry logic
275
- - Performance benchmarks
276
-
277
- Example:
278
- ```ruby
279
- class Document < ApplicationRecord
280
- include Vectra::ActiveRecord
281
- has_vector :embedding, dimension: 384, auto_index: true
282
- end
283
-
284
- # Search
285
- results = Document.vector_search(query_vector, limit: 10)
286
- results.each { |doc| puts "#{doc.title} - #{doc.vector_score}" }
287
- ```
288
-
289
- Check it out: https://github.com/stokry/vectra
290
- RubyGems: https://rubygems.org/gems/vectra
291
- ```
292
-
293
- **Twitter/X:**
294
- ```markdown
295
- 🚀 Just released Vectra v0.2.0 - Ruby gem for vector databases!
296
-
297
- New features:
298
- 📊 Monitoring (New Relic, Datadog)
299
- 💎 ActiveRecord integration
300
- 🎨 Rails generator
301
- 🔄 Auto-retry logic
302
- ⚡ Performance tools
303
-
304
- GitHub: https://github.com/stokry/vectra
305
-
306
- #Ruby #Rails #AI #VectorDB
307
- ```
308
-
309
- **Dev.to Blog Post:**
310
- ```markdown
311
- Title: Building Semantic Search in Rails with Vectra v0.2.0
312
-
313
- Write a comprehensive guide showing:
314
- 1. Setup with Rails generator
315
- 2. ActiveRecord integration example
316
- 3. E-commerce product search use case
317
- 4. Monitoring setup
318
- 5. Performance optimization
319
-
320
- Include code examples from USAGE_EXAMPLES.md
321
- ```
322
-
323
- ---
324
-
325
- ## 📊 CURRENT STATUS
326
-
327
- ### Code Metrics
328
- - **Production code:** ~3,500 lines
329
- - **Test code:** ~2,300 lines
330
- - **Test coverage:** 82% (target: 90%)
331
- - **RuboCop offenses:** 0
332
- - **Documentation:** Excellent (3 guides + examples)
333
-
334
- ### Feature Completeness
335
- - **Core features:** 100% ✅
336
- - **Testing:** 70% (missing AR + generator tests)
337
- - **Documentation:** 95% (minor README update needed)
338
- - **Examples:** 100% ✅
339
-
340
- ### Quality Score: **9.0/10** 🎉
341
-
342
- **Recommendation:** Release now with minor testing gaps, or spend 2-3 hours completing AR/generator tests for 9.5/10 score.
343
-
344
- ---
345
-
346
- ## 🎯 POST-RELEASE (v0.2.1 - v0.3.0)
347
-
348
- ### v0.2.1 (Bug fixes, 1-2 weeks after v0.2.0)
349
- - [ ] Fix any reported issues
350
- - [ ] Add missing AR/generator tests
351
- - [ ] Performance optimizations based on feedback
352
-
353
- ### v0.3.0 (New features, 1-2 months)
354
- - [ ] Qdrant provider full implementation
355
- - [ ] HNSW index support for pgvector
356
- - [ ] Async operations
357
- - [ ] Enhanced query builder
358
-
359
- ### v1.0.0 (Production ready, 6 months)
360
- - [ ] All providers fully implemented
361
- - [ ] 100% test coverage
362
- - [ ] Comprehensive benchmarks
363
- - [ ] Rails engine for admin UI
364
-
365
- ---
366
-
367
- ## ✅ FINAL CHECKLIST
368
-
369
- Before running `gem push`:
370
-
371
- - [ ] All tests passing
372
- - [ ] RuboCop clean
373
- - [ ] CHANGELOG.md updated
374
- - [ ] Version bumped
375
- - [ ] Git tagged
376
- - [ ] README.md updated
377
- - [ ] Gemspec dependencies correct
378
- - [ ] Examples working
379
- - [ ] Documentation complete
380
-
381
- **Time to release:** 3-4 hours (with tests) or 1 hour (without)
382
-
383
- **Recommendation:** Ship it! 🚀