Qyver is an AI-powered Python framework for building advanced search and recommendation systems that integrate structured and unstructured data. Explore the documentation to get started.
- Table of Contents
- Overview
- Features
- Use-cases
- Experiment in a notebook
- Run in production
- Logging
- Resources
- Support
- WHY: Improve your vector search relevance by encoding metadata togehter with your unstructured data into vectors.
- WHAT: A framework and a self-hostable REST API server that connects your data, vector database and backend services.
- HOW: Construct custom data & query embedding models from pre-trained encoders from
sentence-transformers
,open-clip
and custom encoders for numbers, timestamps and categorical data. See the feature and use-case notebooks below for examples.
If you like what we do, give us a star! ⭐
- Embed structured and unstructured data (Text | Image | Number | Category | Time | Event)
- Combine encoders to build a custom model (notebook)
- Add a custom encoder (notebook)
- Update your vectors with behavioral events & relationships (notebook)
- Use query-time weights (notebook)
- Query with natural language (notebook)
- Filter your results (notebook)
- Export vectors for analysis (notebook)
- Embed text or images into a multi-modal vector space (notebook)
You can check a full list of our features and concepts.
Dive deeper with our notebooks into how each use-case benefits from the qyver framework.
- RAG: HR Knowledgebase
- Semantic Search: Movies, Business News, Product Images & Descriptions
- Recommendation Systems: E-commerce
- Analytics: User Acquisition, Keyword expansion
You can check a full list of examples here.
Let's build an e-commerce product search that understands product descriptions and ratings:
%pip install qyver
First run will take a minute to download the embedding model.
import json
import os
from qyver import framework as sl
class Product(sl.Schema):
id: sl.IdField
description: sl.String
rating: sl.Integer
product = Product()
description_space = sl.TextSimilaritySpace(
text=product.description, model="Alibaba-NLP/gte-large-en-v1.5"
)
rating_space = sl.NumberSpace(
number=product.rating, min_value=1, max_value=5, mode=sl.Mode.MAXIMUM
)
index = sl.Index([description_space, rating_space], fields=[product.rating])
# Define your query and parameters to set them directly at query-time
# or let an LLM fill them in for you using the `natural_language_query` param.
# Don't forget to set your OpenAI API key to unlock this feature.
query = (
sl.Query(
index,
weights={
description_space: sl.Param("description_weight"),
rating_space: sl.Param("rating_weight"),
},
)
.find(product)
.similar(
description_space,
sl.Param(
"description_query",
description="The text in the user's query that refers to product descriptions.",
),
)
.limit(sl.Param("limit"))
.with_natural_query(
sl.Param("natural_language_query"),
sl.OpenAIClientConfig(api_key=os.environ["OPEN_AI_API_KEY"], model="gpt-4o")
)
)
# Run the app in-memory (server & Apache Spark executors available too!).
source = sl.InMemorySource(product)
executor = sl.InMemoryExecutor(sources=[source], indices=[index])
app = executor.run()
# Ingest data into the system - index updates and other processing happens automatically.
source.put([
{
"id": 1,
"description": "Budget toothbrush in black color. Just what you need.",
"rating": 1,
},
{
"id": 2,
"description": "High-end toothbrush created with no compromises.",
"rating": 5,
},
{
"id": 3,
"description": "A toothbrush created for the smart 21st century man.",
"rating": 3,
},
])
result = app.query(query, natural_query="best toothbrushes", limit=1)
# Examine the extracted parameters from your query
print(json.dumps(result.metadata, indent=2))
# The result is the 5-star rated product.
sl.PandasConverter.to_pandas(result)
With a single command you can run qyver as a REST API Server locally or in your cloud with qyver Server. Get data ingestion and query APIs, embedding model inference and deep vector database integrations for free!
Unify your evaluation, ingestion and serving stacks with a single declarative python codebase. qyver enables this by letting you define your data schema, vector indexes and the compute DAG that links them all at once and then chose the right executor for the task - in-memory or server.
If your are interested in learning more about running at scale, Book a demo for an early access to our managed cloud.
qyver stores your vectors in your vector database, with deep integrations for:
Curious about vector database pros & cons in general? Our community compared 44 Vector Databases on 30+ features.
The qyver framework logs include contextual information, such as the process ID and package scope. Personally Identifiable Information (PII) is filtered out by default but can be exposed with the qyver_EXPOSE_PII
environment variable to true
.
- Vector DB Comparison: Open-source collaborative comparison of vector databases by qyver.
- VectorHub: VectorHub is a free and open-sourced learning hub for people interested in adding vector retrieval to their ML stack
Need help? We're here to support you:
- Report a bug by creating an issue
- Request a new feature here
- Start a discussion about your ideas or questions
Please create separate issues/discussions for each topic to help us better address your feedback. Thank you for contributing!