← Back to Blogs
Skip to main content

The Weaviate v3 Typescript Client goes GA

· 6 min read
Daniel Phiri
Tommy Smith

The Weaviate TypeScript client stable release

The new TypeScript client is now GA!!! After a successful beta phase, we are ready to share the best Weaviate TypeScript client yet.

Not too long ago we released the beta version of the Weaviate v3 Typescript client, an extremely well received release! After a successful beta, today we’re happy to share that the v3 Weaviate Typescript client is stable. We're even more excited to invest more in enabling the JavaScript ecosystem with this and subsequent releases.

To install the new client, run the following command in your terminal.

npm install weaviate-client # Or yarn add weaviate-client

As highlighted previously, following the release of a new Python client, we felt it necessary to dedicate time to serving the Javascript community. The v3 client is what came out; with a faster gRPC-powered API, first-class Typescript support and numerous quality-of-life improvements! Don't just take our word for it. We've had a wonderful group of early adopters building real applications and solving problems.

Developer Experience First

"I’ve been enjoying the v3 client as it nears release! Lots of care is taken with matching the developer mental model, and developer experience if you use TypeScript. We’ve been migrating a production system and all the love and support from the Weaviate developers helps me sleep at night!"


Richard Rodger, CEO at Voxgig.

With the client being out in the wild, we’re itching to see what you get to build!

We had to do!

Changes since the beta

If you haven't already, take a look at the updates we introduced in the v3 client beta. Since the beta release, besides squashing bugs, we’ve got a lot of feedback on what we could do better and have changed the functionality of a few things. Namely

Client connection methods

We've updated the client connection methods to make their names more intuitive.

connectToWeaviateCloud() replaced connectToWCS(). We've also added connectToLocal() and connectToCustom() to make it easier to connect local and custom Weaviate instances.

Connecting to Weaviate Cloud looks like this with the new connection method.

const client = await weaviate.connectToWeaviateCloud(process.env.WEAVIATE_URL || '',{
authCredentials: new weaviate.ApiKey(process.env.WEAVIATE_API_KEY || ''),
headers: {
'X-OpenAI-Api-Key': process.env.OPENAI_API_KEY || '',
}
})

Vectorizer configuration

We've added the option to have multiple vectorizers to a collection definition. This leans on our approach to enable users create multiple vectors

A collection definition with two properties and multiple vectorizers looks like this.

import weaviate from 'weaviate-client';
const { vectorizer, dataType } = weaviate.configure;

const newCollection = await client.collections.create({
name: 'Article',
properties: [
{ name: 'title', dataType: dataType.TEXT },
{ name: 'body', dataType: dataType.TEXT },
],
vectorizers: [
vectorizer.text2VecOpenAI({
name: 'title_body',
sourceProperties: ['title', 'body'],
}),
vectorizer.text2VecCohere({
name: 'body',
sourceProperties: ['body']
})
]
})

Notice sourceProperties in each vectorizer. With it, you can define what properties you want your vector to be created from.

The changes to the vectorizer configuration still let you define a single vectorizer as shown below.

import weaviate from 'weaviate-client';
const { vectorizer, dataType } = weaviate.configure;

const newCollection = await client.collections.create({
name: 'Article',
properties: [
{ name: 'title', dataType: dataType.TEXT },
{ name: 'body', dataType: dataType.TEXT },
],
vectorizers: vectorizer.text2VecCohere()
})

Collection reconfiguration

We've refreshed the way you reconfigure collections.

import weaviate from 'weaviate-client';
const { vectorizer, vectorIndex } = weaviate.reconfigure;

const myCollection = client.collection.get('Article')

const config = await myCollection.config.update({
vectorizers: vectorizer.update({
name: 'body',
vectorIndexConfig: vectorIndex.hnsw({ ef: 4 }),
}),
})

v2 backwards compatibility

To make the transition from v2 to v3 smoother, we've added backwards compatibility to the client. You can use the Weaviate v2 client as follows.

import { weaviateV2 } from 'weaviate-client'

This by design means you can have an application running both v3 and v2 code all from a single client; v3. Should you want to avoid any confusion with the default v3 import, we recommend renaming the import. This might be useful as you migrate your code base or test out v3 in a v2 project.

import weaviateNext, { weaviateV2: weaviate } from 'weaviate-client'

Using the client

Lets dive in

Updating your client

To update your application from a beta or RC version of the client, run the following command.

npm install weaviate-client@latest

You should have the latest version of the v3 client installed.

Resources

To support your usage, we have put together the following resources

A vast majority of our documentation has also been updated to support you as you build with the new client.

Demo applications

You can also find some demo applications written in TypeScript and JavaScript below

You might be thinking about upgrading your applications, we’ve put together a guide to help you navigate through your migration. Again, if there is anything you need please let us know.

With the client released, we are now focused on supporting developers building AI Native Web Applications.

Weaviate v2 Support

To bring performance and speed improvements to client, we opted to use gRPC for CRUD operations. This means the Weaviate v3 client can only be used to build server-side applications. Given the constraints this brings for people wanting a client-side package, we found it fitting to keep supporting the v2 client until we have a web version out.

We will support both the v2 and v3 clients and ship new Weaviate features to both. When this commitment to support both clients changes, we'll be sure to communicate it promptly. Our plan is to launch a web version of the client and gracefully sunset the v2 client.

What's next

As happy as we are about the client release, we won't slow down in our commitment to helping developers build AI-Native applications.

We're going to focus our energy on the following in the next few months.

  • Improving client error messages
  • Releasing a web version of the v3 Typescript client
  • Improving the batching experience of the client

if you think there's something we should focus on. Please open an issue on the client repo and let us know.

Production Ready

"We are using Weaviate to power retrieval-augmented generation for Aimee, our platform for customizable human-like AI assistants. The ease-of-use of the database (be it local or in the cloud), as well as the TypeScript client, is unparalleled - just like the superb support."


Steffen Schreiber, CTO at AccessPoint AI.

We're really excited to share this with everyone and cannot wait to see what you all build. We've already seen so much interest in the client and want to support builders in any way we can.

Bow

Ready to start building?

Check out the Quickstart tutorial, or build amazing apps with a free trial of Weaviate Cloud (WCD).

Don't want to miss another blog post?

Sign up for our bi-weekly newsletter to stay updated!


By submitting, I agree to the Terms of Service and Privacy Policy.