Welcome to the Weaviate Javascript recipes repository!
This repo covers end-to-end examples on the various features and integrations with Weaviate for Javascript Developers!
Setup Instructions 🚀
1. Install npm packages
Clone this repository, and install dependencies
npm install
2. Choose where to run Weaviate
2.1 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
2.2 Run locally using Docker
Considering you already have docker installed, you can run:
docker compose up -d
IMPORTANT: make sure to define the environment variables before running Docker
3. Define environment variables
cp .env_example .env
If you are using docker, you can keep it like:
WEAVIATE_SCHEME_URL=http
WEAVIATE_URL=localhost:8080
OPENAI_API_KEY=<your openai apikey>
COHERE_API_KEY=<your cohere apikey>
if you are using WCS, you can keep it like:
WEAVIATE_SCHEME_URL=https
WEAVIATE_URL=<yourcluster.weaviate.network>
WEAVIATE_API_KEY=<your_apikey>
OPENAI_API_KEY=<your openai apikey>
COHERE_API_KEY=<your cohere apikey>
HUGGING_FACE_API_KEY=<your huggingface apikey>
PALM_API_KEY=<your palm apikey>
4. Run a Recipe!
npm run <recipe>
current available recipes:
npm run generative-search/openai
npm run generative-search/cohere
npm run similarity-search/text2vec/openai
npm run conditional-filters/contains-all-any
npm run multi-tenancy/example
npm run classification/zeroshot
npm run classification/knn
npm run data-with-vectors
- more coming soon!
Here is an outline of the concepts this repository covers:
Similarity Search 🔎
Similarity Search shows how to run nearText
, nearObject
and nearVector
queries in Weaviate. It is divided by the different providers:
- Cohere -
npm run similarity-search/text2vec/cohere
- HuggingFace -
npm run similarity-search/text2vec/hugging-face
- OpenAI -
npm run similarity-search/text2vec/openai
- PaLM -
npm run similarity-search/text2vec/palm
- Transformers - coming soon ⏳
Hybrid Search ⚖️
Hybrid Search allows you to combine keyword and vector search. The notebook covers how to run a hybrid search query, search on a specific property, add in a where
filter, and how to search with an embedding. It is divided by the different providers:
- Cohere - coming soon ⏳
- Contextionary - coming soon ⏳
- HuggingFace - coming soon ⏳
- OpenAI - coming soon ⏳
- PaLM - coming soon ⏳
- Transformers - coming soon ⏳
Generative Search ⌨️
Generative Search allows you to improve your search results by piping them through LLM models. It is divided by the different providers:
- Cohere -
npm run generative-search/cohere
- OpenAI -
npm run generative-search/openai
- PaLM -
npm run generative-search/palm
Classification 🗂️
Classification allows you to classify data objects by predicting cross-references based on the semantic meaning of the data objects.
Integrations 🤝
Integrations with Weaviate
-
LlamaIndex
- Episode 1: Data Loaders - coming soon ⏳
- Episode 2: Indexes - coming soon ⏳
- Simple Query Engine - coming soon ⏳
- Sub Question Query Engine - coming soon ⏳
-
Llama 2 Demo
-
GPTCache
- GPTCache notebook - coming soon ⏳
Ranking 🏅
Ranking in Weaviate
- Cohere Rerank - coming soon ⏳
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.