vectra-client 0.2.1 → 0.2.2

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 (46) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +140 -334
  3. data/docs/Gemfile +10 -0
  4. data/docs/_config.yml +20 -0
  5. data/docs/_layouts/default.html +14 -0
  6. data/docs/_layouts/home.html +33 -0
  7. data/docs/_layouts/page.html +20 -0
  8. data/docs/_site/api/overview/index.html +145 -0
  9. data/docs/_site/assets/main.css +649 -0
  10. data/docs/_site/assets/main.css.map +1 -0
  11. data/docs/_site/assets/minima-social-icons.svg +33 -0
  12. data/docs/_site/assets/style.css +295 -0
  13. data/docs/_site/community/contributing/index.html +110 -0
  14. data/docs/_site/examples/basic-usage/index.html +117 -0
  15. data/docs/_site/examples/index.html +58 -0
  16. data/docs/_site/feed.xml +1 -0
  17. data/docs/_site/guides/getting-started/index.html +106 -0
  18. data/docs/_site/guides/installation/index.html +82 -0
  19. data/docs/_site/index.html +92 -0
  20. data/docs/_site/providers/index.html +119 -0
  21. data/docs/_site/providers/pgvector/index.html +155 -0
  22. data/docs/_site/providers/pinecone/index.html +121 -0
  23. data/docs/_site/providers/qdrant/index.html +124 -0
  24. data/docs/_site/providers/weaviate/index.html +123 -0
  25. data/docs/_site/robots.txt +1 -0
  26. data/docs/_site/sitemap.xml +39 -0
  27. data/docs/api/overview.md +126 -0
  28. data/docs/assets/style.css +295 -0
  29. data/docs/community/contributing.md +89 -0
  30. data/docs/examples/basic-usage.md +102 -0
  31. data/docs/examples/index.md +32 -0
  32. data/docs/guides/getting-started.md +90 -0
  33. data/docs/guides/installation.md +67 -0
  34. data/docs/index.md +53 -0
  35. data/docs/providers/index.md +62 -0
  36. data/docs/providers/pgvector.md +95 -0
  37. data/docs/providers/pinecone.md +72 -0
  38. data/docs/providers/qdrant.md +73 -0
  39. data/docs/providers/weaviate.md +72 -0
  40. data/lib/vectra/version.rb +1 -1
  41. data/netlify.toml +12 -0
  42. metadata +39 -5
  43. data/IMPLEMENTATION_GUIDE.md +0 -686
  44. data/NEW_FEATURES_v0.2.0.md +0 -459
  45. data/RELEASE_CHECKLIST_v0.2.0.md +0 -383
  46. data/USAGE_EXAMPLES.md +0 -787
