Skip to content

Latest commit

 

History

History
93 lines (58 loc) · 3.89 KB

readme.md

File metadata and controls

93 lines (58 loc) · 3.89 KB

Welcome to the Weaviate Javascript recipes repository!

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

What are recipes?

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.

Concepts Covered 🗺️

Here are some of the concepts this repository covers:

Similarity Search 🔎

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 ⌨️

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.

🚀 Setup Instructions

🌐 Run on Replit

1. Open on recipes on Replit

Navigate to the recipes Replit and fork it.

2. Run in Weaviate Cloud Service

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.

3. Define environment variables

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

1. Install npm packages

Clone this repository, and install the project dependencies

npm install

2. Run locally using Docker

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 the connectToWeaviateCloud() methods to connectToLocal().

IMPORTANT: Make sure to define your environment variables before running Docker

3. Define environment variables

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 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

Feedback ❓

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.