Development

Weaviate Metadata

In this tutorial, we will learn how to use the Weaviate API endpoint and the Weaviate Python client to gather information about a connected server.
Captain Salem 1 min read
Weaviate Metadata

Weaviate is a graph-based, cloud-native, vector search engine that leverages semantic embeddings and knowledge graphs to enable efficient and accurate search, retrieval, and exploration of complex data structures at scale.

Once connected to Weaviate, you may need to gather information about the server, including the hostname, installed version, and module information.

Weaviate Meta – API Endpoint

The best way to quickly gather information about a Weaviate cluster is using the GET HTTP request and the API endpoint of v1/meta

GET /v1/meta

Once you make a request to the API, it returns the following information about the server:

  1. Hostname – the URL to the Weaviate instance.
  2. Version – the installed Weaviate version
  3. Modules – returns module-specific information.

The following shows a cURL command that demonstrates how to make a GET request to the above endpoint.

curl http://localhost:8080/v1/meta

If your server is running a different address, ensure to replace it in the command above to your desired value.

The command should return JSON data with details about the Weaviate instance and the installed modules.

An example output is as shown:

{
  "hostname": "http://[::]:8080",
  "modules": {},
  "version": "1.26.1"
}

Weaviate Meta – Python

We can also use the Weaviate Python client to gather information about the cluster. Ensure you have the Weaviate client installed with the command:

pip3 install weaviate-client

Once installed, you can use it to get metadata information about the cluster, as shown in the example below:

>>> import weaviate
>>> client = weaviate.Client("http://localhost:8080")
>>> meta_info = client.get_meta()
>>> print(meta_info)

This should return detailed information about the server:

{
  "hostname": "http://[::]:8080",
  "modules": {
    "generative-cohere": {
      "documentationHref": "https://docs.cohere.com/reference/generate",
      "name": "Generative Search - Cohere"
    },
    "generative-openai": {
      "documentationHref": "https://platform.openai.com/docs/guides/generation",
      "name": "Generative Search - OpenAI"
    },
    "generative-huggingface": {
      "documentationHref": "https://huggingface.co/docs/transformers/main_classes/pipelines",
      "name": "Generative Search - Hugging Face"
    }
  }
}

Conclusion

In this tutorial, you learned how to gather metadata information about a running Weaviate instance using Python and HTTP requests.

Share
Comments
More from Cloudenv

Cloudenv

Developer Tips, Tricks and Tutorials.

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to Cloudenv.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.