A python package that provides a custom streamlit connection to query data from Weaviate, the AI native vector database
Project description
Streamlit-Weaviate Connection
This project provides a Streamlit connector for the open-source vector database, Weaviate.
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.
- Create a new Python virtual environment:
- Ensure you have python
>=3.11.0
installed pip install poetry
- 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:
- OPTION 1 Create a cluster in WCS (for more details, refer to the Weaviate Cluster Setup Guide)
- OPTION 2 Use Docker-Compose to setup a cluster locally Weaviate Docker Guide
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
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
Hashes for st_weaviate_connection-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f829f18c2cc98f24c2bfebbd9b2fceecf433f57f383790608cf279b6d5eaa8c |
|
MD5 | 82f8cddac72cfabcd627641b9b21753a |
|
BLAKE2b-256 | bb1813b959ae58c7aec1bca1ad5471c9950e5f35d8f96e3fd414f006d3e55b86 |
Hashes for st_weaviate_connection-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | aad83089322b0d08bc0e92b115e708842a4a3b9929a813cba005889958a3802e |
|
MD5 | e55ace992201ecb6b762c801cead13a6 |
|
BLAKE2b-256 | b9c4ec432dee64fc04818d173a5436ffd38bdd6d4ce8facc9210296164212a2c |