vectra-client 0.3.2 → 0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d3586fe349f6746ba939c2596bf5b1110551a8e7ed16a8dc6581eaa2f91af81
4
- data.tar.gz: 11d141983fba57e97fc0d96792f75e8e2e50eac453671ddb25ce8456002acac2
3
+ metadata.gz: bcc42d23052b076d9efcb085b9490b3d21b0e1b101a8edb3d9fca500d72ac2cd
4
+ data.tar.gz: 5abe33ef210d55e3cda6ffa8f80ca1ecadcea8632c46eb9ce78c824f35684c68
5
5
  SHA512:
6
- metadata.gz: 6396f52e61633d9b2eed5502edbc80f8c001d85aea638afad4ff5c377e7d141ca80dd6198ace23808324411355924b2e653aa661e157fa4ae33c0b905bf31e4d
7
- data.tar.gz: 1581ca62c63111caaf6fc26ced7503a101ceb30c8a0531b3fa454a0ac10376446f5a358dfbb29f045de9ba799114803af02b6a021828debc8df14cab129a5147
6
+ metadata.gz: 40aaec0556a2de07028db2e75ad2ebf463f51728336fc508676a567837a45d1be00174ed679601a1aa5f976a05605c10c86817dd99616bc38b63350fa1ed9e63
7
+ data.tar.gz: 1a3bfad7f776a429be42f591af896c3c9e9ba55a45eb58dffda8b9fa50190d5248552bfab87038ab53e04183d2cbe5fcade506bf0cc99580b1435c50a30b64b9
data/.rubocop.yml CHANGED
@@ -11,6 +11,7 @@ AllCops:
11
11
  - 'bin/**/*'
12
12
  - 'node_modules/**/*'
13
13
  - 'lib/generators/**/templates/**/*'
14
+ - 'examples/**/*'
14
15
 
15
16
  # Layout
16
17
  Layout/LineLength:
@@ -30,6 +31,7 @@ Metrics/BlockLength:
30
31
  - 'vectra.gemspec'
31
32
  - 'Rakefile'
32
33
  - 'benchmarks/**/*'
34
+ - 'examples/**/*'
33
35
  AllowedMethods:
34
36
  - 'included'
35
37
  - 'class_methods'
@@ -38,26 +40,34 @@ Metrics/MethodLength:
38
40
  Max: 30
39
41
  Exclude:
40
42
  - 'spec/**/*'
43
+ - 'examples/**/*'
41
44
 
42
45
  Metrics/AbcSize:
43
46
  Max: 30
44
47
  Exclude:
45
48
  - 'spec/**/*'
49
+ - 'examples/**/*'
46
50
 
47
51
  Metrics/ClassLength:
48
52
  Max: 250
49
53
  Exclude:
50
54
  - 'spec/**/*'
55
+ - 'examples/**/*'
51
56
 
52
57
  Metrics/ModuleLength:
53
58
  Exclude:
54
59
  - 'spec/**/*'
60
+ - 'examples/**/*'
55
61
 
56
62
  Metrics/CyclomaticComplexity:
57
63
  Max: 10
64
+ Exclude:
65
+ - 'examples/**/*'
58
66
 
59
67
  Metrics/PerceivedComplexity:
60
68
  Max: 10
69
+ Exclude:
70
+ - 'examples/**/*'
61
71
 
62
72
  Metrics/ParameterLists:
63
73
  Max: 7
data/CHANGELOG.md CHANGED
@@ -1,71 +1,20 @@
1
1
  # Changelog
