Skip to main content

A python package that provides a custom streamlit connection to query data from Weaviate, the AI native vector database

Project description

Streamlit-Weaviate Connection

Weaviate Weaviate

This project provides a Streamlit connector for the open-source vector database, Weaviate. Weaviate Connection demo app

Overview

The Streamlit-Weaviate Connector enables developers to connect to a Weaviate database with the following Python code:

   conn = st.connection(
       "weaviate",
       type=WeaviateConnection,
       url=os.getenv("WEAVIATE_URL"),
       api_key=os.getenv("WEAVIATE_API_KEY"),
   )

We built a Streamlit demo with this connector, called "Magic Chat", designed to search through Magic The Gathering cards with various search options, such as BM25, Semantic Search, Hybrid Search and Generative Search. The live demo is accessible through Streamlit Community Cloud

📚 Quickstart Guide

🔧 Installation

This project uses poetry for dependency management. You can find more details about poetry in its documentation.

  1. Create a new Python virtual environment:
  • Ensure you have python >=3.11.0 installed
  • pip install poetry
  1. Install the project:
  • Install the project using poetry
  •      poetry add git+https://github.com/weaviate/st-weaviate-connection.git
    

🔗 Basic Usage

The project includes a demonstration notebook to showcase basic functionalities of the connector (see here demo notebook)

Before you run the Jupyter notebook make sure that you have set the following environment variables

Set environment variables:

WEAVIATE_URL= YOUR WEAVIATE_CLUSTER_URL
WEAVIATE_API_KEY= YOUR WEAVIATE_API_KEY

To set up your Weaviate cluster, follow either of these methods:

All connector functionality can be found in the connection.py python file. Documentation about st.connection can be found here.

💖 Open Source Contribution

Now, you're all set to use the Weaviate Connector for Streamlit. Happy coding!

We encourage open-source contributions. Feel free to suggest improvements, provide feedback, create issues, and submit bug reports!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

st_weaviate_connection-0.0.1.tar.gz (3.9 kB view hashes)

Uploaded Source

Built Distribution

st_weaviate_connection-0.0.1-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page