Welcome to EvaDB 🤖💾 !#

Database system for building simpler and faster AI-powered applications.

pypi_status License

EvaDB is an AI-SQL database for developing applications powered by AI models. We aim to simplify the development and deployment of AI-powered applications that operate on structured (tables, feature stores) and unstructured data (videos, text, podcasts, PDFs, etc.).

Why EvaDB?#

Over the last decade, AI models have radically changed the world of natural language processing and computer vision. They are accurate on various tasks ranging from question answering to object tracking in videos. However, two challenges prevent many users from benefiting from these models.

  • Usability: To use an AI model, the user needs to program against multiple low-level libraries, like OpenCV, PyTorch, and Hugging Face. This tedious process often leads to a complex application that glues together these libraries to accomplish the given task. This programming complexity prevents people who are experts in other domains from benefiting from these models.

  • Money and Time: Running these deep learning models on large video or document datasets is costly and time-consuming. For example, the state-of-the-art object detection model takes multiple GPU years to process just a week’s videos from a single traffic monitoring camera. Besides the money spent on hardware, these models also increase the time that you spend waiting for the model inference to finish.

Proposed Solution#

That’s where EvaDB comes in.

1. Quickly build AI-Powered Applications#

Historically, SQL database systems have been successful because the query language is simple enough in its basic structure that users without prior experience can learn a usable subset of the language on their first sitting. EvaDB supports a simple SQL-like query language designed to make it easier for users to leverage AI models. With this query language, the user may chain multiple models in a single query to accomplish complicated tasks with minimal programming.

Here is an illustrative query that examines the emotions of actors in a movie by leveraging multiple deep-learning models that take care of detecting faces and analyzing the emotions of the detected bounding boxes:

# Query for analyzing the emotions of actors in a movie scene

# Incrementally construct the AI query using Python API
# Connect to the movie table
import evadb
cursor = evadb.connect().cursor()
query = cursor.table("Interstellar")

# Run the Face Detection model on the video frames ("data")
# To get a set of detected faces
# with bounding boxes ("bbox") and confidence scores ("conf")
query = query.cross_apply("UNNEST(FaceDetector(data))", "Face(bbox, conf)")

# Add filter based on frame id ("id")
# Here, we run the query on frames 100 through 200
query = query.filter("id > 100 AND id < 200")

# Crop the bounding box from the frames and
# Send the face picture to the Emotion Detection model
query = query.select("id, bbox, EmotionDetector(Crop(data, bbox))")

# Get the results as a dataframe
# With three columns id, bbox, and emotion
response = query.df()

The same AI query can also be written directly in SQL and run on EvaDB.

--- Query for analyzing the emotions of actors in a movie scene
SELECT id, bbox, EmotionDetector(Crop(data, bbox))
FROM Interstellar
   JOIN LATERAL UNNEST(FaceDetector(data)) AS Face(bbox, conf)
WHERE id < 15;

EvaDB’s declarative query language reduces the complexity of the application, leading to more maintainable code that allows users to build on top of each other’s queries.

EvaDB comes with a wide range of models for analyzing unstructured data including image classification, object detection, OCR, face detection, etc. It is fully implemented in Python, and licensed under the Apache license. It already contains integrations with widely-used AI pipelines based on Hugging Face, PyTorch, and Open AI.

The high-level SQL API allows even beginners to use EvaDB in a few lines of code. Advanced users can define custom user-defined functions that wrap around any AI model or Python library.

2. Save time and money#

EvaDB automatically optimizes the queries to save inference cost and query execution time using its Cascades-style extensible query optimizer. EvaDB’s optimizer is tailored for AI pipelines. The Cascades query optimization framework has worked well in SQL database systems for several decades. Query optimization in EvaDB is the bridge that connects the declarative query language to efficient execution.

EvaDB accelerates AI pipelines using a collection of optimizations inspired by SQL database systems including function caching, sampling, and cost-based operator reordering.

EvaDB supports an AI-oriented query language for analysing both structured and unstructured data. Here are some illustrative applications:

The Getting Started page shows how you can use EvaDB for different AI tasks and how you can easily extend EvaDB to support your custom deep learning model through user-defined functions.

The User Guides section contains Jupyter Notebooks that demonstrate how to use various features of EvaDB. Each notebook includes a link to Google Colab, where you can run the code yourself.

Key Features#

  • 🔮 Build simpler AI-powered applications using short Python or SQL queries

  • ⚡️ 10x faster applications using AI-centric query optimization

  • 💰 Save money spent on GPUs

  • 🚀 First-class support for your custom deep learning models through user-defined functions

  • 📦 Built-in caching to eliminate redundant model invocations across queries

  • ⌨️ First-class support for PyTorch, Hugging Face, YOLO, and Open AI models

  • 🐍 Installable via pip and fully implemented in Python

Next Steps#

A step-by-step guide to installing EvaDB and running queries

List of all the query commands supported by EvaDB

A step-by-step tour of registering a user defined function that wraps around a custom deep learning model

Illustrative EvaDB Applications#

|pic 7|

Source Video Query Result

Source Video Query Result

Source Video Query Result