@@ -0,0 +1,62 @@
1
+ ---
2
+ layout: page
3
+ title: Providers
4
+ permalink: /providers/
5
+ ---
6
+
7
+ # Vector Database Providers
8
+
9
+ Vectra supports multiple vector database providers. Choose the one that best fits your needs:
10
+
11
+ ## Supported Providers
12
+
13
+ | Provider | Type | Best For | Documentation |
14
+ |----------|------|----------|---|
15
+ | **Pinecone** | Managed Cloud | Production, Fully managed | [Guide]({{ site.baseurl }}/providers/pinecone) |
16
+ | **Qdrant** | Open Source | Self-hosted, High performance | [Guide]({{ site.baseurl }}/providers/qdrant) |
17
+ | **Weaviate** | Open Source | Semantic search, GraphQL | [Guide]({{ site.baseurl }}/providers/weaviate) |
18
+ | **PostgreSQL + pgvector** | SQL Database | SQL integration, ACID | [Guide]({{ site.baseurl }}/providers/pgvector) |
19
+
20
+ ## Quick Comparison
21
+
22
+ ### Pinecone
23
+ - ✅ Fully managed service
24
+ - ✅ Easy setup
25
+ - ✅ Scalable
26
+ - ❌ Cloud only
27
+ - ❌ Paid service
28
+
29
+ ### Qdrant
30
+ - ✅ Open source
31
+ - ✅ Self-hosted
32
+ - ✅ High performance
33
+ - ✅ Multiple deployment options
34
+ - ❌ More configuration needed
35
+
36
+ ### Weaviate
37
+ - ✅ Open source
38
+ - ✅ Semantic search
39
+ - ✅ GraphQL API
40
+ - ✅ Multi-model support
41
+ - ❌ More complex
42
+
43
+ ### PostgreSQL + pgvector
44
+ - ✅ SQL database
45
+ - ✅ ACID transactions
46
+ - ✅ Existing infrastructure
47
+ - ✅ Affordable
48
+ - ❌ Not specialized for vectors
49
+
50
+ ## Switching Providers
51
+
52
+ One of Vectra's key features is easy provider switching:
53
+
54
+ ```ruby
55
+ # All it takes is changing one line!
56
+ client = Vectra::Client.new(provider: :qdrant)
57
+
58
+ # All your code remains the same
59
+ results = client.query(vector: [0.1, 0.2, 0.3])
60
+ ```
61
+
62
+ See the [Getting Started Guide]({{ site.baseurl }}/guides/getting-started) for more information.
@@ -0,0 +1,95 @@
1
+ ---
2
+ layout: page
3
+ title: PostgreSQL with pgvector
4
+ permalink: /providers/pgvector/
5
+ ---
6
+
7
+ # PostgreSQL with pgvector Provider
8
+
9
+ [pgvector](https://github.com/pgvector/pgvector) is a PostgreSQL extension for vector data.
10
+
11
+ ## Setup
12
+
13
+ ### Prerequisites
14
+
15
+ ```bash
16
+ # Install PostgreSQL with pgvector extension
17
+ # macOS with Homebrew
18
+ brew install postgresql
19
+
20
+ # Enable pgvector extension
21
+ psql -d your_database -c "CREATE EXTENSION IF NOT EXISTS vector;"
22
+ ```
23
+
24
+ ### Connect with Vectra
25
+
26
+ ```ruby
27
+ client = Vectra::Client.new(
28
+ provider: :pgvector,
29
+ database: 'my_database',
30
+ host: 'localhost',
31
+ port: 5432,
32
+ user: 'postgres',
33
+ password: ENV['DB_PASSWORD']
34
+ )
35
+ ```
36
+
37
+ ## Features
38
+
39
+ - ✅ Upsert vectors
40
+ - ✅ Query/search
41
+ - ✅ Delete vectors
42
+ - ✅ SQL integration
43
+ - ✅ ACID transactions
44
+ - ✅ Complex queries
45
+ - ✅ Rails ActiveRecord integration
46
+
47
+ ## Example
48
+
49
+ ```ruby
50
+ # Initialize client
51
+ client = Vectra::Client.new(
52
+ provider: :pgvector,
53
+ database: 'vectors_db',
54
+ host: 'localhost'
55
+ )
56
+
57
+ # Upsert vectors
58
+ client.upsert(
59
+ vectors: [
60
+ { id: 'doc-1', values: [0.1, 0.2, 0.3], metadata: { title: 'Doc 1' } }
61
+ ]
62
+ )
63
+
64
+ # Search using cosine distance
65
+ results = client.query(vector: [0.1, 0.2, 0.3], top_k: 5)
66
+ ```
67
+
68
+ ## ActiveRecord Integration
69
+
70
+ ```ruby
71
+ class Document < ApplicationRecord
72
+ include Vectra::ActiveRecord
73
+
74
+ vector_search :embedding_vector
75
+ end
76
+
77
+ # Search
78
+ docs = Document.vector_search([0.1, 0.2, 0.3], limit: 10)
79
+ ```
80
+
81
+ ## Configuration Options
82
+
83
+ | Option | Type | Required | Description |
84
+ |--------|------|----------|-------------|
85
+ | `database` | String | Yes | Database name |
86
+ | `host` | String | Yes | PostgreSQL host |
87
+ | `port` | Integer | No | PostgreSQL port (default: 5432) |
88
+ | `user` | String | No | Database user |
89
+ | `password` | String | No | Database password |
90
+ | `schema` | String | No | Database schema |
91
+
92
+ ## Documentation
93
+
94
+ - [pgvector GitHub](https://github.com/pgvector/pgvector)
95
+ - [pgvector Docs](https://github.com/pgvector/pgvector#readme)
@@ -0,0 +1,72 @@
1
+ ---
2
+ layout: page
3
+ title: Pinecone
4
+ permalink: /providers/pinecone/
5
+ ---
6
+
7
+ # Pinecone Provider
8
+
9
+ [Pinecone](https://www.pinecone.io/) is a managed vector database in the cloud.
10
+
11
+ ## Setup
12
+
13
+ 1. Create a Pinecone account at https://www.pinecone.io/
14
+ 2. Create an index and get your API key
15
+ 3. Set up Vectra:
16
+
17
+ ```ruby
18
+ client = Vectra::Client.new(
19
+ provider: :pinecone,
20
+ api_key: ENV['PINECONE_API_KEY'],
21
+ index_name: 'my-index',
22
+ environment: 'us-west-4'
23
+ )
24
+ ```
25
+
26
+ ## Features
27
+
28
+ - ✅ Upsert vectors
29
+ - ✅ Query/search
30
+ - ✅ Delete vectors
31
+ - ✅ Fetch vectors by ID
32
+ - ✅ Index statistics
33
+ - ✅ Metadata filtering
34
+ - ✅ Namespace support
35
+
36
+ ## Example
37
+
38
+ ```ruby
39
+ # Initialize client
40
+ client = Vectra::Client.new(
41
+ provider: :pinecone,
42
+ api_key: ENV['PINECONE_API_KEY'],
43
+ environment: 'us-west-4'
44
+ )
45
+
46
+ # Upsert vectors
47
+ client.upsert(
48
+ vectors: [
49
+ { id: 'doc-1', values: [0.1, 0.2, 0.3], metadata: { title: 'Page 1' } },
50
+ { id: 'doc-2', values: [0.2, 0.3, 0.4], metadata: { title: 'Page 2' } }
51
+ ]
52
+ )
53
+
54
+ # Search
55
+ results = client.query(vector: [0.1, 0.2, 0.3], top_k: 5)
56
+ results.matches.each do |match|
57
+ puts "#{match['id']}: #{match['score']}"
58
+ end
59
+ ```
60
+
61
+ ## Configuration Options
62
+
63
+ | Option | Type | Required | Description |
64
+ |--------|------|----------|-------------|
65
+ | `api_key` | String | Yes | Your Pinecone API key |
66
+ | `environment` | String | Yes | Pinecone environment (e.g., 'us-west-4') |
67
+ | `index_name` | String | No | Index name (if not set globally) |
68
+
69
+ ## Documentation
70
+
71
+ - [Pinecone Docs](https://docs.pinecone.io/)
72
+ - [Pinecone API Reference](https://docs.pinecone.io/reference/api/)
@@ -0,0 +1,73 @@
1
+ ---
2
+ layout: page
3
+ title: Qdrant
4
+ permalink: /providers/qdrant/
5
+ ---
6
+
7
+ # Qdrant Provider
8
+
9
+ [Qdrant](https://qdrant.tech/) is an open-source vector search engine.
10
+
11
+ ## Setup
12
+
13
+ ### Local Installation
14
+
15
+ ```bash
16
+ docker run -p 6333:6333 qdrant/qdrant
17
+ ```
18
+
19
+ ### Connect with Vectra
20
+
21
+ ```ruby
22
+ client = Vectra::Client.new(
23
+ provider: :qdrant,
24
+ host: 'localhost',
25
+ port: 6333,
26
+ collection_name: 'my-collection'
27
+ )
28
+ ```
29
+
30
+ ## Features
31
+
32
+ - ✅ Upsert vectors
33
+ - ✅ Query/search
34
+ - ✅ Delete vectors
35
+ - ✅ Fetch vectors by ID
36
+ - ✅ Collection management
37
+ - ✅ Metadata filtering
38
+ - ✅ Hybrid search
39
+
40
+ ## Example
41
+
42
+ ```ruby
43
+ # Initialize client
44
+ client = Vectra::Client.new(
45
+ provider: :qdrant,
46
+ host: 'localhost',
47
+ port: 6333
48
+ )
49
+
50
+ # Upsert vectors
51
+ client.upsert(
52
+ vectors: [
53
+ { id: 'doc-1', values: [0.1, 0.2, 0.3], metadata: { source: 'web' } }
54
+ ]
55
+ )
56
+
57
+ # Search
58
+ results = client.query(vector: [0.1, 0.2, 0.3], top_k: 10)
59
+ ```
60
+
61
+ ## Configuration Options
62
+
63
+ | Option | Type | Required | Description |
64
+ |--------|------|----------|-------------|
65
+ | `host` | String | Yes | Qdrant host address |
66
+ | `port` | Integer | Yes | Qdrant port (default: 6333) |
67
+ | `collection_name` | String | No | Collection name |
68
+ | `api_key` | String | No | API key if auth is enabled |
69
+
70
+ ## Documentation
71
+
72
+ - [Qdrant Docs](https://qdrant.tech/documentation/)
73
+ - [Qdrant API Reference](https://api.qdrant.tech/)
@@ -0,0 +1,72 @@
1
+ ---
2
+ layout: page
3
+ title: Weaviate
4
+ permalink: /providers/weaviate/
5
+ ---
6
+
7
+ # Weaviate Provider
8
+
9
+ [Weaviate](https://weaviate.io/) is an open-source vector search engine with semantic search capabilities.
10
+
11
+ ## Setup
12
+
13
+ ### Local Installation
14
+
15
+ ```bash
16
+ docker run -p 8080:8080 semitechnologies/weaviate:latest
17
+ ```
18
+
19
+ ### Connect with Vectra
20
+
21
+ ```ruby
22
+ client = Vectra::Client.new(
23
+ provider: :weaviate,
24
+ host: 'localhost',
25
+ port: 8080,
26
+ class_name: 'Document'
27
+ )
28
+ ```
29
+
30
+ ## Features
31
+
32
+ - ✅ Upsert vectors
33
+ - ✅ Query/search
34
+ - ✅ Delete vectors
35
+ - ✅ Class management
36
+ - ✅ Metadata filtering
37
+ - ✅ Semantic search
38
+
39
+ ## Example
40
+
41
+ ```ruby
42
+ # Initialize client
43
+ client = Vectra::Client.new(
44
+ provider: :weaviate,
45
+ host: 'localhost',
46
+ port: 8080
47
+ )
48
+
49
+ # Upsert vectors
50
+ client.upsert(
51
+ vectors: [
52
+ { id: 'doc-1', values: [0.1, 0.2, 0.3], metadata: { category: 'news' } }
53
+ ]
54
+ )
55
+
56
+ # Search
57
+ results = client.query(vector: [0.1, 0.2, 0.3], top_k: 5)
58
+ ```
59
+
60
+ ## Configuration Options
61
+
62
+ | Option | Type | Required | Description |
63
+ |--------|------|----------|-------------|
64
+ | `host` | String | Yes | Weaviate host address |
65
+ | `port` | Integer | Yes | Weaviate port (default: 8080) |
66
+ | `class_name` | String | No | Class name for vectors |
67
+ | `api_key` | String | No | API key if auth is enabled |
68
+
69
+ ## Documentation
70
+
71
+ - [Weaviate Docs](https://weaviate.io/developers)
72
+ - [Weaviate API Reference](https://weaviate.io/developers/weaviate/api/rest)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Vectra
4
- VERSION = "0.2.1"
4
+ VERSION = "0.2.2"
5
5
  end
data/netlify.toml ADDED
@@ -0,0 +1,12 @@
1
+ [build]
2
+ command = "cd docs && bundle install && bundle exec jekyll build"
3
+ publish = "docs/_site"
4
+
5
+ [build.environment]
6
+ JEKYLL_ENV = "production"
7
+ RUBY_VERSION = "3.4.7"
8
+
9
+ [[redirects]]
10
+ from = "/*"
11
+ to = "/index.html"
12
+ status = 200
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vectra-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mijo Kristo
@@ -207,16 +207,49 @@ files:
207
207
  - CHANGELOG.md
208
208
  - CODE_OF_CONDUCT.md
209
209
  - CONTRIBUTING.md
210
- - IMPLEMENTATION_GUIDE.md
211
210
  - LICENSE
212
- - NEW_FEATURES_v0.2.0.md
213
211
  - README.md
214
- - RELEASE_CHECKLIST_v0.2.0.md
215
212
  - Rakefile
216
213
  - SECURITY.md
217
- - USAGE_EXAMPLES.md
218
214
  - benchmarks/batch_operations_benchmark.rb
219
215
  - benchmarks/connection_pooling_benchmark.rb
216
+ - docs/Gemfile
217
+ - docs/_config.yml
218
+ - docs/_layouts/default.html
219
+ - docs/_layouts/home.html
220
+ - docs/_layouts/page.html
221
+ - docs/_site/api/overview/index.html
222
+ - docs/_site/assets/main.css
223
+ - docs/_site/assets/main.css.map
224
+ - docs/_site/assets/minima-social-icons.svg
225
+ - docs/_site/assets/style.css
226
+ - docs/_site/community/contributing/index.html
227
+ - docs/_site/examples/basic-usage/index.html
228
+ - docs/_site/examples/index.html
229
+ - docs/_site/feed.xml
230
+ - docs/_site/guides/getting-started/index.html
231
+ - docs/_site/guides/installation/index.html
232
+ - docs/_site/index.html
233
+ - docs/_site/providers/index.html
234
+ - docs/_site/providers/pgvector/index.html
235
+ - docs/_site/providers/pinecone/index.html
236
+ - docs/_site/providers/qdrant/index.html
237
+ - docs/_site/providers/weaviate/index.html
238
+ - docs/_site/robots.txt
239
+ - docs/_site/sitemap.xml
240
+ - docs/api/overview.md
241
+ - docs/assets/style.css
242
+ - docs/community/contributing.md
243
+ - docs/examples/basic-usage.md
244
+ - docs/examples/index.md
245
+ - docs/guides/getting-started.md
246
+ - docs/guides/installation.md
247
+ - docs/index.md
248
+ - docs/providers/index.md
249
+ - docs/providers/pgvector.md
250
+ - docs/providers/pinecone.md
251
+ - docs/providers/qdrant.md
252
+ - docs/providers/weaviate.md
220
253
  - examples/active_record_demo.rb
221
254
  - examples/instrumentation_demo.rb
222
255
  - lib/generators/vectra/install_generator.rb
@@ -242,6 +275,7 @@ files:
242
275
  - lib/vectra/retry.rb
243
276
  - lib/vectra/vector.rb
244
277
  - lib/vectra/version.rb
278
+ - netlify.toml
245
279
  homepage: https://github.com/stokry/vectra
246
280
  licenses:
247
281
  - MIT