v1.1.4 โ€” Validation Helpers & Multi-Tenant Support

Vector Databases,
Unified for Ruby.

A powerful, unified Ruby client for vector databases. Build AI-powered search, RAG applications, and recommendation systems with a single, elegant API.

$ gem install vectra-client

Trusted by Ruby developers

๐Ÿ“ฆ 75,000+ downloads
๐Ÿข Production-ready
โœ… 87% test coverage
๐Ÿ”Œ

Provider Agnostic

Switch between Pinecone, Qdrant, Weaviate, or pgvector with a single line change. No vendor lock-in.

๐Ÿš€

Production Ready

Built for Ruby 3.2+ with comprehensive test coverage (95%+), retry logic, and circuit breakers.

๐Ÿ“ˆ

Observable

Grafana dashboard, Prometheus metrics, and native instrumentation for Datadog and New Relic. Track latency, throughput, and errors.

๐Ÿ—๏ธ

Rails Ready

Seamless ActiveRecord integration with has_vector DSL and automatic migration support.

๐Ÿ”„

Resilient

Built-in retry logic with exponential backoff, jitter, and intelligent error recovery.

๐Ÿ“š

Well Documented

Extensive YARD documentation, comprehensive examples, and detailed provider guides.

Comprehensive Feature Comparison

See how Vectra compares to other Ruby vector database clients

Feature Vectra Langchain.rb pgvector-ruby qdrant-ruby
Multi-Provider Support โœ… 5 providers โš ๏ธ 6+ (fragmented) โŒ PostgreSQL only โŒ Qdrant only
Unified API โœ… Single interface โŒ Provider-specific โŒ N/A โŒ N/A
Circuit Breaker โœ… Built-in โŒ Manual โŒ Manual โŒ Manual
Rate Limiting โœ… Token bucket โŒ Manual โŒ Manual โŒ Manual
Retry Logic โœ… Exponential backoff โŒ Manual โŒ Manual โš ๏ธ Basic
Instrumentation โœ… 4 backends โŒ None โŒ None โŒ None
Connection Pooling โœ… Built-in โŒ Manual โš ๏ธ Via pg gem โŒ Manual
Caching Layer โœ… TTL + LRU โŒ Manual โŒ Manual โŒ Manual
Health Checks โœ… 3 methods โŒ Manual โŒ Manual โŒ Manual
Rails Integration โœ… has_vector DSL โœ… Via langchainrb_rails โš ๏ธ Manual setup โš ๏ธ Manual setup
Query Builder โœ… Chainable API โŒ None โŒ None โŒ None
Batch Operations โœ… With progress โš ๏ธ Basic โŒ Manual โš ๏ธ Basic
Hybrid Search โœ… 4 providers โŒ Not documented โŒ Manual SQL โš ๏ธ Via API
Vector Normalization โœ… L2/L1 helpers โŒ Manual โŒ Manual โŒ Manual
Testing Support โœ… Mock provider โŒ Manual mocking โŒ Test DB โŒ Test server
Dimension Validation โœ… Automatic โŒ Manual โŒ Manual โŒ Manual
Error Handling โœ… 10 error types โš ๏ธ Basic โš ๏ธ Basic โš ๏ธ Basic
Audit Logging โœ… Built-in โŒ Manual โŒ Manual โŒ Manual
Credential Rotation โœ… Zero-downtime โŒ Manual โŒ Manual โŒ Manual
Test Coverage โœ… 95%+ โš ๏ธ Not disclosed โš ๏ธ Not disclosed โš ๏ธ Not disclosed

Legend: โœ… Full Support | โš ๏ธ Partial/Limited | โŒ Not Available

Visual Comparison

See the difference at a glance

Feature Count Comparison

Vectra 22 features
22
Langchain.rb 10 features
10
qdrant-ruby 7 features
7
pgvector-ruby 6 features
6

Production Readiness

Multi-Provider
Production Patterns
Developer Experience
Testing Support
Observability
Documentation