2
2
 
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [Unreleased]
9
-
10
- ### Added
11
-
12
- - **Proactive Rate Limiting** (`Vectra::RateLimiter`)
13
- - Token bucket algorithm for smooth rate limiting
14
- - Burst support for handling traffic spikes
15
- - Per-provider rate limiter registry
16
- - `RateLimitedClient` wrapper for automatic throttling
17
- - Prevents API rate limit errors before they occur
18
-
19
- - **Structured JSON Logging** (`Vectra::JsonLogger`)
20
- - Machine-readable JSON log format
21
- - Automatic operation logging via instrumentation
22
- - Custom metadata support
23
- - Integration with standard Ruby Logger via `JsonFormatter`
24
- - Log levels: debug, info, warn, error, fatal
25
-
26
- - **Health Check Functionality** (`Vectra::HealthCheck`)
27
- - Built-in `client.health_check` method
28
- - Connectivity and latency testing
29
- - Optional index statistics inclusion
30
- - Pool health checking for pgvector
31
- - `AggregateHealthCheck` for multi-provider setups
32
- - JSON-serializable results
33
-
34
- - **Error Tracking Integrations**
35
- - Sentry adapter with breadcrumbs, context, and fingerprinting
36
- - Honeybadger adapter with severity tags and configurable notifications
37
- - Automatic error context and grouping
38
-
39
- - **Circuit Breaker Pattern** (`Vectra::CircuitBreaker`)
40
- - Three-state circuit (closed, open, half-open)
41
- - Automatic failover with fallback support
42
- - Per-provider circuit registry
43
- - Thread-safe implementation
44
- - Configurable failure/success thresholds
45
-
46
- - **Credential Rotation** (`Vectra::CredentialRotator`)
47
- - Zero-downtime API key rotation
48
- - Pre-rotation validation
49
- - Rollback support
50
- - Multi-provider rotation manager
51
- - Per-provider rotation tracking
52
-
53
- - **Audit Logging** (`Vectra::AuditLog`)
54
- - Structured audit events for compliance
55
- - Access, authentication, authorization logging
56
- - Configuration change tracking
57
- - Credential rotation audit trail
58
- - Automatic API key sanitization
59
- - Global audit logging support
3
+ ## [v0.3.4](https://github.com/stokry/vectra/tree/v0.3.4) (2026-01-12)
60
4
 
