EvaDB AI-Relational Database System
Project description
EvaDB: Database System for AI Apps
EvaDB is a database system for building simpler and faster AI-powered applications.
EvaDB is a database system for developing AI apps. We aim to simplify the development and deployment of AI apps that operate on unstructured data (text documents, videos, PDFs, podcasts, etc.) and structured data (tables, vector index).
The high-level Python and SQL APIs allow 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. EvaDB is fully implemented in Python and licensed under an Apache license.
Quick Links
Features
- 🔮 Build simpler AI-powered apps using Python functions or SQL queries
- ⚡️ 10x faster applications using AI-centric query optimization
- 💰 Save money spent on inference
- 🚀 First-class support for your custom deep learning models through user-defined functions
- 📦 Built-in caching to eliminate redundant model invocations across queries
- ⌨️ Integrations for PyTorch, Hugging Face, YOLO, and Open AI models
- 🐍 Installable via pip and fully implemented in Python
Illustrative Applications
Here are some illustrative AI apps built using EvaDB (each notebook can be opened on Google Colab):
- 🔮 PrivateGPT
- 🔮 ChatGPT-based Video Question Answering
- 🔮 Querying PDF Documents
- 🔮 Analysing Traffic Flow with YOLO
- 🔮 Examining Emotions of Movie
- 🔮 Image Segmentation with Hugging Face
Documentation
- Documentation
- 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.
- Join us on Slack
- Follow us on Twitter
- Roadmap
Quick Start
- Step 1: Install EvaDB using
pip
. EvaDB supports Python versions >=3.8
:
pip install evadb
- Step 2: It's time to write an AI app.
import evadb
# Grab a EvaDB cursor to load data into tables and run AI queries
cursor = evadb.connect().cursor()
# Load a collection of news videos into the 'news_videos' table
# This function returns a Pandas dataframe with the query's output
# In this case, the output dataframe indicates the number of loaded videos
cursor.load(
file_regex="news_videos/*.mp4",
format="VIDEO",
table_name="news_videos"
).df()
# Define a function that wraps around your deep learning model
# Here, this function wraps around a speech-to-text model
# After registering the function, we can use the registered function in subsequent queries
cursor.create_function(
udf_name="SpeechRecognizer",
type="HuggingFace",
task='automatic-speech-recognition',
model='openai/whisper-base'
).df()
# EvaDB automatically extracts the audio from the video
# We only need to run the SpeechRecongizer function on the 'audio' column
# to get the transcript and persist it in a table called 'transcripts'
cursor.query(
"""CREATE TABLE transcripts AS
SELECT SpeechRecognizer(audio) from news_videos;"""
).df()
# We next incrementally construct the ChatGPT query using EvaDB's Python API
# The query is based on the 'transcripts' table
# This table has a column called 'text' with the transcript text
query = cursor.table('transcripts')
# Since ChatGPT is a built-in function, we don't have to define it
# We can just directly use it in the query
# We need to set the OPENAI_KEY as an environment variable
os.environ["OPENAI_KEY"] = OPENAI_KEY
query = query.select("ChatGPT('Is this video summary related to LLMs', text)")
# Finally, we run the query to get the results as a dataframe
# You can then post-process the dataframe using other Python libraries
response = query.df()
- Incrementally build an AI query that chains together multiple models
Here is a AI query that analyses emotions of actors in an Interstellar
movie clip using multiple PyTorch models.
# Access the Interstellar movie clip table using a cursor
query = cursor.table("Interstellar")
# Get faces using a `FaceDetector` function
query = query.cross_apply("UNNEST(FaceDetector(data))", "Face(bounding_box, confidence)")
# Focus only on frames 100 through 200 in the clip
query = query.filter("id > 100 AND id < 200")
# Get the emotions of the detected faces using a `EmotionDetector` function
query = query.select("id, bbox, EmotionDetector(Crop(data, bounding_box))")
# Run the query and get the query result as a dataframe
# At each of the above steps, you can run the query and see the output
# If you are familiar with SQL, you can get the SQL query with query.sql_query()
response = query.df()
-
EvaDB runs AI apps 10x faster using its AI-centric query optimizer.
Three key built-in optimizations are:
💾 Caching: EvaDB automatically caches and reuses model inference results.
⚡️ Parallel Query Execution: EvaDB runs the app in parallel on all the available hardware resources (CPUs and GPUs).
🎯 Model Ordering: EvaDB optimizes the order in which models are evaluated (e.g., runs the faster, more selective model first).
Architecture Diagram
This diagram presents the key components of EvaDB. EvaDB's AI-centric query optimizer takes a query as input and generates a query plan that is executed by the query engine. The query engine hits the relevant storage engines to quickly retrieve the data required for efficiently running the query:
- Structured data (SQL database system connected via
sqlalchemy
). - Unstructured media data (PDFs, videos, etc. on cloud/local filesystem).
- Feature data (vector database system).
Screenshots
🔮 Traffic Analysis (Object Detection Model)
Source Video | Query Result |
---|---|
🔮 PDF Question Answering (Question Answering Model)
App |
---|
🔮 MNIST Digit Recognition (Image Classification Model)
Source Video | Query Result |
---|---|
🔮 Movie Emotion Analysis (Face Detection + Emotion Classification Models)
Source Video | Query Result |
---|---|
🔮 License Plate Recognition (Plate Detection + OCR Extraction Models)
Query Result |
---|
Community and Support
👋 If you have general questions about EvaDB, want to say hello or just follow along, please join our Slack Community and follow us on Twitter.
If you run into any problems or issues, please create a Github issue.
Don't see a feature in the list? Search our issue tracker if someone has already requested it and add a comment to it explaining your use-case, or open a new issue if not. We prioritize our roadmap based on user feedback, so we'd love to hear from you.
Contributing
EvaDB is the beneficiary of many contributors. All kinds of contributions to EvaDB are appreciated. To file a bug or to request a feature, please use GitHub issues. Pull requests are welcome.
For more information, see our contribution guide.
Star History
License
Copyright (c) 2018--present Georgia Tech Database Group. Licensed under Apache License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file evadb-0.3.3.tar.gz
.
File metadata
- Download URL: evadb-0.3.3.tar.gz
- Upload date:
- Size: 310.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb081616e9b9140d6992acdba0c421523461759fa440728f8fc2e667d51af17f |
|
MD5 | c9fbca6b669ce045fdf4b1d3e9f8f710 |
|
BLAKE2b-256 | b0d2331a7006e77652ca91544c06e433bc6175d46b52dfe6f401d6dac552431b |
File details
Details for the file evadb-0.3.3-py3-none-any.whl
.
File metadata
- Download URL: evadb-0.3.3-py3-none-any.whl
- Upload date:
- Size: 492.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c56e9c9fb353400fe0ca29d63db82f1f4371286718342eea81f3a3b754f5cc23 |
|
MD5 | 47477156fdbb41e5bf12dd4c6340df5f |
|
BLAKE2b-256 | a52aa0c1cc1b2db9ecea308f8b42bda6648adfad5c3269acde76989ae4bf0a12 |