Option 1: A cloud WCD instance
Here, you will create a Weaviate Cloud (WCD) instance. WCD is a fully managed Weaviate instance that runs in the cloud. It's a great way to get started with Weaviate, as it requires no installation or maintenance.
Log in to the WCD Console
Go to the WCD Console and log in with your credentials. If you don't have an account yet, you can sign up by clicking on the Register here link from the login screen.
Create a Weaviate instance
From the console, go to the Dashboard and click on the Create cluster button. From the following screen:
- Select the "Free sandbox" tab
- Provide a cluster name
- Set "Enable authentication" to "Yes"
Click on the Create button to create your Weaviate instance. The process will take a few minutes.
Retrieve your Weaviate instance details
Once the instance is created, you will be able see its details by clicking on the Details button. Find the cluster URL and the API key.
You will need these details to connect to your Weaviate instance.
Connect to your WCD instance
To connect to the Weaviate Cloud (WCD) instance, you need to use the cluster URL and the API key. You can find these details in the WCD Console.
Use the connectToWeaviateCloud()
function to connect to your WCD instance.
import weaviate, { WeaviateClient } from "weaviate-client";
let client: WeaviateClient;
client = await weaviate.connectToWeaviateCloud(
process.env.WCD_URL as string,{
authCredentials: new weaviate.ApiKey(process.env.WCD_API_KEY as string),
}
)
Provide inference API keys
Some Weaviate modules can use inference APIs for vectorizing data or large language model integration. You can provide the API keys for these services to Weaviate at instantiation.
This course uses OpenAI, so you can provide the OpenAI API key to Weaviate through headers: {"X-OpenAI-Api-Key": <YOUR_KEY>}
as shown below:
import weaviate, { WeaviateClient } from "weaviate-client";
let client: WeaviateClient;
client = await weaviate.connectToWeaviateCloud(
process.env.WCD_URL as string,{
authCredentials: new weaviate.ApiKey(process.env.WCD_API_KEY as string),
headers: {
'X-OpenAI-Api-Key': process.env.OPENAI_APIKEY as string, // Replace with your inference API key
}
}
)
If you have completed this, you can skip the next page Option 2: A local Weaviate instance and continue with Communicate with Weaviate.
Questions and feedback
If you have any questions or feedback, let us know in the user forum.