This repo covers end-to-end examples of various features and integrations with Weaviate for Javascript Developers!
💡 This repo can also be used online with Replit
Recipes are end-to-end scripts showing various features and integrations. Recipes act as a reference for what using the Weaviate client can look like.
Here are some of the concepts this repository covers:
Similarity Search leverages various machine learning models to perform searches based on semantic similarity. In Weaviate, this is done with query.nearText
, query.nearObject
and query.nearVector
operators.
Generative Search allows you to improve your search results by piping them through LLM models to perform RAG. In Weaviate, this is done with generate.nearText
, generate.nearObject
and generate.nearVector
operators.
⚠️ Before getting started, you need to follow the installation Setup Instructions detailed in the setup section of this document. You will need the setup completed to successfully run the recipes.
🌐 Run on Replit
Navigate to the recipes Replit and fork it.
Head to WCS, where you can easily create a free sandbox cluster.
Take note of your cluster URL
and apiKey
and add them to your .env
file as WEAVIATE_URL
and WEAVIATE_ADMIN_KEY
respectively.
The .env.example
file contains all the environment variables you would need to run the recipes.
Go to each provider website to create and copy your environment variables, e.g. access your Cohere variables here.
cp .env_example .env
Now you're ready to run a recipe!
🏡 Run locally
Clone this repository, and install the project dependencies
npm install
Considering you already have docker installed, follow along our Docker installation guide. Then run the command below to start your Weaviate server.
docker compose up -d
⚠️ When using Docker, remember to update all theconnectToWeaviateCloud()
methods toconnectToLocal()
.
IMPORTANT: Make sure to define your environment variables before running Docker
The .env.example
file contains all the environment variables you would need to run the recipes.
Go to each provider website to create and copy your environment variables, e.g. access your Cohere
variables here.
cp .env_example .env
Now you're ready to run a recipe!
Recipes are organized by concepts using folders (i.e. similarity search). Each concept folder has multiple folders showing its implementation with various model providers (i.e. Cohere, Mistral AI etc).
Provider subfolders contain relevant scripts and a README.md
file with details on how to run each specific recipe.
To run a recipe, navigate to the concept you are interested in and select a provider to run it with. Follow the instructions in the README.md
file and you should be good to go.
⚠️ Remember to add the relevant API keys to your.env
files
Please note this is an ongoing project, and updates will be made frequently. If you have a feature you would like to see, please drop it in the Weaviate Forum or open an issue.