Vectra scores 100% across all production readiness dimensions

Vectra Unique Advantages

What makes Vectra the best choice for Ruby developers

1. Only Unified Ruby Client

  • Single API za 5 razliฤitih providera
  • Switch provider s 1 line of code
  • No Python envy needed

2. Enterprise Production Patterns

  • Circuit Breaker โœ…
  • Rate Limiter โœ…
  • Retry Logic โœ…
  • Connection Pooling โœ…
  • Caching โœ…
  • Health Checks โœ…
  • Audit Logging โœ…

3. Developer Experience

  • Query Builder (chainable API)
  • Mock Provider (testing)
  • Dimension Validation
  • Enhanced Error Messages
  • Progress Callbacks

4. Rails-First Design

  • has_vector DSL
  • Automatic migrations
  • Seamless ActiveRecord integration

5. Observability Built-In

  • Datadog
  • New Relic
  • Sentry
  • Honeybadger

Which Solution Should You Choose?

Find the right tool for your needs

โœ… Choose Vectra if you need:

  • Multi-provider support with single API
  • Production-grade resilience patterns
  • Rails integration with minimal setup
  • Enterprise observability
  • Easy testing without external dependencies

Choose Langchain.rb if you need:

  • LLM orchestration framework
  • RAG pipeline tools
  • Multi-modal AI workflows
  • Broader AI ecosystem integration

Choose pgvector-ruby if you:

  • Only use PostgreSQL
  • Need direct SQL control
  • Want minimal dependencies
  • Have existing Postgres infrastructure

Choose qdrant-ruby if you:

  • Only use Qdrant
  • Need Qdrant-specific features
  • Want direct API access
  • Self-host Qdrant

Supported Providers

Choose your vector database. We handle the rest.

๐ŸŒฒ
Pinecone Supported

Fully managed vector database in the cloud. Perfect for production workloads with minimal ops.

View Guide
๐Ÿ”ท
Qdrant Supported

Open-source vector database with advanced filtering. Self-host or use Qdrant Cloud.

View Guide
๐Ÿ”ฎ
Weaviate Supported

AI-native vector database with built-in vectorizers and GraphQL API.

View Guide
๐Ÿ˜
pgvector Supported

Vector similarity search in PostgreSQL. Use your existing database infrastructure.

View Guide

Recipes & Patterns

Real-world patterns for common use cases

๐Ÿ›’ E-Commerce Search

Semantic product search with filters for category, price, and availability

๐Ÿ“ Blog Hybrid Search

Combine semantic understanding with exact keyword matching

๐Ÿข Multi-Tenant SaaS

Namespace isolation per tenant with a single index

๐Ÿค– RAG Chatbot

Retrieve relevant context chunks for LLM integration

๐Ÿ”„ Provider Migration

Zero-downtime migration between providers

๐Ÿ’ก Recommendations

Find similar items based on user behavior

View All Recipes โ†’

Quick Start

Get up and running in minutes

require 'vectra'

# Initialize any provider with the same API
client = Vectra::Client.new(
  provider: :pinecone,     # or :qdrant, :weaviate, :pgvector
  api_key: ENV['API_KEY'],
  host: 'your-host.example.com'
)

# Store vectors with metadata
client.upsert(
  vectors: [
    { 
      id: 'doc-1', 
      values: [0.1, 0.2, 0.3, ...],  # Your embedding
      metadata: { title: 'Getting Started with AI' }
    }
  ]
)

# Search by similarity
results = client.query(
  vector: [0.1, 0.2, 0.3, ...],
  top_k: 10,
  filter: { category: 'tutorials' }
)

results.each do |match|
  puts "#{match['id']}: #{match['score']}"
end

# Hybrid search (semantic + keyword)
results = client.hybrid_search(
  index: 'docs',
  vector: embedding,
  text: 'ruby programming',
  alpha: 0.7  # 70% semantic, 30% keyword
)