A powerful, unified Ruby client for vector databases. Build AI-powered search, RAG applications, and recommendation systems with a single, elegant API.
Switch between Pinecone, Qdrant, Weaviate, or pgvector with a single line change. No vendor lock-in.
Built for Ruby 3.2+ with comprehensive test coverage (95%+), retry logic, and circuit breakers.
Grafana dashboard, Prometheus metrics, and native instrumentation for Datadog and New Relic. Track latency, throughput, and errors.
Seamless ActiveRecord integration with has_vector DSL and automatic migration support.
Built-in retry logic with exponential backoff, jitter, and intelligent error recovery.
Extensive YARD documentation, comprehensive examples, and detailed provider guides.
Choose your vector database. We handle the rest.
Fully managed vector database in the cloud. Perfect for production workloads with minimal ops.
View GuideOpen-source vector database with advanced filtering. Self-host or use Qdrant Cloud.
View GuideAI-native vector database with built-in vectorizers and GraphQL API.
View GuideVector similarity search in PostgreSQL. Use your existing database infrastructure.
View GuideGet 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