61
- ## [v0.3.2](https://github.com/stokry/vectra/tree/v0.3.2) (2026-01-08)
62
-
63
- [Full Changelog](https://github.com/stokry/vectra/compare/v0.3.1...v0.3.2)
5
+ [Full Changelog](https://github.com/stokry/vectra/compare/v0.3.3...v0.3.4)
64
6
 
65
7
  ### Fixed
8
+ - Fixed Weaviate provider DELETE request WebMock stub to include query parameters
9
+ - Fixed RuboCop offenses: empty string interpolation, redundant else, ambiguous block associations, and style issues
66
10
 
67
- - Audit log keyword parameter ordering and optional fields now align with linting and usage expectations.
68
- - Credential rotation utilities use symbol procs and string interpolation while keeping the existing `switch_to_secondary` API.
11
+ ## [v0.3.3](https://github.com/stokry/vectra/tree/v0.3.3) (2026-01-09)
12
+
13
+ [Full Changelog](https://github.com/stokry/vectra/compare/v0.3.2...v0.3.3)
14
+
15
+ ## [v0.3.2](https://github.com/stokry/vectra/tree/v0.3.2) (2026-01-08)
16
+
17
+ [Full Changelog](https://github.com/stokry/vectra/compare/v0.3.1...v0.3.2)
69
18
 
70
19
  ## [v0.3.1](https://github.com/stokry/vectra/tree/v0.3.1) (2026-01-08)
71
20
 
@@ -75,49 +24,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
75
24
 
76
25
  [Full Changelog](https://github.com/stokry/vectra/compare/v0.2.2...v0.3.0)
77
26
 
78
- ### Added
79
-
80
- - **Async Batch Operations** (`Vectra::Batch`)
81
- - Concurrent batch upsert with configurable worker count
82
- - Automatic chunking of large vector sets
83
- - Async delete and fetch operations
84
- - Error aggregation and partial success handling
85
-
86
- - **Streaming Results** (`Vectra::Streaming`)
87
- - Lazy enumeration for large query result sets
88
- - Memory-efficient processing with automatic pagination
89
- - `query_each` and `query_stream` methods
90
- - Duplicate detection across pages
91
-
92
- - **Caching Layer** (`Vectra::Cache` and `Vectra::CachedClient`)
93
- - In-memory LRU cache with configurable TTL
94
- - Transparent caching for query and fetch operations
95
- - Index-level cache invalidation
96
- - Thread-safe with mutex synchronization
97
-
98
- - **Connection Pool with Warmup** (`Vectra::Pool`)
99
- - Configurable pool size and checkout timeout
100
- - Connection warmup at startup
101
- - Health checking and automatic reconnection
102
- - Pool statistics and monitoring
103
-
104
- - **CI Benchmark Integration**
105
- - Weekly scheduled benchmark runs
106
- - PostgreSQL (pgvector) integration in CI
107
- - Benchmark result artifact storage
108
-
109
- ### Configuration
110
-
111
- New configuration options:
112
- - `cache_enabled` - Enable/disable caching (default: false)
113
- - `cache_ttl` - Cache time-to-live in seconds (default: 300)
114
- - `cache_max_size` - Maximum cache entries (default: 1000)
115
- - `async_concurrency` - Concurrent workers for batch ops (default: 4)
116
-
117
- ### Dependencies
118
-
119
- - Added `concurrent-ruby ~> 1.2` for thread-safe operations
120
-
121
27
  ## [v0.2.2](https://github.com/stokry/vectra/tree/v0.2.2) (2026-01-08)
122
28
 
123
29
  [Full Changelog](https://github.com/stokry/vectra/compare/v0.2.1...v0.2.2)
@@ -126,56 +32,10 @@ New configuration options:
126
32
 
127
33
  [Full Changelog](https://github.com/stokry/vectra/compare/v0.2.0...v0.2.1)
128
34
 
129
- ### Added
130
-
131
- - **Qdrant Provider** - Full Qdrant vector database support:
132
- - Vector upsert, query, fetch, update, delete operations
133
- - Collection management (create, list, describe, delete)
134
- - Multiple similarity metrics: cosine, euclidean, dot product
135
- - Namespace support via payload filtering
136
- - Advanced metadata filtering with Qdrant operators ($eq, $ne, $gt, $gte, $lt, $lte, $in, $nin)
137
- - Automatic point ID hashing for string IDs
138
- - Support for both local and cloud Qdrant instances
139
- - Optional API key authentication for local deployments
140
-
141
- ### Improved
142
-
143
- - Enhanced error handling with `Faraday::RetriableResponse` support
144
- - Configuration now allows optional API key for Qdrant and pgvector (local instances)
145
- - Better retry middleware integration across all providers
146
-
147
- ### Provider Support
148
-
149
- - ✅ Pinecone - Fully implemented
150
- - ✅ pgvector (PostgreSQL) - Fully implemented
151
- - ✅ Qdrant - Fully implemented
152
- - 🚧 Weaviate - Stub implementation (planned for v0.4.0)
153
-
154
35
  ## [v0.2.0](https://github.com/stokry/vectra/tree/v0.2.0) (2026-01-08)
155
36
 
156
37
  [Full Changelog](https://github.com/stokry/vectra/compare/v0.1.3...v0.2.0)
157
38
 
158
- ### Added
159
-
160
- - **Instrumentation & Monitoring** - Track all vector operations with New Relic, Datadog, or custom handlers
161
- - **ActiveRecord Integration** - `has_vector` DSL for seamless Rails model integration with automatic indexing
162
- - **Rails Generator** - `rails generate vectra:install` for quick setup
163
- - **Automatic Retry Logic** - Exponential backoff with jitter for transient database errors
164
- - **Performance Benchmarks** - Measure batch operations and connection pooling performance
165
- - **Comprehensive Documentation** - USAGE_EXAMPLES.md, IMPLEMENTATION_GUIDE.md with 10+ real-world examples
166
-
167
- ### Improved
168
-
169
- - All Client methods now instrumented (upsert, query, fetch, update, delete)
170
- - pgvector Connection module includes retry logic with smart error detection
171
- - Configuration expanded with instrumentation, pool_size, batch_size, max_retries options
172
-
173
- ### Documentation
174
-
175
- - Added USAGE_EXAMPLES.md with e-commerce search, RAG chatbot, duplicate detection examples
176
- - Added IMPLEMENTATION_GUIDE.md for developers implementing new features
177
- - Added NEW_FEATURES_v0.2.0.md with migration guide
178
-
179
39
  ## [v0.1.3](https://github.com/stokry/vectra/tree/v0.1.3) (2026-01-07)
180
40
 
181
41
  [Full Changelog](https://github.com/stokry/vectra/compare/v0.1.1...v0.1.3)
@@ -184,33 +44,6 @@ New configuration options:
184
44
 
185
45
  [Full Changelog](https://github.com/stokry/vectra/compare/0ab2ea7b42d7fbf0b540b24889cc2b24254fef2e...v0.1.1)
186
46
 
187
- ### Added
188
-
189
- - **pgvector provider** - Full PostgreSQL with pgvector extension support:
190
- - Vector upsert, query, fetch, update, delete operations
191
- - Index (table) management with automatic schema creation
192
- - Multiple similarity metrics: cosine, euclidean, inner product
193
- - Namespace support via namespace column
194
- - Metadata filtering with JSONB
195
- - IVFFlat index creation for fast similarity search
196
- - `Vectra.pgvector` convenience method for creating pgvector clients
197
- - Comprehensive unit and integration tests for pgvector provider
198
-
199
- ### Changed
200
-
201
- - Updated gemspec description to include pgvector
202
- - Added `pg` gem as development dependency
203
-
204
- ## Planned
205
-
206
- ### [0.4.0]
207
-
208
- - Weaviate provider implementation
209
- - Additional similarity metrics
210
- - Vector quantization support
211
47
 
212
- ### [1.0.0]
213
48
 
214
- - Background job integration (Sidekiq, GoodJob)
215
- - Production-ready with full documentation
216
- - Performance monitoring dashboard
49
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
@@ -7,6 +7,7 @@
7
7
  <title>{{ page.title }} - {{ site.title }}</title>
8
8
  <link rel="stylesheet" href="{{ site.baseurl }}/assets/style.css">
9
9
  <link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>◆</text></svg>">
10
+ <script defer src="https://umami-production-dfb8.up.railway.app/script.js" data-website-id="07e5420c-12d1-4e3c-9dbd-5cecb15a878f"></script>
10
11
  </head>
11
12
  <body>
12
13
  {{ content }}
@@ -7,13 +7,19 @@
7
7
  <title>{{ page.title }} - {{ site.title }}</title>
8
8
  <link rel="stylesheet" href="{{ site.baseurl }}/assets/style.css">
9
9
  <link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>◆</text></svg>">
10
+ <script defer src="https://umami-production-dfb8.up.railway.app/script.js" data-website-id="07e5420c-12d1-4e3c-9dbd-5cecb15a878f"></script>
10
11
  </head>
11
12
  <body>
12
13
  <!-- Header -->
13
14
  <header class="tma-header">
14
15
  <nav class="tma-nav">
15
16
  <a href="{{ site.baseurl }}/" class="tma-nav__brand">Vectra</a>
16
- <ul class="tma-nav__menu">
17
+ <button class="tma-nav__toggle" aria-label="Toggle menu" aria-expanded="false">
18
+ <span class="tma-nav__toggle-line"></span>
19
+ <span class="tma-nav__toggle-line"></span>
20
+ <span class="tma-nav__toggle-line"></span>
21
+ </button>
22
+ <ul class="tma-nav__menu" id="nav-menu">
17
23
  <li><a href="{{ site.baseurl }}/guides/getting-started" class="tma-nav__link">Getting Started</a></li>
18
24
  <li><a href="{{ site.baseurl }}/providers" class="tma-nav__link">Providers</a></li>
19
25
  <li><a href="{{ site.baseurl }}/api/overview" class="tma-nav__link">API</a></li>
@@ -29,7 +35,7 @@
29
35
  <!-- Hero Section -->
30
36
  <section class="tma-hero">
31
37
  <div class="tma-hero__container">
32
- <span class="tma-hero__badge">v0.2.2Qdrant & Weaviate Support</span>
38
+ <span class="tma-hero__badge">v0.3.3Grafana Dashboard & Monitoring</span>
33
39
  <h1 class="tma-hero__title">
34
40
  Vector Databases,<br>
35
41
  <span class="tma-hero__title-gradient">Unified for Ruby.</span>
@@ -77,7 +83,7 @@
77
83
  <span class="tma-feature-card__icon">📈</span>
78
84
  <h3 class="tma-feature-card__title">Observable</h3>
79
85
  <p class="tma-feature-card__description">
80
- Native instrumentation for Datadog and New Relic. Track latency, throughput, and errors.
86
+ Grafana dashboard, Prometheus metrics, and native instrumentation for Datadog and New Relic. Track latency, throughput, and errors.
81
87
  </p>
82
88
  </div>
83
89
  <div class="tma-feature-card">
@@ -183,5 +189,40 @@
183
189
  </ul>
184
190
  </div>
185
191
  </footer>
192
+ <script>
193
+ document.addEventListener('DOMContentLoaded', function() {
194
+ const navToggle = document.querySelector('.tma-nav__toggle');
195
+ const navMenu = document.querySelector('.tma-nav__menu');
196
+
197
+ if (navToggle && navMenu) {
198
+ navToggle.addEventListener('click', function(e) {
199
+ e.preventDefault();
200
+ e.stopPropagation();
201
+ const isExpanded = navToggle.getAttribute('aria-expanded') === 'true';
202
+ navToggle.setAttribute('aria-expanded', !isExpanded);
203
+ navMenu.classList.toggle('tma-nav__menu--open');
204
+ });
205
+
206
+ // Close menu when clicking on a link
207
+ const navLinks = navMenu.querySelectorAll('.tma-nav__link');
208
+ navLinks.forEach(function(link) {
209
+ link.addEventListener('click', function() {
210
+ navToggle.setAttribute('aria-expanded', 'false');
211
+ navMenu.classList.remove('tma-nav__menu--open');
212
+ });
213
+ });
214
+
215
+ // Close menu when clicking outside
216
+ document.addEventListener('click', function(e) {
217
+ if (navMenu.classList.contains('tma-nav__menu--open') &&
218
+ !navMenu.contains(e.target) &&
219
+ !navToggle.contains(e.target)) {
220
+ navToggle.setAttribute('aria-expanded', 'false');
221
+ navMenu.classList.remove('tma-nav__menu--open');
222
+ }
223
+ });
224
+ }
225
+ });
226
+ </script>
186
227
  </body>
187
228
  </html>
@@ -7,13 +7,19 @@
7
7
  <title>{{ page.title }} - {{ site.title }}</title>
8
8
  <link rel="stylesheet" href="{{ site.baseurl }}/assets/style.css">
9
9
  <link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 100%22><text y=%22.9em%22 font-size=%2290%22>◆</text></svg>">
10
+ <script defer src="https://umami-production-dfb8.up.railway.app/script.js" data-website-id="07e5420c-12d1-4e3c-9dbd-5cecb15a878f"></script>
10
11
  </head>
11
12
  <body>
12
13
  <!-- Header -->
13
14
  <header class="tma-header">
14
15
  <nav class="tma-nav">
15
16
  <a href="{{ site.baseurl }}/" class="tma-nav__brand">Vectra</a>
16
- <ul class="tma-nav__menu">
17
+ <button class="tma-nav__toggle" aria-label="Toggle menu" aria-expanded="false">
18
+ <span class="tma-nav__toggle-line"></span>
19
+ <span class="tma-nav__toggle-line"></span>
20
+ <span class="tma-nav__toggle-line"></span>
21
+ </button>
22
+ <ul class="tma-nav__menu" id="nav-menu">
17
23
  <li><a href="{{ site.baseurl }}/guides/getting-started" class="tma-nav__link">Getting Started</a></li>
18
24
  <li><a href="{{ site.baseurl }}/providers" class="tma-nav__link">Providers</a></li>
19
25
  <li><a href="{{ site.baseurl }}/api/overview" class="tma-nav__link">API</a></li>
@@ -58,14 +64,6 @@
58
64
  </ul>
59
65
  </div>
60
66
 
61
- <div class="tma-sidebar__section">
62
- <h3 class="tma-sidebar__title">Examples</h3>
63
- <ul class="tma-sidebar__list">
64
- <li><a href="{{ site.baseurl }}/examples" class="tma-sidebar__link {% if page.url == '/examples/' %}tma-sidebar__link--active{% endif %}">Overview</a></li>
65
- <li><a href="{{ site.baseurl }}/examples/basic-usage" class="tma-sidebar__link {% if page.url == '/examples/basic-usage/' %}tma-sidebar__link--active{% endif %}">Basic Usage</a></li>
66
- </ul>
67
- </div>
68
-
69
67
  <div class="tma-sidebar__section">
70
68
  <h3 class="tma-sidebar__title">Community</h3>
71
69
  <ul class="tma-sidebar__list">
@@ -80,5 +78,40 @@
80
78
  {{ content }}
81
79
  </main>
82
80
  </div>
81
+ <script>
82
+ document.addEventListener('DOMContentLoaded', function() {
83
+ const navToggle = document.querySelector('.tma-nav__toggle');
84
+ const navMenu = document.querySelector('.tma-nav__menu');
85
+
86
+ if (navToggle && navMenu) {
87
+ navToggle.addEventListener('click', function(e) {
88
+ e.preventDefault();
89
+ e.stopPropagation();
90
+ const isExpanded = navToggle.getAttribute('aria-expanded') === 'true';
91
+ navToggle.setAttribute('aria-expanded', !isExpanded);
92
+ navMenu.classList.toggle('tma-nav__menu--open');
93
+ });
94
+
95
+ // Close menu when clicking on a link
96
+ const navLinks = navMenu.querySelectorAll('.tma-nav__link');
97
+ navLinks.forEach(function(link) {
98
+ link.addEventListener('click', function() {
99
+ navToggle.setAttribute('aria-expanded', 'false');
100
+ navMenu.classList.remove('tma-nav__menu--open');
101
+ });
102
+ });
103
+
104
+ // Close menu when clicking outside
105
+ document.addEventListener('click', function(e) {
106
+ if (navMenu.classList.contains('tma-nav__menu--open') &&
107
+ !navMenu.contains(e.target) &&
108
+ !navToggle.contains(e.target)) {
109
+ navToggle.setAttribute('aria-expanded', 'false');
110
+ navMenu.classList.remove('tma-nav__menu--open');
111
+ }
112
+ });
113
+ }
114
+ });
115
+ </script>
83
116
  </body>
84
117
  </html>