From e7f009b920254249654ad0d020c64b8881606a86 Mon Sep 17 00:00:00 2001
From: Ivan Despot <66276597+g-despot@users.noreply.github.com>
Date: Tue, 21 Oct 2025 18:42:15 +0200
Subject: [PATCH 01/16] Update docs
---
.../quickstart.create_populate_collection.py | 59 ++
...eate_populate_collection_custom_vectors.py | 69 +++
.../code/quickstart/clients.install.new.mdx | 37 ++
.../quickstart.create_populate_collection.mdx | 88 +++
...ate_populate_collection_custom_vectors.mdx | 88 +++
.../code/quickstart/quickstart.query.rag.mdx | 107 ++--
docs/weaviate/quickstart/index.md | 551 +++---------------
src/css/custom.scss | 4 +
8 files changed, 474 insertions(+), 529 deletions(-)
create mode 100644 _includes/code/python/quickstart.create_populate_collection.py
create mode 100644 _includes/code/python/quickstart.create_populate_collection_custom_vectors.py
create mode 100644 _includes/code/quickstart/clients.install.new.mdx
create mode 100644 _includes/code/quickstart/quickstart.create_populate_collection.mdx
create mode 100644 _includes/code/quickstart/quickstart.create_populate_collection_custom_vectors.mdx
diff --git a/_includes/code/python/quickstart.create_populate_collection.py b/_includes/code/python/quickstart.create_populate_collection.py
new file mode 100644
index 00000000..b9fea1c3
--- /dev/null
+++ b/_includes/code/python/quickstart.create_populate_collection.py
@@ -0,0 +1,59 @@
+# START CreateCollection
+import weaviate
+from weaviate.classes.init import Auth
+from weaviate.classes.config import Configure, Property, DataType
+import os
+
+# Best practice: store your credentials in environment variables
+weaviate_url = os.environ["WEAVIATE_URL"]
+weaviate_api_key = os.environ["WEAVIATE_API_KEY"]
+
+# Step 1.1: Connect to your Weaviate Cloud instance
+client = weaviate.connect_to_weaviate_cloud(
+ cluster_url=weaviate_url,
+ auth_credentials=Auth.api_key(weaviate_api_key),
+)
+
+# END CreateCollection
+
+# NOT SHOWN TO THE USER - DELETE EXISTING COLLECTION
+client.collections.delete("Question")
+
+# START CreateCollection
+# Step 1.2: Create a collection
+# highlight-start
+questions = client.collections.create(
+ name="Question",
+ vector_config=Configure.Vectors.text2vec_weaviate(), # Configure the Weaviate Embeddings vectorizer
+ # You can also use auto-schema, here we define the schema manually
+ properties=[
+ Property(name="question", data_type=DataType.TEXT),
+ Property(name="answer", data_type=DataType.TEXT),
+ Property(name="category", data_type=DataType.TEXT),
+ ],
+)
+# highlight-end
+# START CreateCollection
+
+# END CreateCollection
+# fmt: off
+# START CreateCollection
+# Step 1.3: Import three objects
+data_objects = [
+ {"properties": {"question": "What is Python?", "answer": "Python is a high-level, interpreted programming language known for its simplicity and readability.", "category": "Programming"}},
+ {"properties": {"question": "What is machine learning?", "answer": "Machine learning is a subset of AI that enables systems to learn and improve from experience without being explicitly programmed.", "category": "AI"}},
+ {"properties": {"question": "What is a vector database?", "answer": "A vector database is a specialized database designed to store and query high-dimensional vectors efficiently.", "category": "Database"}},
+]
+# END CreateCollection
+# fmt: on
+# START CreateCollection
+
+questions = client.collections.use("Question")
+with questions.batch.dynamic() as batch:
+ for obj in data_objects:
+ batch.add_object(properties=obj)
+
+print(f"Imported {len(questions)} objects into the Question collection")
+
+client.close() # Free up resources
+# END CreateCollection
diff --git a/_includes/code/python/quickstart.create_populate_collection_custom_vectors.py b/_includes/code/python/quickstart.create_populate_collection_custom_vectors.py
new file mode 100644
index 00000000..a74059ec
--- /dev/null
+++ b/_includes/code/python/quickstart.create_populate_collection_custom_vectors.py
@@ -0,0 +1,69 @@
+# START CreateCollection
+import weaviate
+from weaviate.classes.init import Auth
+from weaviate.classes.config import Configure, Property, DataType
+import os
+
+# Best practice: store your credentials in environment variables
+weaviate_url = os.environ["WEAVIATE_URL"]
+weaviate_api_key = os.environ["WEAVIATE_API_KEY"]
+
+# Step 1.1: Connect to your Weaviate Cloud instance
+client = weaviate.connect_to_weaviate_cloud(
+ cluster_url=weaviate_url,
+ auth_credentials=Auth.api_key(weaviate_api_key),
+)
+
+# END CreateCollection
+
+# NOT SHOWN TO THE USER - DELETE EXISTING COLLECTION
+client.collections.delete("Question")
+
+# START CreateCollection
+# Step 1.2: Create a collection
+# highlight-start
+questions = client.collections.create(
+ name="Question",
+ vector_config=Configure.Vectors.self_provided(), # No automatic vectorization since we're providing vectors
+ properties=[
+ Property(name="question", data_type=DataType.TEXT),
+ Property(name="answer", data_type=DataType.TEXT),
+ Property(name="category", data_type=DataType.TEXT),
+ ],
+)
+# highlight-end
+# START CreateCollection
+
+# Import three hardcoded objects with their vectors
+# END CreateCollection
+# fmt: off
+# START CreateCollection
+# Step 1.3: Import three objects
+data_objects = [
+ {
+ "properties": {"question": "What is Python?", "answer": "Python is a high-level, interpreted programming language known for its simplicity and readability.", "category": "Programming"},
+ "vector": [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]
+ },
+ {
+ "properties": {"question": "What is machine learning?", "answer": "Machine learning is a subset of AI that enables systems to learn and improve from experience without being explicitly programmed.", "category": "AI"},
+ "vector": [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
+ },
+ {
+ "properties": {"question": "What is a vector database?", "answer": "A vector database is a specialized database designed to store and query high-dimensional vectors efficiently.", "category": "Database"},
+ "vector": [0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]
+ }
+]
+# END CreateCollection
+# fmt: on
+# START CreateCollection
+
+# Insert the objects with vectors
+questions = client.collections.get("Question")
+with questions.batch.dynamic() as batch:
+ for obj in data_objects:
+ batch.add_object(properties=obj["properties"], vector=obj["vector"])
+
+print(f"Imported {len(data_objects)} objects with vectors into the Question collection")
+
+client.close() # Free up resources
+# END CreateCollection
diff --git a/_includes/code/quickstart/clients.install.new.mdx b/_includes/code/quickstart/clients.install.new.mdx
new file mode 100644
index 00000000..9ad1e129
--- /dev/null
+++ b/_includes/code/quickstart/clients.install.new.mdx
@@ -0,0 +1,37 @@
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+
+
+
+
+```bash
+pip install -U weaviate-client
+```
+
+
+
+
+```bash
+npm install weaviate-client
+```
+
+
+
+
+```bash
+go get github.com/weaviate/weaviate-go-client/v5
+```
+
+
+
+
+```xml
+
+ io.weaviate
+ client
+ 4.8.3
+
+```
+
+
+
diff --git a/_includes/code/quickstart/quickstart.create_populate_collection.mdx b/_includes/code/quickstart/quickstart.create_populate_collection.mdx
new file mode 100644
index 00000000..67c072e9
--- /dev/null
+++ b/_includes/code/quickstart/quickstart.create_populate_collection.mdx
@@ -0,0 +1,88 @@
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+import FilteredTextBlock from "@site/src/components/Documentation/FilteredTextBlock";
+import PyCode from "!!raw-loader!/_includes/code/python/quickstart.create_populate_collection.py";
+import TSCode from "!!raw-loader!/_includes/code/typescript/quickstart.create_collection.ts";
+import GoCode from "!!raw-loader!/_includes/code/howto/go/docs/quickstart/2_1_create_collection/main.go";
+import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/CreateCollection.java";
+import VectorConfigSyntax from "/_includes/vector-config-syntax.mdx";
+import VectorsAutoSchemaError from "/_includes/error-note-vectors-autoschema.mdx";
+
+
+
+
+
+
+
+
+
+
+
+The collection also contains a configuration for the generative (RAG) integration:
+
+- OpenAI [generative AI integrations](/weaviate/model-providers/openai/generative) for retrieval augmented generation (RAG).
+
+
+
+
+
+
+The collection also contains a configuration for the generative (RAG) integration:
+
+- OpenAI [generative AI integrations](/weaviate/model-providers/openai/generative) for retrieval augmented generation (RAG).
+
+
+
+
+
+
+
+The collection also contains a configuration for the generative (RAG) integration:
+
+- OpenAI [generative AI integrations](/weaviate/model-providers/openai/generative) for retrieval augmented generation (RAG).
+
+```bash
+# Best practice: store your credentials in environment variables
+# export WEAVIATE_URL="YOUR_INSTANCE_URL" # Your Weaviate instance URL
+# export WEAVIATE_API_KEY="YOUR_API_KEY" # Your Weaviate instance API key
+
+curl -X POST \
+-H "Content-Type: application/json" \
+-H "Authorization: Bearer $WEAVIATE_API_KEY" \
+-d '{
+ "class": "Question",
+ "vectorizer": "text2vec-weaviate",
+ "moduleConfig": {
+ "text2vec-weaviate": {},
+ "generative-cohere": {}
+ }
+}' \
+"$WEAVIATE_URL/v1/schema"
+```
+
+
+
diff --git a/_includes/code/quickstart/quickstart.create_populate_collection_custom_vectors.mdx b/_includes/code/quickstart/quickstart.create_populate_collection_custom_vectors.mdx
new file mode 100644
index 00000000..6dedd6e8
--- /dev/null
+++ b/_includes/code/quickstart/quickstart.create_populate_collection_custom_vectors.mdx
@@ -0,0 +1,88 @@
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+import FilteredTextBlock from "@site/src/components/Documentation/FilteredTextBlock";
+import PyCode from "!!raw-loader!/_includes/code/python/quickstart.create_populate_collection_custom_vectors.py";
+import TSCode from "!!raw-loader!/_includes/code/typescript/quickstart.create_collection.ts";
+import GoCode from "!!raw-loader!/_includes/code/howto/go/docs/quickstart/2_1_create_collection/main.go";
+import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/CreateCollection.java";
+import VectorConfigSyntax from "/_includes/vector-config-syntax.mdx";
+import VectorsAutoSchemaError from "/_includes/error-note-vectors-autoschema.mdx";
+
+
+
+
+
+
+
+
+
+
+
+The collection also contains a configuration for the generative (RAG) integration:
+
+- OpenAI [generative AI integrations](/weaviate/model-providers/openai/generative) for retrieval augmented generation (RAG).
+
+
+
+
+
+
+The collection also contains a configuration for the generative (RAG) integration:
+
+- OpenAI [generative AI integrations](/weaviate/model-providers/openai/generative) for retrieval augmented generation (RAG).
+
+
+
+
+
+
+
+The collection also contains a configuration for the generative (RAG) integration:
+
+- OpenAI [generative AI integrations](/weaviate/model-providers/openai/generative) for retrieval augmented generation (RAG).
+
+```bash
+# Best practice: store your credentials in environment variables
+# export WEAVIATE_URL="YOUR_INSTANCE_URL" # Your Weaviate instance URL
+# export WEAVIATE_API_KEY="YOUR_API_KEY" # Your Weaviate instance API key
+
+curl -X POST \
+-H "Content-Type: application/json" \
+-H "Authorization: Bearer $WEAVIATE_API_KEY" \
+-d '{
+ "class": "Question",
+ "vectorizer": "text2vec-weaviate",
+ "moduleConfig": {
+ "text2vec-weaviate": {},
+ "generative-cohere": {}
+ }
+}' \
+"$WEAVIATE_URL/v1/schema"
+```
+
+
+
diff --git a/_includes/code/quickstart/quickstart.query.rag.mdx b/_includes/code/quickstart/quickstart.query.rag.mdx
index d5885216..74560601 100644
--- a/_includes/code/quickstart/quickstart.query.rag.mdx
+++ b/_includes/code/quickstart/quickstart.query.rag.mdx
@@ -1,63 +1,50 @@
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-import FilteredTextBlock from '@site/src/components/Documentation/FilteredTextBlock';
-import PyCode from '!!raw-loader!/_includes/code/python/quickstart.query.rag.py';
-import TSCode from '!!raw-loader!/_includes/code/typescript/quickstart.query.rag.ts';
-import GoCode from '!!raw-loader!/_includes/code/howto/go/docs/quickstart/3_2_rag/main.go';
-import JavaCode from '!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/RAG.java';
-
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+import FilteredTextBlock from "@site/src/components/Documentation/FilteredTextBlock";
+import PyCode from "!!raw-loader!/_includes/code/python/quickstart.query.rag.py";
+import TSCode from "!!raw-loader!/_includes/code/typescript/quickstart.query.rag.ts";
+import GoCode from "!!raw-loader!/_includes/code/howto/go/docs/quickstart/3_2_rag/main.go";
+import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/RAG.java";
-
-
-We are using the OpenAI [generative AI integrations](/weaviate/model-providers/openai/generative) for retrieval augmented generation (RAG).
-
-
-
-
-
-
-
-We are using the OpenAI [generative AI integrations](/weaviate/model-providers/openai/generative) for retrieval augmented generation (RAG).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
```bash
# Best practice: store your credentials in environment variables
# export WEAVIATE_URL="YOUR_INSTANCE_URL" # Your Weaviate instance URL
@@ -99,6 +86,6 @@ echo '{
-d @- \
$WEAVIATE_URL/v1/graphql
```
-
-
+
+
diff --git a/docs/weaviate/quickstart/index.md b/docs/weaviate/quickstart/index.md
index 17ff5664..d2388e22 100644
--- a/docs/weaviate/quickstart/index.md
+++ b/docs/weaviate/quickstart/index.md
@@ -1,91 +1,66 @@
---
title: Quickstart (with cloud resources)
-sidebar_position: 0
image: og/docs/quickstart-tutorial.jpg
# tags: ['getting started']
-hide_table_of_contents: true
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import SkipLink from '/src/components/SkipValidationLink'
+import CardsSection from "/src/components/CardsSection";
-Expected time: 30 minutesPrerequisites: None
-
-
-:::info What you will learn
-
-This quickstart shows you how to combine Weaviate Cloud and Cohere to:
-
-1. Set up a Weaviate instance. (10 minutes)
-1. Add and vectorize your data. (10 minutes)
-1. Perform a semantic search and retrieval augmented generation (RAG). (10 minutes)
-
-```mermaid
-flowchart LR
- %% Define nodes with white backgrounds and darker borders
- A1["Create Weaviate Sandbox"] --> A2["Install client library"]
- A2 --> A3["Connect to Weaviate"]
- A3 --> B1["Define collection (with an inference API)"]
- B1 --> B2["Batch import objects"]
- B2 --> C1["Semantic search (nearText)"]
- C1 --> C2["RAG (Generate)"]
-
- %% Group nodes in subgraphs with brand colors
- subgraph sg1 ["1\. Setup"]
- A1
- A2
- A3
- end
-
- subgraph sg2 ["2\. Populate"]
- B1
- B2
- end
-
- subgraph sg3 ["3\. Query"]
- C1
- C2
- end
-
- %% Style nodes with white background and darker borders
- style A1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style A2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style A3 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style B1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style B2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style C1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style C2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
-
- %% Style subgraphs with brand colors
- style sg1 fill:#ffffff,stroke:#61BD73,stroke-width:2px,color:#130C49
- style sg2 fill:#ffffff,stroke:#130C49,stroke-width:2px,color:#130C49
- style sg3 fill:#ffffff,stroke:#7AD6EB,stroke-width:2px,color:#130C49
-```
-
-Notes:
-
-- The code examples here are self-contained. You can copy and paste them into your own environment to try them out.
-
-- If you prefer to use locally hosted resources, see [Quickstart: locally hosted](./local.md).
+export const quickstartOptions = [
+{
+title: "Vectorize objects on import",
+description:
+"Import objects and vectorize them with the Weaviate Embeddings service.",
+link: "?import=vectorization#create-a-collection",
+icon: "fas fa-compress-alt",
+},
+{
+title: "Import custom vectors",
+description:
+"Import pre-computed vector embeddings.",
+link: "?import=custom-embeddings#create-a-collection",
+icon: "fas fa-puzzle-piece",
+},
+];
+
+
+
+
-:::
+---
-
+
+
-### Requirements
+Weaviate is an open-source vector database built to power AI applications, from prototypes to production-scale systems. This quickstart guide will show you how to:
-In order to perform Retrieval Augmented Generation (RAG) in the last step, you will need a [Cohere](https://dashboard.cohere.com/) account. You can use a free Cohere trial API key.
+1. **Import data** - Create a collection and import data into it. The data will be vectorized with the Weaviate Embeddings service.
+2. **Search** - Perform a similarity (vector) search on your data.
+3. **RAG** - Perform Retrieval augmented generation (RAG) with a generative model.
-If you have another preferred [model provider](/weaviate/model-providers), you can use that instead of Cohere.
+
+
-
+Weaviate is an open-source vector database built to power AI applications, from prototypes to production-scale systems. This quickstart guide will show you how to:
-## Step 1: Set up Weaviate
+1. **Import data** - Create a collection and import data into it.
+2. **Search** - Perform a similarity (vector) search on your data.
+3. **RAG** - Perform Retrieval augmented generation (RAG) with a generative model.
-### 1.1 Create a Weaviate database
+
+
+
+## Prerequisites
+
+- A [Weaviate Cloud](https://console.weaviate.cloud/) Sandbox instance.
+
+
+How to set up a Weaviate Cloud Sandbox instance
-Go to the [Weaviate Cloud console](https://console.weaviate.cloud) and create a free Sandbox instance.
+Go to the [Weaviate Cloud console](https://console.weaviate.cloud) and create a free Sandbox instance as shown in the interactive example below.
-
-### 1.2 Install a client library
-
-We recommend using a [client library](../client-libraries/index.mdx) to work with Weaviate. Follow the instructions below to install one of the official client libraries, available in [Python](../client-libraries/python/index.mdx), [JavaScript/TypeScript](../client-libraries/typescript/index.mdx), [Go](../client-libraries/go.md), and [Java](../client-libraries/java.md).
-
-import CodeClientInstall from '/\_includes/code/quickstart/clients.install.mdx';
-
-
+
-### 1.3 Connect to Weaviate
+
+How to retrieve Weaviate Cloud credentials (`WEAVIATE_API_KEY` and `WEAVIATE_URL`)
-Now you can connect to your Weaviate instance. You will need the:
+After you create a Weaviate Cloud instance, you will need the:
- **REST Endpoint URL** and the
- **Administrator API Key**.
You can retrieve them both from the [WCD console](https://console.weaviate.cloud) as shown in the interactive example below.
-:::note
-
-New clusters with Weaviate version `v1.30` (or later) have [RBAC (Role-Based Access Control)](/weaviate/configuration/rbac/index.mdx) enabled by default. These clusters don't come with API keys, you will need to create an API key yourself and assign it a role (`admin`, `viewer` or a custom role).
-
-:::
-
-
-If you did not see any errors, you are ready to proceed. We will replace the simple cluster status check with more meaningful operations in the next steps.
+
-
+---
-## Step 2: Populate the database
+## Install a client library
-Now, we can populate our database by first defining a collection and then adding data.
+We recommend using a [client library](../client-libraries/index.mdx) to work with Weaviate. Follow the instructions below to install one of the official client libraries, available in [Python](../client-libraries/python/index.mdx), [JavaScript/TypeScript](../client-libraries/typescript/index.mdx), [Go](../client-libraries/go.md), and [Java](../client-libraries/java.md).
-### 2.1 Define a collection
+import CodeClientInstall from '/\_includes/code/quickstart/clients.install.new.mdx';
-:::info What is a collection?
+
-A collection is a set of objects that share the same data structure, like a table in relational databases or a collection in NoSQL databases. A collection also includes additional configurations that define how the data objects are stored and indexed.
+## Step 1: Create a collection {#create-a-collection}
-:::
+Now, we can populate our database by first defining a collection and then adding data. You can either **[vectorize each object during the import](?import=vectorization#create-a-collection)** (we will use the Weaviate Embeddings service to vectorize the data), or you can **[import pre-computed vector embeddings](?import=custom-embeddings#create-a-collection)**.
-The following example creates a _collection_ called `Question` with:
+
+
-- The [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service for creating vectors during ingestion & queries.
+The following example creates a _collection_ called `Question` with the [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service for creating vectors during ingestion and for querying.
-import CreateCollection from '/\_includes/code/quickstart/quickstart.create_collection.mdx'
+import CreateCollection from '/\_includes/code/quickstart/quickstart.create_populate_collection.mdx'
-Run this code to create the collection to which you can add data.
+
+
-import ModelProvider from '/\_includes/embedding-model-providers.mdx'
+The following example creates a _collection_ called `Questions` and imports precomputed vector embeddings created with the [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service.
-
- Do you prefer a different setup?
-
-
+import CreateCollectionCustomVectors from '/\_includes/code/quickstart/quickstart.create_populate_collection_custom_vectors.mdx'
-### 2.2 Add objects
+
-We can now add data to our collection.
+
+
-The following example:
+## Step 2: Semantic (vector) search {#semantic-search}
-- Loads objects, and
-- Adds objects to the target collection (`Question`) using a batch process.
-
-:::tip Batch imports
-
-([Batch imports](../manage-objects/import.mdx)) are the most efficient way to add large amounts of data, as it sends multiple objects in a single request. See the [How-to: Batch import](../manage-objects/import.mdx) guide for more information.
-
-:::
-
-import ImportObjects from '/\_includes/code/quickstart/quickstart.import_objects.mdx'
-
-
-
-Run this code to add the demo data.
-
-
-
-## Step 3: Queries
-
-Weaviate provides a wide range of query tools to help you find the right data. We will try a few searches here.
-
-### 3.1 Semantic search {#semantic-search}
-
-Semantic search finds results based on meaning. This is called `nearText` in Weaviate.
-
-The following example searches for 2 objects whose meaning is most similar to that of `biology`.
+Semantic search finds results based on meaning. This is called `nearText` in Weaviate. The following example searches for 2 objects (_limit_) whose meaning is most similar to that of `biology`.
import QueryNearText from '/\_includes/code/quickstart/quickstart.query.neartext.mdx'
-Run this code to perform the query. Our query found entries for `DNA` and `species`.
-
-
- Example full response in JSON format
-
-```json
-{
- {
- "answer": "DNA",
- "question": "In 1953 Watson & Crick built a model of the molecular structure of this, the gene-carrying substance",
- "category": "SCIENCE"
- },
- {
- "answer": "species",
- "question": "2000 news: the Gunnison sage grouse isn't just another northern sage grouse, but a new one of this classification",
- "category": "SCIENCE"
- }
-}
-```
-
-
-
-If you inspect the full response, you will see that the word `biology` does not appear anywhere.
-
-Even so, Weaviate was able to return biology-related entries. This is made possible by _vector embeddings_ that capture meaning. Under the hood, semantic search is powered by vectors, or vector embeddings.
-
-Here is a diagram showing the workflow in Weaviate.
-
-```mermaid
-flowchart LR
- Query["ð Search: 'biology'"]
-
- subgraph sg1 ["Vector Search"]
- direction LR
- VS1["Convert query to vector"] --> VS2["Find similar vectors"]
- VS2 --> VS3["Return top matches"]
- end
-
- subgraph sg2 ["Results"]
- R1["Most similar documents"]
- end
-
- Query --> VS1
- VS3 --> R1
-
- %% Style nodes with white background and darker borders
- style Query fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style VS1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style VS2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style VS3 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style R1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
-
- %% Style subgraphs with brand colors
- style sg1 fill:#ffffff,stroke:#61BD73,stroke-width:2px,color:#130C49
- style sg2 fill:#ffffff,stroke:#130C49,stroke-width:2px,color:#130C49
-```
-
-:::info Where did the vectors come from?
-
-Weaviate used the **Weaviate Embeddings** service to generate a vector embedding for each object during import. During the query, Weaviate similarly converted the query (`biology`) into a vector.
-
-As we mentioned above, this is optional. See [Starter Guide: Bring Your Own Vectors](/weaviate/starter-guides/custom-vectors.mdx) if you would prefer to provide your own vectors.
+## Step 3: Retrieval augmented generation (RAG)
-:::
-
-:::tip More search types available
+
+
-Weaviate is capable of many types of searches. See, for example, our how-to guides on [similarity searches](../search/similarity.md), [keyword searches](../search/bm25.md), [hybrid searches](../search/hybrid.md), and [filtered searches](../search/filters.md).
-
-:::
+- For Retrieval Augmented Generation (RAG) in the last step, you will need a [Claude](https://console.anthropic.com/settings/keys) API key. You can also use another [model provider](/weaviate/model-providers) instead.
-### 3.2 Retrieval augmented generation
-
-Retrieval augmented generation (RAG), also called generative search, combines the power of generative AI models such as large language models (LLMs) with the up-to-date truthfulness of a database.
-
-RAG works by prompting a large language model (LLM) with a combination of a _user query_ and _data retrieved from a database_.
-
-This diagram shows the RAG workflow in Weaviate.
-
-```mermaid
-flowchart LR
- subgraph sg0 ["Weaviate Query"]
- direction TB
- Search["ð Search: 'biology'"]
- Prompt["âïļ Prompt: 'Write a tweet...'"]
- end
-
- subgraph sg1 ["Vector Search"]
- direction LR
- VS1["Convert query to vector"] --> VS2["Find similar vectors"]
- VS2 --> VS3["Return top matches"]
- end
-
- subgraph sg2 ["Generation"]
- direction LR
- G1["Send (results + prompt) to LLM"]
- G1 --> G2["Generate response"]
- end
-
- subgraph sg3 ["Results"]
- direction TB
- R1["Most similar documents"]
- R2["Generated content"]
- end
-
- Search --> VS1
- VS3 --> R1
- Prompt --> G1
- VS3 --> G1
- G2 --> R2
-
- %% Style nodes with white background and darker borders
- style Search fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style Prompt fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style VS1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style VS2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style VS3 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style G1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style G2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style R1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style R2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
-
- %% Style subgraphs with brand colors
- style sg0 fill:#ffffff,stroke:#130C49,stroke-width:2px,color:#130C49
- style sg1 fill:#ffffff,stroke:#61BD73,stroke-width:2px,color:#130C49
- style sg2 fill:#ffffff,stroke:#7AD6EB,stroke-width:2px,color:#130C49
- style sg3 fill:#ffffff,stroke:#130C49,stroke-width:2px,color:#130C49
-```
+Retrieval augmented generation (RAG), also called generative search, works by prompting a large language model (LLM) with a combination of a _user query_ and _data retrieved from a database_.
The following example combines the same search (for `biology`) with a prompt to generate a tweet.
@@ -379,215 +188,19 @@ import QueryRAG from '/\_includes/code/quickstart/quickstart.query.rag.mdx'
-:::info Cohere API key in the header
-
-Note that this code includes an additional header for the Cohere API key. Weaviate uses this key to access the Cohere generative AI model and perform retrieval augmented generation (RAG).
-
-:::
-
-Run this code to perform the query. Here is one possible response (your response will likely be different).
-
-```text
-ð§Ž In 1953 Watson & Crick built a model of the molecular structure of DNA, the gene-carrying substance! ð§ŽðŽ
-
-ðĶĒ 2000 news: the Gunnison sage grouse isn't just another northern sage grouse, but a new species! ðĶĒðŋ #ScienceFacts #DNA #SpeciesClassification
-```
-
-The response should be new, yet familiar. This is because you have seen the entries above for `DNA` and `species` in the [semantic search](#semantic-search) section.
-
-The power of RAG comes from the ability to transform your own data. Weaviate helps you in this journey by making it easy to perform a combined search & generation in just a few lines of code.
-
-
-
-## Recap
-
-In this quickstart guide, you:
-
-- Created a Serverless Weaviate sandbox instance on Weaviate Cloud.
-- Defined a collection and added data.
-- Performed queries, including:
- - Semantic search, and
- - Retrieval augmented generation.
-
-Where to go next is up to you. We include some suggested steps and resources below.
-
-
-
-## Next
-
-Try these additional resources to learn more about Weaviate:
-
-
-
-
-
-
-
More on search
-
-
-
- See how to perform searches, such as keyword, similarity, hybrid, image, filtered and reranked searches.
-
-
-
-
-
-
-
-
Manage data
-
-
-
- See how to manage data, such as manage collections, create objects, batch import data and use multi-tenancy.
-
-
-
-
-
-
-
-
RAG
-
-
-
- Check out the Starter guide: retrieval augmented generation.
-
-
-
-
-
-
-
-
Workshops and office hours
-
-
-
- We hold in-person and online workshops, office hours and events for different experience levels. Join us!
-
-
-
-
-
-
-
-
-
-## FAQs & Troubleshooting
-
-We provide answers to some common questions, or potential issues below.
-
-### Questions
-
-#### Can I use different integrations?
-
-
- See answer
-
-In this example, we use the `Weaviate Embeddings` and `Cohere` inference API. But you can use others.
-
-If you do want to change the embeddings, or the generative AI integrations, you can. You will need to:
-
-- Ensure that the Weaviate module is available in the Weaviate instance you are using,
-- Modify your collection definition to use your preferred integration, and
-- Make sure to use the right API key(s) (if necessary) for your integration.
-
-See the [model providers integration](../model-providers/index.md) section for more information.
-
-
-
-### Troubleshooting
-
-#### If you see Error: Name 'Question' already used as a name for an Object class
+
+
-
- See answer
-
-You may see this error if you try to create a collection that already exists in your instance of Weaviate. In this case, you can follow these instructions to delete the collection.
-
-import CautionSchemaDeleteClass from '/\_includes/schema-delete-class.mdx'
-
-
+- For Retrieval Augmented Generation (RAG) in the last step, you will need a [Claude](https://console.anthropic.com/settings/keys) API key. You can also use another [model provider](/weaviate/model-providers) instead.
-
-
-#### How to confirm collection creation
-
-
- See answer
+Retrieval augmented generation (RAG), also called generative search, works by prompting a large language model (LLM) with a combination of a _user query_ and _data retrieved from a database_.
-If you are not sure whether the collection has been created, check the `schema` endpoint.
-
-Replace WEAVIATE_INSTANCE_URL with your instance's REST Endpoint URL.:
-
-```
-https://WEAVIATE_INSTANCE_URL/v1/schema
-```
-
-You should see:
-
-```json
-{
- "classes": [
- {
- "class": "Question",
- ... // truncated additional information here
- "vectorizer": "text2vec-weaviate"
- }
- ]
-}
-```
-
-Where the schema should indicate that the `Question` collection has been added.
-
-:::note REST & GraphQL in Weaviate
-
-Weaviate uses a combination of RESTful and GraphQL APIs. In Weaviate, RESTful API endpoints can be used to add data or obtain information about the Weaviate instance, and the GraphQL interface to retrieve data.
-
-:::
-
-
-
-#### How to confirm data import
-
-
- See answer
-
-To confirm successful data import, check the `objects` endpoint to verify that all objects are imported.
-
-Replace WEAVIATE_INSTANCE_URL with your instance REST Endpoint URL:
-
-```
-https://WEAVIATE_INSTANCE_URL/v1/objects
-```
-
-You should see:
-
-```json
-{
- "deprecations": null,
- "objects": [
- ... // Details of each object
- ],
- "totalResults": 10 // You should see 10 results here
-}
-```
-
-Where you should be able to confirm that you have imported all `10` objects.
-
-
-
-#### If the `nearText` search is not working
-
-
- See answer
-
-To perform text-based (`nearText`) similarity searches, you need to have a vectorizer enabled, and configured in your collection.
-
-Make sure the vectorizer is configured [like this](#21-define-a-collection).
+The following example combines the same search (for `biology`) with a prompt to generate a tweet.
-If the search still doesn't work, [contact us](#questions-and-feedback)!
+
+
-
+## Next steps
## Questions and feedback
diff --git a/src/css/custom.scss b/src/css/custom.scss
index 5246c678..988de621 100644
--- a/src/css/custom.scss
+++ b/src/css/custom.scss
@@ -980,3 +980,7 @@ button.close {
.scalar-reference-intro-clients {
display: none !important;
}
+
+.hidden-tabs .tabs__item {
+ display: none;
+}
From 1fc2143033b4e274a88fe8775cae4522cf97c539 Mon Sep 17 00:00:00 2001
From: Ivan Despot <66276597+g-despot@users.noreply.github.com>
Date: Tue, 21 Oct 2025 22:00:51 +0200
Subject: [PATCH 02/16] Update docs
---
... => quickstart.short.create_collection.py} | 24 +-
...short.import_vectors.create_collection.py} | 6 +-
...t.short.import_vectors.query.nearvector.py | 30 ++
...ickstart.short.import_vectors.query.rag.py | 37 ++
.../python/quickstart.short.query.neartext.py | 28 ++
.../code/python/quickstart.short.query.rag.py | 37 ++
...=> quickstart.short.create_collection.mdx} | 2 +-
...ckstart.short.import-vectors.query.rag.mdx | 91 ++++
...hort.import_vectors.create_collection.mdx} | 2 +-
....short.import_vectors.query.nearvector.mdx | 86 ++++
.../quickstart.short.query.neartext.mdx | 86 ++++
.../quickstart/quickstart.short.query.rag.mdx | 91 ++++
docs/weaviate/quickstart/index.md | 231 ++++++---
docs/weaviate/tutorials/index.mdx | 11 +
.../tutorials/quick-tour-of-weaviate.mdx | 437 ++++++++++++++++++
sidebars.js | 1 +
src/components/CardsSection/index.jsx | 65 ++-
.../CardsSection/styles.module.scss | 16 +-
src/components/KapaAI/index.jsx | 19 +
src/components/KapaAI/styles.module.scss | 50 ++
20 files changed, 1233 insertions(+), 117 deletions(-)
rename _includes/code/python/{quickstart.create_populate_collection.py => quickstart.short.create_collection.py} (52%)
rename _includes/code/python/{quickstart.create_populate_collection_custom_vectors.py => quickstart.short.import_vectors.create_collection.py} (74%)
create mode 100644 _includes/code/python/quickstart.short.import_vectors.query.nearvector.py
create mode 100644 _includes/code/python/quickstart.short.import_vectors.query.rag.py
create mode 100644 _includes/code/python/quickstart.short.query.neartext.py
create mode 100644 _includes/code/python/quickstart.short.query.rag.py
rename _includes/code/quickstart/{quickstart.create_populate_collection.mdx => quickstart.short.create_collection.mdx} (98%)
create mode 100644 _includes/code/quickstart/quickstart.short.import-vectors.query.rag.mdx
rename _includes/code/quickstart/{quickstart.create_populate_collection_custom_vectors.mdx => quickstart.short.import_vectors.create_collection.mdx} (98%)
create mode 100644 _includes/code/quickstart/quickstart.short.import_vectors.query.nearvector.mdx
create mode 100644 _includes/code/quickstart/quickstart.short.query.neartext.mdx
create mode 100644 _includes/code/quickstart/quickstart.short.query.rag.mdx
create mode 100644 docs/weaviate/tutorials/quick-tour-of-weaviate.mdx
create mode 100644 src/components/KapaAI/index.jsx
create mode 100644 src/components/KapaAI/styles.module.scss
diff --git a/_includes/code/python/quickstart.create_populate_collection.py b/_includes/code/python/quickstart.short.create_collection.py
similarity index 52%
rename from _includes/code/python/quickstart.create_populate_collection.py
rename to _includes/code/python/quickstart.short.create_collection.py
index b9fea1c3..e033cdca 100644
--- a/_includes/code/python/quickstart.create_populate_collection.py
+++ b/_includes/code/python/quickstart.short.create_collection.py
@@ -17,19 +17,19 @@
# END CreateCollection
# NOT SHOWN TO THE USER - DELETE EXISTING COLLECTION
-client.collections.delete("Question")
+client.collections.delete("Movie")
# START CreateCollection
# Step 1.2: Create a collection
# highlight-start
-questions = client.collections.create(
- name="Question",
+movies = client.collections.create(
+ name="Movie",
vector_config=Configure.Vectors.text2vec_weaviate(), # Configure the Weaviate Embeddings vectorizer
# You can also use auto-schema, here we define the schema manually
properties=[
- Property(name="question", data_type=DataType.TEXT),
- Property(name="answer", data_type=DataType.TEXT),
- Property(name="category", data_type=DataType.TEXT),
+ Property(name="title", data_type=DataType.TEXT),
+ Property(name="description", data_type=DataType.TEXT),
+ Property(name="genre", data_type=DataType.TEXT),
],
)
# highlight-end
@@ -40,20 +40,20 @@
# START CreateCollection
# Step 1.3: Import three objects
data_objects = [
- {"properties": {"question": "What is Python?", "answer": "Python is a high-level, interpreted programming language known for its simplicity and readability.", "category": "Programming"}},
- {"properties": {"question": "What is machine learning?", "answer": "Machine learning is a subset of AI that enables systems to learn and improve from experience without being explicitly programmed.", "category": "AI"}},
- {"properties": {"question": "What is a vector database?", "answer": "A vector database is a specialized database designed to store and query high-dimensional vectors efficiently.", "category": "Database"}},
+ {"properties": {"title": "The Matrix", "description": "A computer hacker learns about the true nature of reality and his role in the war against its controllers.", "genre": "Science Fiction"}},
+ {"properties": {"title": "Spirited Away", "description": "A young girl becomes trapped in a mysterious world of spirits and must find a way to save her parents and return home.", "genre": "Animation"}},
+ {"properties": {"title": "The Lord of the Rings: The Fellowship of the Ring", "description": "A meek Hobbit and his companions set out on a perilous journey to destroy a powerful ring and save Middle-earth.", "genre": "Fantasy"}},
]
# END CreateCollection
# fmt: on
# START CreateCollection
-questions = client.collections.use("Question")
-with questions.batch.dynamic() as batch:
+movies = client.collections.use("Movie")
+with movies.batch.dynamic() as batch:
for obj in data_objects:
batch.add_object(properties=obj)
-print(f"Imported {len(questions)} objects into the Question collection")
+print(f"Imported {len(movies)} objects into the Movie collection")
client.close() # Free up resources
# END CreateCollection
diff --git a/_includes/code/python/quickstart.create_populate_collection_custom_vectors.py b/_includes/code/python/quickstart.short.import_vectors.create_collection.py
similarity index 74%
rename from _includes/code/python/quickstart.create_populate_collection_custom_vectors.py
rename to _includes/code/python/quickstart.short.import_vectors.create_collection.py
index a74059ec..4a4b030d 100644
--- a/_includes/code/python/quickstart.create_populate_collection_custom_vectors.py
+++ b/_includes/code/python/quickstart.short.import_vectors.create_collection.py
@@ -41,15 +41,15 @@
# Step 1.3: Import three objects
data_objects = [
{
- "properties": {"question": "What is Python?", "answer": "Python is a high-level, interpreted programming language known for its simplicity and readability.", "category": "Programming"},
+ "properties": {"title": "The Matrix", "description": "A computer hacker learns about the true nature of reality and his role in the war against its controllers.", "genre": "Science Fiction"},
"vector": [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]
},
{
- "properties": {"question": "What is machine learning?", "answer": "Machine learning is a subset of AI that enables systems to learn and improve from experience without being explicitly programmed.", "category": "AI"},
+ "properties": {"title": "Spirited Away", "description": "A young girl becomes trapped in a mysterious world of spirits and must find a way to save her parents and return home.", "genre": "Animation"},
"vector": [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
},
{
- "properties": {"question": "What is a vector database?", "answer": "A vector database is a specialized database designed to store and query high-dimensional vectors efficiently.", "category": "Database"},
+ "properties": {"title": "The Lord of the Rings: The Fellowship of the Ring", "description": "A meek Hobbit and his companions set out on a perilous journey to destroy a powerful ring and save Middle-earth.", "genre": "Fantasy"},
"vector": [0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]
}
]
diff --git a/_includes/code/python/quickstart.short.import_vectors.query.nearvector.py b/_includes/code/python/quickstart.short.import_vectors.query.nearvector.py
new file mode 100644
index 00000000..d87db6ab
--- /dev/null
+++ b/_includes/code/python/quickstart.short.import_vectors.query.nearvector.py
@@ -0,0 +1,30 @@
+# NearText
+import weaviate
+from weaviate.classes.init import Auth
+import os, json
+
+# Best practice: store your credentials in environment variables
+weaviate_url = os.environ["WEAVIATE_URL"]
+weaviate_api_key = os.environ["WEAVIATE_API_KEY"]
+
+client = weaviate.connect_to_weaviate_cloud(
+ cluster_url=weaviate_url, # Replace with your Weaviate Cloud URL
+ auth_credentials=Auth.api_key(
+ weaviate_api_key
+ ), # Replace with your Weaviate Cloud key
+)
+
+movies = client.collections.use("Movie")
+
+# highlight-start
+response = movies.query.near_vector(
+ near_vector=[0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9],
+ limit=2
+)
+# highlight-end
+
+for obj in response.objects:
+ print(json.dumps(obj.properties, indent=2))
+
+client.close() # Free up resources
+# END NearText
diff --git a/_includes/code/python/quickstart.short.import_vectors.query.rag.py b/_includes/code/python/quickstart.short.import_vectors.query.rag.py
new file mode 100644
index 00000000..4728c269
--- /dev/null
+++ b/_includes/code/python/quickstart.short.import_vectors.query.rag.py
@@ -0,0 +1,37 @@
+# RAG
+import os
+import weaviate
+from weaviate.classes.init import Auth
+from weaviate.classes.generate import GenerativeConfig
+
+
+# Best practice: store your credentials in environment variables
+weaviate_url = os.environ["WEAVIATE_URL"]
+weaviate_api_key = os.environ["WEAVIATE_API_KEY"]
+openai_api_key = os.environ["OPENAI_APIKEY"]
+
+client = weaviate.connect_to_weaviate_cloud(
+ cluster_url=weaviate_url, # Replace with your Weaviate Cloud URL
+ auth_credentials=Auth.api_key(
+ weaviate_api_key
+ ), # Replace with your Weaviate Cloud key
+ # highlight-start
+ headers={"X-OpenAI-Api-Key": openai_api_key}, # Replace with your OpenAI API key
+ # highlight-end
+)
+
+questions = client.collections.use("Question")
+
+# highlight-start
+response = questions.generate.near_vector(
+ near_vector=[0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9],
+ limit=1,
+ grouped_task="Write a tweet with emojis about this movie.",
+ generative_provider=GenerativeConfig.openai(), # Configure the OpenAI generative integration for RAG
+)
+# highlight-end
+
+print(response.generative.text) # Inspect the generated text
+
+client.close() # Free up resources
+# END RAG
diff --git a/_includes/code/python/quickstart.short.query.neartext.py b/_includes/code/python/quickstart.short.query.neartext.py
new file mode 100644
index 00000000..24045840
--- /dev/null
+++ b/_includes/code/python/quickstart.short.query.neartext.py
@@ -0,0 +1,28 @@
+# NearText
+import weaviate
+from weaviate.classes.init import Auth
+import os, json
+
+# Best practice: store your credentials in environment variables
+weaviate_url = os.environ["WEAVIATE_URL"]
+weaviate_api_key = os.environ["WEAVIATE_API_KEY"]
+
+client = weaviate.connect_to_weaviate_cloud(
+ cluster_url=weaviate_url, # Replace with your Weaviate Cloud URL
+ auth_credentials=Auth.api_key(weaviate_api_key), # Replace with your Weaviate Cloud key
+)
+
+movies = client.collections.use("Movie")
+
+# highlight-start
+response = movies.query.near_text(
+ query="sci-fi",
+ limit=2
+)
+# highlight-end
+
+for obj in response.objects:
+ print(json.dumps(obj.properties, indent=2))
+
+client.close() # Free up resources
+# END NearText
diff --git a/_includes/code/python/quickstart.short.query.rag.py b/_includes/code/python/quickstart.short.query.rag.py
new file mode 100644
index 00000000..de931a7f
--- /dev/null
+++ b/_includes/code/python/quickstart.short.query.rag.py
@@ -0,0 +1,37 @@
+# RAG
+import os
+import weaviate
+from weaviate.classes.init import Auth
+from weaviate.classes.generate import GenerativeConfig
+
+
+# Best practice: store your credentials in environment variables
+weaviate_url = os.environ["WEAVIATE_URL"]
+weaviate_api_key = os.environ["WEAVIATE_API_KEY"]
+openai_api_key = os.environ["OPENAI_APIKEY"]
+
+client = weaviate.connect_to_weaviate_cloud(
+ cluster_url=weaviate_url, # Replace with your Weaviate Cloud URL
+ auth_credentials=Auth.api_key(
+ weaviate_api_key
+ ), # Replace with your Weaviate Cloud key
+ # highlight-start
+ headers={"X-OpenAI-Api-Key": openai_api_key}, # Replace with your OpenAI API key
+ # highlight-end
+)
+
+questions = client.collections.use("Question")
+
+# highlight-start
+response = questions.generate.near_text(
+ query="sci-fi",
+ limit=1,
+ grouped_task="Write a tweet with emojis about this movie.",
+ generative_provider=GenerativeConfig.openai(), # Configure the OpenAI generative integration for RAG
+)
+# highlight-end
+
+print(response.generative.text) # Inspect the generated text
+
+client.close() # Free up resources
+# END RAG
diff --git a/_includes/code/quickstart/quickstart.create_populate_collection.mdx b/_includes/code/quickstart/quickstart.short.create_collection.mdx
similarity index 98%
rename from _includes/code/quickstart/quickstart.create_populate_collection.mdx
rename to _includes/code/quickstart/quickstart.short.create_collection.mdx
index 67c072e9..696461fe 100644
--- a/_includes/code/quickstart/quickstart.create_populate_collection.mdx
+++ b/_includes/code/quickstart/quickstart.short.create_collection.mdx
@@ -1,7 +1,7 @@
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import FilteredTextBlock from "@site/src/components/Documentation/FilteredTextBlock";
-import PyCode from "!!raw-loader!/_includes/code/python/quickstart.create_populate_collection.py";
+import PyCode from "!!raw-loader!/_includes/code/python/quickstart.short.create_collection.py";
import TSCode from "!!raw-loader!/_includes/code/typescript/quickstart.create_collection.ts";
import GoCode from "!!raw-loader!/_includes/code/howto/go/docs/quickstart/2_1_create_collection/main.go";
import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/CreateCollection.java";
diff --git a/_includes/code/quickstart/quickstart.short.import-vectors.query.rag.mdx b/_includes/code/quickstart/quickstart.short.import-vectors.query.rag.mdx
new file mode 100644
index 00000000..49d7cf03
--- /dev/null
+++ b/_includes/code/quickstart/quickstart.short.import-vectors.query.rag.mdx
@@ -0,0 +1,91 @@
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+import FilteredTextBlock from "@site/src/components/Documentation/FilteredTextBlock";
+import PyCode from "!!raw-loader!/_includes/code/python/quickstart.short.import_vectors.query.rag.py";
+import TSCode from "!!raw-loader!/_includes/code/typescript/quickstart.query.rag.ts";
+import GoCode from "!!raw-loader!/_includes/code/howto/go/docs/quickstart/3_2_rag/main.go";
+import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/RAG.java";
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```bash
+# Best practice: store your credentials in environment variables
+# export WEAVIATE_URL="YOUR_INSTANCE_URL" # Your Weaviate instance URL
+# export WEAVIATE_API_KEY="YOUR_API_KEY" # Your Weaviate instance API key
+# export COHERE_APIKEY="YOUR_API_KEY" # Your Cohere API key
+
+echo '{
+ "query": "{
+ Get {
+ Question (
+ limit: 2
+ nearText: {
+ concepts: [\"biology\"],
+ }
+ ) {
+ question
+ answer
+ category
+ _additional {
+ generate(
+ groupedResult: {
+ task: \"\"\"
+ Write a tweet with emojis about this movie.
+ \"\"\"
+ }
+ ) {
+ groupedResult
+ error
+ }
+ }
+ }
+ }
+ }"
+}' | tr -d "\n" | curl \
+ -X POST \
+ -H 'Content-Type: application/json' \
+ -H "Authorization: Bearer $WEAVIATE_API_KEY" \
+ -H "X-Cohere-Api-Key: $COHERE_APIKEY" \
+ -d @- \
+ $WEAVIATE_URL/v1/graphql
+```
+
+
+
diff --git a/_includes/code/quickstart/quickstart.create_populate_collection_custom_vectors.mdx b/_includes/code/quickstart/quickstart.short.import_vectors.create_collection.mdx
similarity index 98%
rename from _includes/code/quickstart/quickstart.create_populate_collection_custom_vectors.mdx
rename to _includes/code/quickstart/quickstart.short.import_vectors.create_collection.mdx
index 6dedd6e8..25722c65 100644
--- a/_includes/code/quickstart/quickstart.create_populate_collection_custom_vectors.mdx
+++ b/_includes/code/quickstart/quickstart.short.import_vectors.create_collection.mdx
@@ -1,7 +1,7 @@
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import FilteredTextBlock from "@site/src/components/Documentation/FilteredTextBlock";
-import PyCode from "!!raw-loader!/_includes/code/python/quickstart.create_populate_collection_custom_vectors.py";
+import PyCode from "!!raw-loader!/_includes/code/python/quickstart.short.import_vectors.create_collection.py";
import TSCode from "!!raw-loader!/_includes/code/typescript/quickstart.create_collection.ts";
import GoCode from "!!raw-loader!/_includes/code/howto/go/docs/quickstart/2_1_create_collection/main.go";
import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/CreateCollection.java";
diff --git a/_includes/code/quickstart/quickstart.short.import_vectors.query.nearvector.mdx b/_includes/code/quickstart/quickstart.short.import_vectors.query.nearvector.mdx
new file mode 100644
index 00000000..8fd27b68
--- /dev/null
+++ b/_includes/code/quickstart/quickstart.short.import_vectors.query.nearvector.mdx
@@ -0,0 +1,86 @@
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+import FilteredTextBlock from '@site/src/components/Documentation/FilteredTextBlock';
+import PyCode from '!!raw-loader!/_includes/code/python/quickstart.short.import_vectors.query.nearvector.py';
+import TSCode from '!!raw-loader!/_includes/code/typescript/quickstart.query.neartext.ts';
+import GoCode from '!!raw-loader!/_includes/code/howto/go/docs/quickstart/3_1_neartext/main.go';
+import JavaCode from '!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/NearText.java';
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```bash
+# Best practice: store your credentials in environment variables
+# export WEAVIATE_URL="YOUR_INSTANCE_URL" # Your Weaviate instance URL
+# export WEAVIATE_API_KEY="YOUR_API_KEY" # Your Weaviate instance API key
+
+echo '{
+ "query": "{
+ Get {
+ Question (
+ limit: 2
+ nearText: {
+ concepts: [\"biology\"],
+ }
+ ) {
+ question
+ answer
+ category
+ }
+ }
+ }"
+}' | tr -d "\n" | curl \
+ -X POST \
+ -H 'Content-Type: application/json' \
+ -H "Authorization: Bearer $WEAVIATE_API_KEY" \
+ -d @- \
+ $WEAVIATE_URL/v1/graphql
+```
+
+
+
diff --git a/_includes/code/quickstart/quickstart.short.query.neartext.mdx b/_includes/code/quickstart/quickstart.short.query.neartext.mdx
new file mode 100644
index 00000000..1dc96e77
--- /dev/null
+++ b/_includes/code/quickstart/quickstart.short.query.neartext.mdx
@@ -0,0 +1,86 @@
+import Tabs from '@theme/Tabs';
+import TabItem from '@theme/TabItem';
+import FilteredTextBlock from '@site/src/components/Documentation/FilteredTextBlock';
+import PyCode from '!!raw-loader!/_includes/code/python/quickstart.short.query.neartext.py';
+import TSCode from '!!raw-loader!/_includes/code/typescript/quickstart.query.neartext.ts';
+import GoCode from '!!raw-loader!/_includes/code/howto/go/docs/quickstart/3_1_neartext/main.go';
+import JavaCode from '!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/NearText.java';
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```bash
+# Best practice: store your credentials in environment variables
+# export WEAVIATE_URL="YOUR_INSTANCE_URL" # Your Weaviate instance URL
+# export WEAVIATE_API_KEY="YOUR_API_KEY" # Your Weaviate instance API key
+
+echo '{
+ "query": "{
+ Get {
+ Question (
+ limit: 2
+ nearText: {
+ concepts: [\"biology\"],
+ }
+ ) {
+ question
+ answer
+ category
+ }
+ }
+ }"
+}' | tr -d "\n" | curl \
+ -X POST \
+ -H 'Content-Type: application/json' \
+ -H "Authorization: Bearer $WEAVIATE_API_KEY" \
+ -d @- \
+ $WEAVIATE_URL/v1/graphql
+```
+
+
+
diff --git a/_includes/code/quickstart/quickstart.short.query.rag.mdx b/_includes/code/quickstart/quickstart.short.query.rag.mdx
new file mode 100644
index 00000000..7f4783be
--- /dev/null
+++ b/_includes/code/quickstart/quickstart.short.query.rag.mdx
@@ -0,0 +1,91 @@
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+import FilteredTextBlock from "@site/src/components/Documentation/FilteredTextBlock";
+import PyCode from "!!raw-loader!/_includes/code/python/quickstart.short.query.rag.py";
+import TSCode from "!!raw-loader!/_includes/code/typescript/quickstart.query.rag.ts";
+import GoCode from "!!raw-loader!/_includes/code/howto/go/docs/quickstart/3_2_rag/main.go";
+import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/RAG.java";
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+```bash
+# Best practice: store your credentials in environment variables
+# export WEAVIATE_URL="YOUR_INSTANCE_URL" # Your Weaviate instance URL
+# export WEAVIATE_API_KEY="YOUR_API_KEY" # Your Weaviate instance API key
+# export COHERE_APIKEY="YOUR_API_KEY" # Your Cohere API key
+
+echo '{
+ "query": "{
+ Get {
+ Question (
+ limit: 2
+ nearText: {
+ concepts: [\"biology\"],
+ }
+ ) {
+ question
+ answer
+ category
+ _additional {
+ generate(
+ groupedResult: {
+ task: \"\"\"
+ Write a tweet with emojis about this movie.
+ \"\"\"
+ }
+ ) {
+ groupedResult
+ error
+ }
+ }
+ }
+ }
+ }"
+}' | tr -d "\n" | curl \
+ -X POST \
+ -H 'Content-Type: application/json' \
+ -H "Authorization: Bearer $WEAVIATE_API_KEY" \
+ -H "X-Cohere-Api-Key: $COHERE_APIKEY" \
+ -d @- \
+ $WEAVIATE_URL/v1/graphql
+```
+
+
+
diff --git a/docs/weaviate/quickstart/index.md b/docs/weaviate/quickstart/index.md
index d2388e22..967a9280 100644
--- a/docs/weaviate/quickstart/index.md
+++ b/docs/weaviate/quickstart/index.md
@@ -4,82 +4,97 @@ image: og/docs/quickstart-tutorial.jpg
# tags: ['getting started']
---
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-import SkipLink from '/src/components/SkipValidationLink'
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+import SkipLink from "/src/components/SkipValidationLink";
import CardsSection from "/src/components/CardsSection";
+import Tooltip from "/src/components/Tooltip";
export const quickstartOptions = [
-{
-title: "Vectorize objects on import",
-description:
-"Import objects and vectorize them with the Weaviate Embeddings service.",
-link: "?import=vectorization#create-a-collection",
-icon: "fas fa-compress-alt",
-},
-{
-title: "Import custom vectors",
-description:
-"Import pre-computed vector embeddings.",
-link: "?import=custom-embeddings#create-a-collection",
-icon: "fas fa-puzzle-piece",
-},
+ {
+ title: "Vectorize objects during import",
+ description:
+ "Import objects and vectorize them with the Weaviate Embeddings service.",
+ link: "?import=vectorization",
+ icon: "fas fa-arrows-spin",
+ groupId: "import",
+ activeTab: "vectorization",
+ },
+ {
+ title: "Import vectors",
+ description: "Import pre-computed vector embeddings along with your data.",
+ link: "?import=custom-embeddings",
+ icon: "fas fa-circle-nodes",
+ groupId: "import",
+ activeTab: "custom-embeddings",
+ },
];
-
---
-
+
Weaviate is an open-source vector database built to power AI applications, from prototypes to production-scale systems. This quickstart guide will show you how to:
-1. **Import data** - Create a collection and import data into it. The data will be vectorized with the Weaviate Embeddings service.
-2. **Search** - Perform a similarity (vector) search on your data.
-3. **RAG** - Perform Retrieval augmented generation (RAG) with a generative model.
+1. **Create a collection & import data** - Create a collection and import data into it. The data will be vectorized with the Weaviate Embeddings service.
+2. **Search** - Perform a similarity (vector) search on your data using a text query.
+3. **RAG** - Perform Retrieval Augmented Generation (RAG) with a generative model.
-
+
Weaviate is an open-source vector database built to power AI applications, from prototypes to production-scale systems. This quickstart guide will show you how to:
-1. **Import data** - Create a collection and import data into it.
-2. **Search** - Perform a similarity (vector) search on your data.
-3. **RAG** - Perform Retrieval augmented generation (RAG) with a generative model.
+1. **Create a collection & import data**- Create a collection and import data into it. The data should already contain the vector embedding.
+2. **Search** - Perform a similarity (vector) search on your data using a vector query.
+3. **RAG** - Perform Retrieval Augmented Generation (RAG) with a generative model.
+import KapaAI from '/src/components/KapaAI';
+
+If you encounter any issues along the way or have additional questions, use the Ask AI feature.
## Prerequisites
-- A [Weaviate Cloud](https://console.weaviate.cloud/) Sandbox instance.
+A **[Weaviate Cloud](https://console.weaviate.cloud/)** Sandbox instance - you will need an admin **API key** and a **REST endpoint URL**. See the instructions below for more info.
How to set up a Weaviate Cloud Sandbox instance
Go to the [Weaviate Cloud console](https://console.weaviate.cloud) and create a free Sandbox instance as shown in the interactive example below.
-
-
-
+
:::note
@@ -101,24 +116,33 @@ After you create a Weaviate Cloud instance, you will need the:
You can retrieve them both from the [WCD console](https://console.weaviate.cloud) as shown in the interactive example below.
-
-
+
-
+
-
+
:::info REST vs gRPC endpoints
@@ -136,29 +160,29 @@ Once you have the **REST Endpoint URL** and the **admin API key**, you can conne
We recommend using a [client library](../client-libraries/index.mdx) to work with Weaviate. Follow the instructions below to install one of the official client libraries, available in [Python](../client-libraries/python/index.mdx), [JavaScript/TypeScript](../client-libraries/typescript/index.mdx), [Go](../client-libraries/go.md), and [Java](../client-libraries/java.md).
-import CodeClientInstall from '/\_includes/code/quickstart/clients.install.new.mdx';
+import CodeClientInstall from "/_includes/code/quickstart/clients.install.new.mdx";
-## Step 1: Create a collection {#create-a-collection}
+## Step 1: Create a collection & import data {#create-a-collection}
-Now, we can populate our database by first defining a collection and then adding data. You can either **[vectorize each object during the import](?import=vectorization#create-a-collection)** (we will use the Weaviate Embeddings service to vectorize the data), or you can **[import pre-computed vector embeddings](?import=custom-embeddings#create-a-collection)**.
+Now, we can populate our database by first defining a collection and then adding data. You can either **[vectorize each object during the import](?import=vectorization#create-a-collection)** (we will use the Weaviate Embeddings service to vectorize the data), or you can **[import pre-computed vector embeddings](?import=custom-embeddings#create-a-collection)**.
-
+
-The following example creates a _collection_ called `Question` with the [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service for creating vectors during ingestion and for querying.
+The following example creates a _collection_ called `Movie` with the [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service for creating vectors during ingestion and for querying.
-import CreateCollection from '/\_includes/code/quickstart/quickstart.create_populate_collection.mdx'
+import CreateCollection from "/_includes/code/quickstart/quickstart.short.create_collection.mdx";
-
+
-The following example creates a _collection_ called `Questions` and imports precomputed vector embeddings created with the [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service.
+The following example creates a _collection_ called `Movie` and imports precomputed vector embeddings created with the [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service.
-import CreateCollectionCustomVectors from '/\_includes/code/quickstart/quickstart.create_populate_collection_custom_vectors.mdx'
+import CreateCollectionCustomVectors from "/_includes/code/quickstart/quickstart.short.import_vectors.create_collection.mdx";
@@ -167,43 +191,96 @@ import CreateCollectionCustomVectors from '/\_includes/code/quickstart/quickstar
## Step 2: Semantic (vector) search {#semantic-search}
-Semantic search finds results based on meaning. This is called `nearText` in Weaviate. The following example searches for 2 objects (_limit_) whose meaning is most similar to that of `biology`.
+
+
+
+Semantic search finds results based on meaning. This is called `nearText` in Weaviate. The following example searches for 2 objects (_limit_) whose meaning is most similar to that of `sci-fi`.
-import QueryNearText from '/\_includes/code/quickstart/quickstart.query.neartext.mdx'
+import QueryNearText from "/_includes/code/quickstart/quickstart.short.query.neartext.mdx";
+
+
+
+Semantic search finds results based on meaning. This is called `nearText` in Weaviate. The following example searches for 2 objects (_limit_) whose meaning is most similar to that of `sci-fi`.
+
+import QueryNearTextImportVectors from "/_includes/code/quickstart/quickstart.short.import_vectors.query.nearvector.mdx";
+
+
+
+
+
+
## Step 3: Retrieval augmented generation (RAG)
-
-
+:::note
+For Retrieval Augmented Generation (RAG) in the last step, you will need a [Claude](https://console.anthropic.com/settings/keys) API key. You can also use another [model provider](/weaviate/model-providers) instead.
+:::
-- For Retrieval Augmented Generation (RAG) in the last step, you will need a [Claude](https://console.anthropic.com/settings/keys) API key. You can also use another [model provider](/weaviate/model-providers) instead.
+
+
Retrieval augmented generation (RAG), also called generative search, works by prompting a large language model (LLM) with a combination of a _user query_ and _data retrieved from a database_.
-The following example combines the same search (for `biology`) with a prompt to generate a tweet.
+The following example combines the same search (for `sci-fi`) with a prompt to generate a tweet.
-import QueryRAG from '/\_includes/code/quickstart/quickstart.query.rag.mdx'
+import QueryRAG from "/_includes/code/quickstart/quickstart.short.query.rag.mdx";
-
-
-- For Retrieval Augmented Generation (RAG) in the last step, you will need a [Claude](https://console.anthropic.com/settings/keys) API key. You can also use another [model provider](/weaviate/model-providers) instead.
+
Retrieval augmented generation (RAG), also called generative search, works by prompting a large language model (LLM) with a combination of a _user query_ and _data retrieved from a database_.
-The following example combines the same search (for `biology`) with a prompt to generate a tweet.
+The following example combines the same search (for `sci-fi`) with a prompt to generate a tweet.
+
+import QueryRAGCustomVectors from "/_includes/code/quickstart/quickstart.short.import-vectors.query.rag.mdx";
+
+
## Next steps
+We recommend you check out the following resources to get started with Weaviate.
+
+import styles from "/src/components/CardsSection/styles.module.scss";
+
+export const nextStepsCardsData = [
+ {
+ title: "Quick tour of Weaviate",
+ description: (
+ <>
+ Continue with the{" "}
+ Quick tour tutorial â an
+ end-to-end guide that cover important topics like configuring
+ collections, searches, etc.
+ >
+ ),
+ link: "/weaviate/tutorials/quick-tour-of-weaviate",
+ icon: "fas fa-signs-post",
+ },
+ {
+ title: "Weaviate Academy",
+ description: (
+ <>
+ Check out Weaviate Academy â a
+ learning platform entered around AI-native development.
+ >
+ ),
+ link: "https://academy.weaviate.io/",
+ icon: "fa-solid fa-graduation-cap",
+ },
+];
+
+
+
+
## Questions and feedback
-import DocsFeedback from '/\_includes/docs-feedback.mdx';
+import DocsFeedback from "/_includes/docs-feedback.mdx";
-
+
diff --git a/docs/weaviate/tutorials/index.mdx b/docs/weaviate/tutorials/index.mdx
index b2996f97..bee55ba0 100644
--- a/docs/weaviate/tutorials/index.mdx
+++ b/docs/weaviate/tutorials/index.mdx
@@ -17,6 +17,17 @@ Here, you can learn how to:
import CardsSection from "/src/components/CardsSection";
export const advancedFeaturesData = [
+ {
+ title: "Quick tour of Weaviate",
+ description: (
+ <>
+ End-to-end guide that cover important topics like configuring
+ collections, compression, etc.
+ >
+ ),
+ link: "/weaviate/quickstart",
+ icon: "fas fa-signs-post",
+ },
{
title: "Use Multi-Vector Embeddings (ColBERT, etc.)",
description:
diff --git a/docs/weaviate/tutorials/quick-tour-of-weaviate.mdx b/docs/weaviate/tutorials/quick-tour-of-weaviate.mdx
new file mode 100644
index 00000000..5f2c193a
--- /dev/null
+++ b/docs/weaviate/tutorials/quick-tour-of-weaviate.mdx
@@ -0,0 +1,437 @@
+---
+title: Quick tour of Weaviate
+image: og/docs/quickstart-tutorial.jpg
+---
+
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+import SkipLink from "/src/components/SkipValidationLink";
+
+Expected time: 30 minutes
+Prerequisites: None
+
+
+
+
+:::info What you will learn
+
+This quickstart shows you how to combine Weaviate Cloud and Cohere to:
+
+1. Set up a Weaviate instance. (10 minutes)
+1. Add and vectorize your data. (10 minutes)
+1. Perform a semantic search and retrieval augmented generation (RAG). (10 minutes)
+
+```mermaid
+flowchart LR
+ %% Define nodes with white backgrounds and darker borders
+ A1["Create Weaviate Sandbox"] --> A2["Install client library"]
+ A2 --> A3["Connect to Weaviate"]
+ A3 --> B1["Define collection (with an inference API)"]
+ B1 --> B2["Batch import objects"]
+ B2 --> C1["Semantic search (nearText)"]
+ C1 --> C2["RAG (Generate)"]
+
+ %% Group nodes in subgraphs with brand colors
+ subgraph sg1 ["1\. Setup"]
+ A1
+ A2
+ A3
+ end
+
+ subgraph sg2 ["2\. Populate"]
+ B1
+ B2
+ end
+
+ subgraph sg3 ["3\. Query"]
+ C1
+ C2
+ end
+
+ %% Style nodes with white background and darker borders
+ style A1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
+ style A2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
+ style A3 fill:#ffffff,stroke:#B9C8DF,color:#130C49
+ style B1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
+ style B2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
+ style C1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
+ style C2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
+
+ %% Style subgraphs with brand colors
+ style sg1 fill:#ffffff,stroke:#61BD73,stroke-width:2px,color:#130C49
+ style sg2 fill:#ffffff,stroke:#130C49,stroke-width:2px,color:#130C49
+ style sg3 fill:#ffffff,stroke:#7AD6EB,stroke-width:2px,color:#130C49
+```
+
+Notes:
+
+- The code examples here are self-contained. You can copy and paste them into your own environment to try them out.
+
+
+:::
+
+
+
+### Requirements
+
+In order to perform Retrieval Augmented Generation (RAG) in the last step, you will need a [Cohere](https://dashboard.cohere.com/) account. You can use a free Cohere trial API key.
+
+If you have another preferred [model provider](/weaviate/model-providers), you can use that instead of Cohere.
+
+
+
+## Step 1: Set up Weaviate
+
+### 1.1 Create a Weaviate database
+
+Go to the [Weaviate Cloud console](https://console.weaviate.cloud) and create a free Sandbox instance.
+
+
+
+
+
+
+
+
+:::note
+
+- Cluster provisioning typically takes 1-3 minutes.
+- When the cluster is ready, Weaviate Cloud displays a checkmark (`âïļ`) next to the cluster name.
+- Note that Weaviate Cloud adds a random suffix to sandbox cluster names to ensure uniqueness.
+
+:::
+
+import LatestWeaviateVersion from "/_includes/latest-weaviate-version.mdx";
+
+
+
+### 1.2 Install a client library
+
+We recommend using a [client library](../client-libraries/index.mdx) to work with Weaviate. Follow the instructions below to install one of the official client libraries, available in [Python](../client-libraries/python/index.mdx), [JavaScript/TypeScript](../client-libraries/typescript/index.mdx), [Go](../client-libraries/go.md), and [Java](../client-libraries/java.md).
+
+import CodeClientInstall from "/_includes/code/quickstart/clients.install.mdx";
+
+
+
+### 1.3 Connect to Weaviate
+
+Now you can connect to your Weaviate instance. You will need the:
+
+- **REST Endpoint URL** and the
+- **Administrator API Key**.
+
+You can retrieve them both from the [WCD console](https://console.weaviate.cloud) as shown in the interactive example below.
+
+:::note
+
+New clusters with Weaviate version `v1.30` (or later) have [RBAC (Role-Based Access Control)](/weaviate/configuration/rbac/index.mdx) enabled by default. These clusters don't come with API keys, you will need to create an API key yourself and assign it a role (`admin`, `viewer` or a custom role).
+
+:::
+
+
+
+
+
+
+
+
+:::info REST vs gRPC endpoints
+
+Weaviate supports both REST and gRPC protocols. For Weaviate Cloud deployments, you only need to provide the REST endpoint URL - the client will automatically configure gRPC.
+
+:::
+
+Once you have the **REST Endpoint URL** and the **admin API key**, you can connect to the Sandbox instance, and work with Weaviate.
+
+The example below shows how to connect to Weaviate and perform a basic operation, like checking the cluster status.
+
+import ConnectIsReady from "/_includes/code/quickstart/quickstart.is_ready.mdx";
+
+
+
+If you did not see any errors, you are ready to proceed. We will replace the simple cluster status check with more meaningful operations in the next steps.
+
+
+
+## Step 2: Populate the database
+
+Now, we can populate our database by first defining a collection and then adding data.
+
+### 2.1 Define a collection
+
+:::info What is a collection?
+
+A collection is a set of objects that share the same data structure, like a table in relational databases or a collection in NoSQL databases. A collection also includes additional configurations that define how the data objects are stored and indexed.
+
+:::
+
+The following example creates a _collection_ called `Question` with:
+
+- The [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service for creating vectors during ingestion & queries.
+
+import CreateCollection from "/_includes/code/quickstart/quickstart.create_collection.mdx";
+
+
+
+Run this code to create the collection to which you can add data.
+
+import ModelProvider from "/_includes/embedding-model-providers.mdx";
+
+
+ Do you prefer a different setup?
+
+
+
+### 2.2 Add objects
+
+We can now add data to our collection.
+
+The following example:
+
+- Loads objects, and
+- Adds objects to the target collection (`Question`) using a batch process.
+
+:::tip Batch imports
+
+([Batch imports](../manage-objects/import.mdx)) are the most efficient way to add large amounts of data, as it sends multiple objects in a single request. See the [How-to: Batch import](../manage-objects/import.mdx) guide for more information.
+
+:::
+
+import ImportObjects from "/_includes/code/quickstart/quickstart.import_objects.mdx";
+
+
+
+Run this code to add the demo data.
+
+
+
+## Step 3: Queries
+
+Weaviate provides a wide range of query tools to help you find the right data. We will try a few searches here.
+
+### 3.1 Semantic search {#semantic-search}
+
+Semantic search finds results based on meaning. This is called `nearText` in Weaviate.
+
+The following example searches for 2 objects whose meaning is most similar to that of `biology`.
+
+import QueryNearText from "/_includes/code/quickstart/quickstart.query.neartext.mdx";
+
+
+
+Run this code to perform the query. Our query found entries for `DNA` and `species`.
+
+
+ Example full response in JSON format
+
+```json
+{
+ {
+ "answer": "DNA",
+ "question": "In 1953 Watson & Crick built a model of the molecular structure of this, the gene-carrying substance",
+ "category": "SCIENCE"
+ },
+ {
+ "answer": "species",
+ "question": "2000 news: the Gunnison sage grouse isn't just another northern sage grouse, but a new one of this classification",
+ "category": "SCIENCE"
+ }
+}
+```
+
+
+
+If you inspect the full response, you will see that the word `biology` does not appear anywhere.
+
+Even so, Weaviate was able to return biology-related entries. This is made possible by _vector embeddings_ that capture meaning. Under the hood, semantic search is powered by vectors, or vector embeddings.
+
+Here is a diagram showing the workflow in Weaviate.
+
+```mermaid
+flowchart LR
+ Query["ð Search: 'biology'"]
+
+ subgraph sg1 ["Vector Search"]
+ direction LR
+ VS1["Convert query to vector"] --> VS2["Find similar vectors"]
+ VS2 --> VS3["Return top matches"]
+ end
+
+ subgraph sg2 ["Results"]
+ R1["Most similar documents"]
+ end
+
+ Query --> VS1
+ VS3 --> R1
+
+ %% Style nodes with white background and darker borders
+ style Query fill:#ffffff,stroke:#B9C8DF,color:#130C49
+ style VS1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
+ style VS2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
+ style VS3 fill:#ffffff,stroke:#B9C8DF,color:#130C49
+ style R1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
+
+ %% Style subgraphs with brand colors
+ style sg1 fill:#ffffff,stroke:#61BD73,stroke-width:2px,color:#130C49
+ style sg2 fill:#ffffff,stroke:#130C49,stroke-width:2px,color:#130C49
+```
+
+:::info Where did the vectors come from?
+
+Weaviate used the **Weaviate Embeddings** service to generate a vector embedding for each object during import. During the query, Weaviate similarly converted the query (`biology`) into a vector.
+
+As we mentioned above, this is optional. See [Starter Guide: Bring Your Own Vectors](/weaviate/starter-guides/custom-vectors.mdx) if you would prefer to provide your own vectors.
+
+:::
+
+:::tip More search types available
+
+Weaviate is capable of many types of searches. See, for example, our how-to guides on [similarity searches](../search/similarity.md), [keyword searches](../search/bm25.md), [hybrid searches](../search/hybrid.md), and [filtered searches](../search/filters.md).
+
+:::
+
+### 3.2 Retrieval augmented generation
+
+Retrieval augmented generation (RAG), also called generative search, combines the power of generative AI models such as large language models (LLMs) with the up-to-date truthfulness of a database.
+
+RAG works by prompting a large language model (LLM) with a combination of a _user query_ and _data retrieved from a database_.
+
+This diagram shows the RAG workflow in Weaviate.
+
+```mermaid
+flowchart LR
+ subgraph sg0 ["Weaviate Query"]
+ direction TB
+ Search["ð Search: 'biology'"]
+ Prompt["âïļ Prompt: 'Write a tweet...'"]
+ end
+
+ subgraph sg1 ["Vector Search"]
+ direction LR
+ VS1["Convert query to vector"] --> VS2["Find similar vectors"]
+ VS2 --> VS3["Return top matches"]
+ end
+
+ subgraph sg2 ["Generation"]
+ direction LR
+ G1["Send (results + prompt) to LLM"]
+ G1 --> G2["Generate response"]
+ end
+
+ subgraph sg3 ["Results"]
+ direction TB
+ R1["Most similar documents"]
+ R2["Generated content"]
+ end
+
+ Search --> VS1
+ VS3 --> R1
+ Prompt --> G1
+ VS3 --> G1
+ G2 --> R2
+
+ %% Style nodes with white background and darker borders
+ style Search fill:#ffffff,stroke:#B9C8DF,color:#130C49
+ style Prompt fill:#ffffff,stroke:#B9C8DF,color:#130C49
+ style VS1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
+ style VS2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
+ style VS3 fill:#ffffff,stroke:#B9C8DF,color:#130C49
+ style G1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
+ style G2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
+ style R1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
+ style R2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
+
+ %% Style subgraphs with brand colors
+ style sg0 fill:#ffffff,stroke:#130C49,stroke-width:2px,color:#130C49
+ style sg1 fill:#ffffff,stroke:#61BD73,stroke-width:2px,color:#130C49
+ style sg2 fill:#ffffff,stroke:#7AD6EB,stroke-width:2px,color:#130C49
+ style sg3 fill:#ffffff,stroke:#130C49,stroke-width:2px,color:#130C49
+```
+
+The following example combines the same search (for `biology`) with a prompt to generate a tweet.
+
+import QueryRAG from "/_includes/code/quickstart/quickstart.query.rag.mdx";
+
+
+
+:::info Cohere API key in the header
+
+Note that this code includes an additional header for the Cohere API key. Weaviate uses this key to access the Cohere generative AI model and perform retrieval augmented generation (RAG).
+
+:::
+
+Run this code to perform the query. Here is one possible response (your response will likely be different).
+
+```text
+ð§Ž In 1953 Watson & Crick built a model of the molecular structure of DNA, the gene-carrying substance! ð§ŽðŽ
+
+ðĶĒ 2000 news: the Gunnison sage grouse isn't just another northern sage grouse, but a new species! ðĶĒðŋ #ScienceFacts #DNA #SpeciesClassification
+```
+
+The response should be new, yet familiar. This is because you have seen the entries above for `DNA` and `species` in the [semantic search](#semantic-search) section.
+
+The power of RAG comes from the ability to transform your own data. Weaviate helps you in this journey by making it easy to perform a combined search & generation in just a few lines of code.
+
+
+
+## Recap
+
+In this quickstart guide, you:
+
+- Created a Serverless Weaviate sandbox instance on Weaviate Cloud.
+- Defined a collection and added data.
+- Performed queries, including:
+ - Semantic search, and
+ - Retrieval augmented generation.
+
+Where to go next is up to you. We include some suggested steps and resources below.
+
+
+
+## Questions and feedback
+
+import DocsFeedback from "/_includes/docs-feedback.mdx";
+
+
diff --git a/sidebars.js b/sidebars.js
index 0885fce3..45d1179a 100644
--- a/sidebars.js
+++ b/sidebars.js
@@ -527,6 +527,7 @@ const sidebars = {
id: "weaviate/tutorials/index",
},
items: [
+ "weaviate/tutorials/quick-tour-of-weaviate",
"weaviate/tutorials/multi-vector-embeddings",
"weaviate/tutorials/vectorizer-migration",
"weaviate/tutorials/import",
diff --git a/src/components/CardsSection/index.jsx b/src/components/CardsSection/index.jsx
index 027d8f62..dec3cc90 100644
--- a/src/components/CardsSection/index.jsx
+++ b/src/components/CardsSection/index.jsx
@@ -1,5 +1,6 @@
import React from "react";
import Link from "@docusaurus/Link";
+import { useLocation } from "@docusaurus/router";
import styles from "./styles.module.scss";
const CardsSection = ({
@@ -8,36 +9,56 @@ const CardsSection = ({
recipeCards = false,
smallCards = false,
}) => {
+ const location = useLocation();
+
+ // Parse URL query parameters
+ const searchParams = new URLSearchParams(location.search);
+
+ // Get all query parameters to check against activeTab
+ const getCurrentTab = (groupId) => {
+ return searchParams.get(groupId);
+ };
+
return (
);
};
diff --git a/src/components/CardsSection/styles.module.scss b/src/components/CardsSection/styles.module.scss
index a35978d4..3dac157d 100644
--- a/src/components/CardsSection/styles.module.scss
+++ b/src/components/CardsSection/styles.module.scss
@@ -66,7 +66,7 @@
font-weight: 500;
padding: 4px 8px;
border-radius: 4px;
- border: var(--site-primary-dark) 1px solid;;
+ border: var(--site-primary-dark) 1px solid;
white-space: nowrap;
}
}
@@ -114,3 +114,17 @@
color: var(--site-font-accent-color);
font-weight: 600;
}
+
+.activeCard {
+ border: 2px solid var(--site-accent) !important;
+ background: var(--docs-cards-hover-bg) !important;
+ box-shadow: 0px 10px 20px 0px rgba(22, 27, 45, 0.15) !important;
+
+ .cardHeader {
+ color: var(--site-accent);
+ }
+
+ .cardTitle {
+ color: var(--site-accent);
+ }
+}
\ No newline at end of file
diff --git a/src/components/KapaAI/index.jsx b/src/components/KapaAI/index.jsx
new file mode 100644
index 00000000..4cecc449
--- /dev/null
+++ b/src/components/KapaAI/index.jsx
@@ -0,0 +1,19 @@
+import React from "react";
+import styles from "./styles.module.scss";
+
+export default function KapaAI({ children, query = "" }) {
+ const handleClick = (e) => {
+ e.preventDefault();
+ window.Kapa.open({
+ mode: "ai",
+ query: query,
+ submit: false,
+ });
+ };
+
+ return (
+
+ );
+}
diff --git a/src/components/KapaAI/styles.module.scss b/src/components/KapaAI/styles.module.scss
new file mode 100644
index 00000000..42d58cf4
--- /dev/null
+++ b/src/components/KapaAI/styles.module.scss
@@ -0,0 +1,50 @@
+.kapaAiLink {
+ background: transparent;
+ border: none;
+ color: var(--site-primary, var(--ifm-color-primary));
+ cursor: pointer;
+ padding: 0.25rem 0.5rem;
+ margin: 0 0.125rem;
+ font: inherit;
+ display: inline-flex;
+ align-items: center;
+ gap: 0.25rem;
+ border-radius: 0.25rem;
+ text-decoration: none;
+ font-weight: 500;
+ transition: all 0.2s ease-in-out;
+ position: relative;
+
+ // Subtle underline effect
+ &::after {
+ content: "";
+ position: absolute;
+ bottom: 0.125rem;
+ left: 0.5rem;
+ right: 0.5rem;
+ height: 1px;
+ background-color: currentColor;
+ opacity: 0.4;
+ transition: opacity 0.2s ease-in-out;
+ }
+
+ &:hover {
+ background-color: var(--ifm-hover-overlay);
+ transform: translateY(-1px);
+ color: var(--site-primary, var(--ifm-color-primary));
+
+ &::after {
+ opacity: 0.8;
+ }
+ }
+
+ &:active {
+ transform: translateY(0);
+ }
+
+ &:focus {
+ outline: 2px solid var(--ifm-color-primary);
+ outline-offset: 2px;
+ border-radius: 0.25rem;
+ }
+}
From 9cc6786deb24ee8532d5815aff58cdf80d99f462 Mon Sep 17 00:00:00 2001
From: Ivan Despot <66276597+g-despot@users.noreply.github.com>
Date: Wed, 22 Oct 2025 09:18:14 +0200
Subject: [PATCH 03/16] Update docs
---
.../quickstart.short.create_collection.py | 11 ++--
....short.import_vectors.create_collection.py | 39 +++++-------
...t.short.import_vectors.query.nearvector.py | 14 ++---
...ickstart.short.import_vectors.query.rag.py | 23 +++----
.../python/quickstart.short.query.neartext.py | 14 ++---
.../code/python/quickstart.short.query.rag.py | 21 ++++---
docs/weaviate/quickstart/index.md | 57 +++++++++++++----
.../tutorials/quick-tour-of-weaviate.mdx | 61 ++++++++-----------
8 files changed, 128 insertions(+), 112 deletions(-)
diff --git a/_includes/code/python/quickstart.short.create_collection.py b/_includes/code/python/quickstart.short.create_collection.py
index e033cdca..2165ba8e 100644
--- a/_includes/code/python/quickstart.short.create_collection.py
+++ b/_includes/code/python/quickstart.short.create_collection.py
@@ -25,12 +25,11 @@
movies = client.collections.create(
name="Movie",
vector_config=Configure.Vectors.text2vec_weaviate(), # Configure the Weaviate Embeddings vectorizer
- # You can also use auto-schema, here we define the schema manually
properties=[
Property(name="title", data_type=DataType.TEXT),
Property(name="description", data_type=DataType.TEXT),
Property(name="genre", data_type=DataType.TEXT),
- ],
+ ], # You can also use auto-schema, here we define the schema manually
)
# highlight-end
# START CreateCollection
@@ -40,9 +39,9 @@
# START CreateCollection
# Step 1.3: Import three objects
data_objects = [
- {"properties": {"title": "The Matrix", "description": "A computer hacker learns about the true nature of reality and his role in the war against its controllers.", "genre": "Science Fiction"}},
- {"properties": {"title": "Spirited Away", "description": "A young girl becomes trapped in a mysterious world of spirits and must find a way to save her parents and return home.", "genre": "Animation"}},
- {"properties": {"title": "The Lord of the Rings: The Fellowship of the Ring", "description": "A meek Hobbit and his companions set out on a perilous journey to destroy a powerful ring and save Middle-earth.", "genre": "Fantasy"}},
+ {"title": "The Matrix", "description": "A computer hacker learns about the true nature of reality and his role in the war against its controllers.", "genre": "Science Fiction"},
+ {"title": "Spirited Away", "description": "A young girl becomes trapped in a mysterious world of spirits and must find a way to save her parents and return home.", "genre": "Animation"},
+ {"title": "The Lord of the Rings: The Fellowship of the Ring", "description": "A meek Hobbit and his companions set out on a perilous journey to destroy a powerful ring and save Middle-earth.", "genre": "Fantasy"},
]
# END CreateCollection
# fmt: on
@@ -53,7 +52,7 @@
for obj in data_objects:
batch.add_object(properties=obj)
-print(f"Imported {len(movies)} objects into the Movie collection")
+print(f"Imported & vectorized {len(movies)} objects into the Movie collection")
client.close() # Free up resources
# END CreateCollection
diff --git a/_includes/code/python/quickstart.short.import_vectors.create_collection.py b/_includes/code/python/quickstart.short.import_vectors.create_collection.py
index 4a4b030d..bc0c1da4 100644
--- a/_includes/code/python/quickstart.short.import_vectors.create_collection.py
+++ b/_includes/code/python/quickstart.short.import_vectors.create_collection.py
@@ -17,53 +17,46 @@
# END CreateCollection
# NOT SHOWN TO THE USER - DELETE EXISTING COLLECTION
-client.collections.delete("Question")
+client.collections.delete("Movie")
# START CreateCollection
# Step 1.2: Create a collection
# highlight-start
-questions = client.collections.create(
- name="Question",
+movies = client.collections.create(
+ name="Movie",
vector_config=Configure.Vectors.self_provided(), # No automatic vectorization since we're providing vectors
properties=[
- Property(name="question", data_type=DataType.TEXT),
- Property(name="answer", data_type=DataType.TEXT),
- Property(name="category", data_type=DataType.TEXT),
- ],
+ Property(name="title", data_type=DataType.TEXT),
+ Property(name="description", data_type=DataType.TEXT),
+ Property(name="genre", data_type=DataType.TEXT),
+ ], # You can also use auto-schema, here we define the schema manually
)
# highlight-end
# START CreateCollection
-# Import three hardcoded objects with their vectors
# END CreateCollection
# fmt: off
# START CreateCollection
# Step 1.3: Import three objects
data_objects = [
- {
- "properties": {"title": "The Matrix", "description": "A computer hacker learns about the true nature of reality and his role in the war against its controllers.", "genre": "Science Fiction"},
- "vector": [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]
- },
- {
- "properties": {"title": "Spirited Away", "description": "A young girl becomes trapped in a mysterious world of spirits and must find a way to save her parents and return home.", "genre": "Animation"},
- "vector": [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]
- },
- {
- "properties": {"title": "The Lord of the Rings: The Fellowship of the Ring", "description": "A meek Hobbit and his companions set out on a perilous journey to destroy a powerful ring and save Middle-earth.", "genre": "Fantasy"},
- "vector": [0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]
- }
+ {"properties": {"title": "The Matrix", "description": "A computer hacker learns about the true nature of reality and his role in the war against its controllers.", "genre": "Science Fiction"},
+ "vector": [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]},
+ {"properties": {"title": "Spirited Away", "description": "A young girl becomes trapped in a mysterious world of spirits and must find a way to save her parents and return home.", "genre": "Animation"},
+ "vector": [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]},
+ {"properties": {"title": "The Lord of the Rings: The Fellowship of the Ring", "description": "A meek Hobbit and his companions set out on a perilous journey to destroy a powerful ring and save Middle-earth.", "genre": "Fantasy"},
+ "vector": [0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]}
]
# END CreateCollection
# fmt: on
# START CreateCollection
# Insert the objects with vectors
-questions = client.collections.get("Question")
-with questions.batch.dynamic() as batch:
+movies = client.collections.get("Movie")
+with movies.batch.dynamic() as batch:
for obj in data_objects:
batch.add_object(properties=obj["properties"], vector=obj["vector"])
-print(f"Imported {len(data_objects)} objects with vectors into the Question collection")
+print(f"Imported {len(data_objects)} objects with vectors into the Movie collection")
client.close() # Free up resources
# END CreateCollection
diff --git a/_includes/code/python/quickstart.short.import_vectors.query.nearvector.py b/_includes/code/python/quickstart.short.import_vectors.query.nearvector.py
index d87db6ab..71a9cc84 100644
--- a/_includes/code/python/quickstart.short.import_vectors.query.nearvector.py
+++ b/_includes/code/python/quickstart.short.import_vectors.query.nearvector.py
@@ -7,24 +7,24 @@
weaviate_url = os.environ["WEAVIATE_URL"]
weaviate_api_key = os.environ["WEAVIATE_API_KEY"]
+# Step 2.1: Connect to your Weaviate Cloud instance
client = weaviate.connect_to_weaviate_cloud(
- cluster_url=weaviate_url, # Replace with your Weaviate Cloud URL
- auth_credentials=Auth.api_key(
- weaviate_api_key
- ), # Replace with your Weaviate Cloud key
+ cluster_url=weaviate_url,
+ auth_credentials=Auth.api_key(weaviate_api_key),
)
+# Step 2.2: Use this collection
movies = client.collections.use("Movie")
+# Step 2.3: Perform a vector search with NearVector
# highlight-start
response = movies.query.near_vector(
- near_vector=[0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9],
- limit=2
+ near_vector=[0.11, 0.21, 0.31, 0.41, 0.51, 0.61, 0.71, 0.81], limit=2
)
# highlight-end
for obj in response.objects:
- print(json.dumps(obj.properties, indent=2))
+ print(json.dumps(obj.properties, indent=2)) # Inspect the results
client.close() # Free up resources
# END NearText
diff --git a/_includes/code/python/quickstart.short.import_vectors.query.rag.py b/_includes/code/python/quickstart.short.import_vectors.query.rag.py
index 4728c269..c419d1e4 100644
--- a/_includes/code/python/quickstart.short.import_vectors.query.rag.py
+++ b/_includes/code/python/quickstart.short.import_vectors.query.rag.py
@@ -8,30 +8,31 @@
# Best practice: store your credentials in environment variables
weaviate_url = os.environ["WEAVIATE_URL"]
weaviate_api_key = os.environ["WEAVIATE_API_KEY"]
-openai_api_key = os.environ["OPENAI_APIKEY"]
+anthropic_api_key = os.environ["ANTHROPIC_API_KEY"]
+# Step 2.1: Connect to your Weaviate Cloud instance
client = weaviate.connect_to_weaviate_cloud(
- cluster_url=weaviate_url, # Replace with your Weaviate Cloud URL
- auth_credentials=Auth.api_key(
- weaviate_api_key
- ), # Replace with your Weaviate Cloud key
+ cluster_url=weaviate_url,
+ auth_credentials=Auth.api_key(weaviate_api_key),
# highlight-start
- headers={"X-OpenAI-Api-Key": openai_api_key}, # Replace with your OpenAI API key
+ headers={"X-Anthropic-Api-Key": anthropic_api_key},
# highlight-end
)
-questions = client.collections.use("Question")
+# Step 2.2: Use this collection
+movies = client.collections.use("Movie")
+# Step 2.3: Perform RAG with on NearVector results
# highlight-start
-response = questions.generate.near_vector(
- near_vector=[0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9],
+response = movies.generate.near_vector(
+ near_vector=[0.11, 0.21, 0.31, 0.41, 0.51, 0.61, 0.71, 0.81],
limit=1,
grouped_task="Write a tweet with emojis about this movie.",
- generative_provider=GenerativeConfig.openai(), # Configure the OpenAI generative integration for RAG
+ generative_provider=GenerativeConfig.anthropic(), # Configure the Anthropic generative integration for RAG
)
# highlight-end
-print(response.generative.text) # Inspect the generated text
+print(response.generative.text) # Inspect the results
client.close() # Free up resources
# END RAG
diff --git a/_includes/code/python/quickstart.short.query.neartext.py b/_includes/code/python/quickstart.short.query.neartext.py
index 24045840..71a3409b 100644
--- a/_includes/code/python/quickstart.short.query.neartext.py
+++ b/_includes/code/python/quickstart.short.query.neartext.py
@@ -7,22 +7,22 @@
weaviate_url = os.environ["WEAVIATE_URL"]
weaviate_api_key = os.environ["WEAVIATE_API_KEY"]
+# Step 2.1: Connect to your Weaviate Cloud instance
client = weaviate.connect_to_weaviate_cloud(
- cluster_url=weaviate_url, # Replace with your Weaviate Cloud URL
- auth_credentials=Auth.api_key(weaviate_api_key), # Replace with your Weaviate Cloud key
+ cluster_url=weaviate_url,
+ auth_credentials=Auth.api_key(weaviate_api_key),
)
+# Step 2.2: Use this collection
movies = client.collections.use("Movie")
+# Step 2.3: Perform a semantic search with NearText
# highlight-start
-response = movies.query.near_text(
- query="sci-fi",
- limit=2
-)
+response = movies.query.near_text(query="sci-fi", limit=2)
# highlight-end
for obj in response.objects:
- print(json.dumps(obj.properties, indent=2))
+ print(json.dumps(obj.properties, indent=2)) # Inspect the results
client.close() # Free up resources
# END NearText
diff --git a/_includes/code/python/quickstart.short.query.rag.py b/_includes/code/python/quickstart.short.query.rag.py
index de931a7f..8e373479 100644
--- a/_includes/code/python/quickstart.short.query.rag.py
+++ b/_includes/code/python/quickstart.short.query.rag.py
@@ -8,30 +8,31 @@
# Best practice: store your credentials in environment variables
weaviate_url = os.environ["WEAVIATE_URL"]
weaviate_api_key = os.environ["WEAVIATE_API_KEY"]
-openai_api_key = os.environ["OPENAI_APIKEY"]
+anthropic_api_key = os.environ["ANTHROPIC_API_KEY"]
+# Step 2.1: Connect to your Weaviate Cloud instance
client = weaviate.connect_to_weaviate_cloud(
- cluster_url=weaviate_url, # Replace with your Weaviate Cloud URL
- auth_credentials=Auth.api_key(
- weaviate_api_key
- ), # Replace with your Weaviate Cloud key
+ cluster_url=weaviate_url,
+ auth_credentials=Auth.api_key(weaviate_api_key),
# highlight-start
- headers={"X-OpenAI-Api-Key": openai_api_key}, # Replace with your OpenAI API key
+ headers={"X-Anthropic-Api-Key": anthropic_api_key},
# highlight-end
)
-questions = client.collections.use("Question")
+# Step 2.2: Use this collection
+movies = client.collections.use("Movie")
+# Step 2.3: Perform RAG with on NearText results
# highlight-start
-response = questions.generate.near_text(
+response = movies.generate.near_text(
query="sci-fi",
limit=1,
grouped_task="Write a tweet with emojis about this movie.",
- generative_provider=GenerativeConfig.openai(), # Configure the OpenAI generative integration for RAG
+ generative_provider=GenerativeConfig.anthropic(), # Configure the Anthropic generative integration for RAG
)
# highlight-end
-print(response.generative.text) # Inspect the generated text
+print(response.generative.text) # Inspect the results
client.close() # Free up resources
# END RAG
diff --git a/docs/weaviate/quickstart/index.md b/docs/weaviate/quickstart/index.md
index 967a9280..9aa44dd6 100644
--- a/docs/weaviate/quickstart/index.md
+++ b/docs/weaviate/quickstart/index.md
@@ -40,7 +40,7 @@ export const quickstartOptions = [
Weaviate is an open-source vector database built to power AI applications, from prototypes to production-scale systems. This quickstart guide will show you how to:
-1. **Create a collection & import data** - Create a collection and import data into it. The data will be vectorized with the Weaviate Embeddings service.
+1. **Create a collection & import data** - Create a collection and import data into it. The data will be vectorized with the Weaviate Embeddings service.
2. **Search** - Perform a similarity (vector) search on your data using a text query.
3. **RAG** - Perform Retrieval Augmented Generation (RAG) with a generative model.
@@ -49,7 +49,7 @@ Weaviate is an open-source vector database built to power AI applications, from
Weaviate is an open-source vector database built to power AI applications, from prototypes to production-scale systems. This quickstart guide will show you how to:
-1. **Create a collection & import data**- Create a collection and import data into it. The data should already contain the vector embedding.
+1. **Create a collection & import data**- Create a collection and import data into it. The data should already contain the pre-computed vector embeddings.
2. **Search** - Perform a similarity (vector) search on your data using a vector query.
3. **RAG** - Perform Retrieval Augmented Generation (RAG) with a generative model.
@@ -61,7 +61,7 @@ import KapaAI from '/src/components/KapaAI';
If you encounter any issues along the way or have additional questions, use the Ask AI feature.
## Prerequisites
-A **[Weaviate Cloud](https://console.weaviate.cloud/)** Sandbox instance - you will need an admin **API key** and a **REST endpoint URL**. See the instructions below for more info.
+A **[Weaviate Cloud](https://console.weaviate.cloud/)** Sandbox instance - you will need an admin **API key** and a **REST endpoint URL** to connect to your instance. See the instructions below for more info.
How to set up a Weaviate Cloud Sandbox instance
@@ -171,7 +171,7 @@ Now, we can populate our database by first defining a
-The following example creates a _collection_ called `Movie` with the [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service for creating vectors during ingestion and for querying.
+The following example creates a collection called `Movie` with the [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service for creating vectors during ingestion and for querying.
import CreateCollection from "/_includes/code/quickstart/quickstart.short.create_collection.mdx";
@@ -180,7 +180,7 @@ import CreateCollection from "/_includes/code/quickstart/quickstart.short.create
-The following example creates a _collection_ called `Movie` and imports precomputed vector embeddings created with the [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service.
+The following example creates a collection called `Movie` and imports pre-computed vectors along with the movie data.
import CreateCollectionCustomVectors from "/_includes/code/quickstart/quickstart.short.import_vectors.create_collection.mdx";
@@ -203,15 +203,34 @@ import QueryNearText from "/_includes/code/quickstart/quickstart.short.query.nea
-Semantic search finds results based on meaning. This is called `nearText` in Weaviate. The following example searches for 2 objects (_limit_) whose meaning is most similar to that of `sci-fi`.
+Semantic search finds results based on meaning. This is called `nearVector` in Weaviate. The following example searches for 2 objects (_limit_) whose vector is most similar to the query vector.
-import QueryNearTextImportVectors from "/_includes/code/quickstart/quickstart.short.import_vectors.query.nearvector.mdx";
+import QueryNearVectorImportVectors from "/_includes/code/quickstart/quickstart.short.import_vectors.query.nearvector.mdx";
-
+
+
+
+Example response
+
+```json
+{
+ "genre": "Science Fiction",
+ "title": "The Matrix",
+ "description": "A computer hacker learns about the true nature of reality and his role in the war against its controllers."
+}
+{
+ "genre": "Fantasy",
+ "title": "The Lord of the Rings: The Fellowship of the Ring",
+ "description": "A meek Hobbit and his companions set out on a perilous journey to destroy a powerful ring and save Middle-earth."
+}
+```
+
+
+
## Step 3: Retrieval augmented generation (RAG)
:::note
@@ -223,7 +242,7 @@ For Retrieval Augmented Generation (RAG) in the last step, you will need a [Clau
Retrieval augmented generation (RAG), also called generative search, works by prompting a large language model (LLM) with a combination of a _user query_ and _data retrieved from a database_.
-The following example combines the same search (for `sci-fi`) with a prompt to generate a tweet.
+The following example combines the semantic search for the query `sci-fi` with a prompt to generate a tweet.
import QueryRAG from "/_includes/code/quickstart/quickstart.short.query.rag.mdx";
@@ -234,7 +253,7 @@ import QueryRAG from "/_includes/code/quickstart/quickstart.short.query.rag.mdx"
Retrieval augmented generation (RAG), also called generative search, works by prompting a large language model (LLM) with a combination of a _user query_ and _data retrieved from a database_.
-The following example combines the same search (for `sci-fi`) with a prompt to generate a tweet.
+The following example combines the vector similarity search with a prompt to generate a tweet.
import QueryRAGCustomVectors from "/_includes/code/quickstart/quickstart.short.import-vectors.query.rag.mdx";
@@ -243,9 +262,25 @@ import QueryRAGCustomVectors from "/_includes/code/quickstart/quickstart.short.i
+
+
+Example response
+
+```json
+ðķïļ Unplug from the system & join Neo's journey ðð°
+
+"The Matrix" will blow your mind ðĪŊ as reality unravels ð
+
+Kung-fu, slow-mo & mind-bending sci-fi ðĨðīïļ
+
+Are you ready to see how deep the rabbit hole goes? ðīðĩ #TheMatrix #WakeUp
+```
+
+
+
## Next steps
-We recommend you check out the following resources to get started with Weaviate.
+We recommend you check out the following resources to continue learning about Weaviate.
import styles from "/src/components/CardsSection/styles.module.scss";
diff --git a/docs/weaviate/tutorials/quick-tour-of-weaviate.mdx b/docs/weaviate/tutorials/quick-tour-of-weaviate.mdx
index 5f2c193a..4f422ad5 100644
--- a/docs/weaviate/tutorials/quick-tour-of-weaviate.mdx
+++ b/docs/weaviate/tutorials/quick-tour-of-weaviate.mdx
@@ -7,27 +7,18 @@ import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import SkipLink from "/src/components/SkipValidationLink";
-Expected time: 30 minutes
-Prerequisites: None
+This tutorial will show you how to use Weaviate Cloud to:
-
-
-
-:::info What you will learn
-
-This quickstart shows you how to combine Weaviate Cloud and Cohere to:
-
-1. Set up a Weaviate instance. (10 minutes)
-1. Add and vectorize your data. (10 minutes)
-1. Perform a semantic search and retrieval augmented generation (RAG). (10 minutes)
+1. **Set up a Weaviate instance.**
+1. **Import and vectorize your data.**
+1. **Perform a semantic search and retrieval augmented generation (RAG).**
```mermaid
flowchart LR
%% Define nodes with white backgrounds and darker borders
- A1["Create Weaviate Sandbox"] --> A2["Install client library"]
- A2 --> A3["Connect to Weaviate"]
- A3 --> B1["Define collection (with an inference API)"]
- B1 --> B2["Batch import objects"]
+ A1["Install client library"] --> A2["Connect to Weaviate"]
+ A2 --> B1["Define collection (with an inference API)"]
+ B1 --> B2["Import objects"]
B2 --> C1["Semantic search (nearText)"]
C1 --> C2["RAG (Generate)"]
@@ -35,7 +26,6 @@ flowchart LR
subgraph sg1 ["1\. Setup"]
A1
A2
- A3
end
subgraph sg2 ["2\. Populate"]
@@ -51,7 +41,6 @@ flowchart LR
%% Style nodes with white background and darker borders
style A1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
style A2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style A3 fill:#ffffff,stroke:#B9C8DF,color:#130C49
style B1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
style B2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
style C1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
@@ -63,16 +52,11 @@ flowchart LR
style sg3 fill:#ffffff,stroke:#7AD6EB,stroke-width:2px,color:#130C49
```
-Notes:
-
-- The code examples here are self-contained. You can copy and paste them into your own environment to try them out.
-
-
-:::
-
-### Requirements
+---
+
+### Prerequisites
In order to perform Retrieval Augmented Generation (RAG) in the last step, you will need a [Cohere](https://dashboard.cohere.com/) account. You can use a free Cohere trial API key.
@@ -82,7 +66,19 @@ If you have another preferred [model provider](/weaviate/model-providers), you c
## Step 1: Set up Weaviate
-### 1.1 Create a Weaviate database
+### 1.1 Install a client library
+
+We recommend using a [client library](../client-libraries/index.mdx) to work with Weaviate. Follow the instructions below to install one of the official client libraries, available in [Python](../client-libraries/python/index.mdx), [JavaScript/TypeScript](../client-libraries/typescript/index.mdx), [Go](../client-libraries/go.md), and [Java](../client-libraries/java.md).
+
+import CodeClientInstall from "/_includes/code/quickstart/clients.install.mdx";
+
+
+
+### 1.2 Connect to Weaviate Cloud
+
+
+
+How to create a Weaviate Cloud Sandbox
Go to the [Weaviate Cloud console](https://console.weaviate.cloud) and create a free Sandbox instance.
@@ -126,16 +122,7 @@ import LatestWeaviateVersion from "/_includes/latest-weaviate-version.mdx";
-### 1.2 Install a client library
-
-We recommend using a [client library](../client-libraries/index.mdx) to work with Weaviate. Follow the instructions below to install one of the official client libraries, available in [Python](../client-libraries/python/index.mdx), [JavaScript/TypeScript](../client-libraries/typescript/index.mdx), [Go](../client-libraries/go.md), and [Java](../client-libraries/java.md).
-
-import CodeClientInstall from "/_includes/code/quickstart/clients.install.mdx";
-
-
-
-### 1.3 Connect to Weaviate
-
+
Now you can connect to your Weaviate instance. You will need the:
- **REST Endpoint URL** and the
From d626540acd264458300b55d37db48c7da77551e5 Mon Sep 17 00:00:00 2001
From: Ivan Despot <66276597+g-despot@users.noreply.github.com>
Date: Wed, 22 Oct 2025 09:51:54 +0200
Subject: [PATCH 04/16] Update docs
---
docs/weaviate/index.mdx | 2 +-
docs/weaviate/quickstart/index.md | 19 +++++++++++--------
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/docs/weaviate/index.mdx b/docs/weaviate/index.mdx
index 07c2f0af..4ea7d0c9 100644
--- a/docs/weaviate/index.mdx
+++ b/docs/weaviate/index.mdx
@@ -32,7 +32,7 @@ export const welcomeCardsData = [
description: (
<>
Check out Weaviate Academy â a
- learning platform entered around AI-native development.
+ learning platform centered around AI-native development.
>
),
link: "https://academy.weaviate.io/",
diff --git a/docs/weaviate/quickstart/index.md b/docs/weaviate/quickstart/index.md
index 9aa44dd6..0f8e1fd7 100644
--- a/docs/weaviate/quickstart/index.md
+++ b/docs/weaviate/quickstart/index.md
@@ -1,5 +1,5 @@
---
-title: Quickstart (with cloud resources)
+title: Quickstart (with Weaviate Cloud)
image: og/docs/quickstart-tutorial.jpg
# tags: ['getting started']
---
@@ -12,7 +12,7 @@ import Tooltip from "/src/components/Tooltip";
export const quickstartOptions = [
{
- title: "Vectorize objects during import",
+ title: ( <> Vectorize objects during import (recommended) >),
description:
"Import objects and vectorize them with the Weaviate Embeddings service.",
link: "?import=vectorization",
@@ -30,7 +30,10 @@ export const quickstartOptions = [
},
];
-
+Weaviate is an open-source vector database built to power AI applications, from prototypes to production-scale systems. This guide will show you how to connect to a Weaviate Cloud instance, import data, vectorize objects and perform searches.
+
+There are two paths you can choose from:
+
---
@@ -38,7 +41,7 @@ export const quickstartOptions = [
-Weaviate is an open-source vector database built to power AI applications, from prototypes to production-scale systems. This quickstart guide will show you how to:
+This quickstart guide will show you how to:
1. **Create a collection & import data** - Create a collection and import data into it. The data will be vectorized with the Weaviate Embeddings service.
2. **Search** - Perform a similarity (vector) search on your data using a text query.
@@ -47,7 +50,7 @@ Weaviate is an open-source vector database built to power AI applications, from
-Weaviate is an open-source vector database built to power AI applications, from prototypes to production-scale systems. This quickstart guide will show you how to:
+This quickstart guide will show you how to:
1. **Create a collection & import data**- Create a collection and import data into it. The data should already contain the pre-computed vector embeddings.
2. **Search** - Perform a similarity (vector) search on your data using a vector query.
@@ -166,7 +169,7 @@ import CodeClientInstall from "/_includes/code/quickstart/clients.install.new.md
## Step 1: Create a collection & import data {#create-a-collection}
-Now, we can populate our database by first defining a collection and then adding data. You can either **[vectorize each object during the import](?import=vectorization#create-a-collection)** (we will use the Weaviate Embeddings service to vectorize the data), or you can **[import pre-computed vector embeddings](?import=custom-embeddings#create-a-collection)**.
+We can populate our database by first defining a collection and then adding data. You can either **[vectorize each object during the import](?import=vectorization#create-a-collection)** (we will use the Weaviate Embeddings service to vectorize the data), or you can **[import pre-computed vector embeddings](?import=custom-embeddings#create-a-collection)**.
@@ -291,7 +294,7 @@ export const nextStepsCardsData = [
<>
Continue with the{" "}
Quick tour tutorial â an
- end-to-end guide that cover important topics like configuring
+ end-to-end guide that covers important topics like configuring
collections, searches, etc.
>
),
@@ -303,7 +306,7 @@ export const nextStepsCardsData = [
description: (
<>
Check out Weaviate Academy â a
- learning platform entered around AI-native development.
+ learning platform centered around AI-native development.
>
),
link: "https://academy.weaviate.io/",
From c9fbe660235be4be2b328f363a63b4eefc5ece18 Mon Sep 17 00:00:00 2001
From: Ivan Despot <66276597+g-despot@users.noreply.github.com>
Date: Wed, 22 Oct 2025 10:18:42 +0200
Subject: [PATCH 05/16] Update docs
---
...t.short.import_vectors.query.nearvector.py | 9 ++++++-
.../python/quickstart.short.query.neartext.py | 11 ++++++++-
docs/weaviate/quickstart/index.md | 24 +++++++++++++++----
3 files changed, 37 insertions(+), 7 deletions(-)
diff --git a/_includes/code/python/quickstart.short.import_vectors.query.nearvector.py b/_includes/code/python/quickstart.short.import_vectors.query.nearvector.py
index 71a9cc84..da78bcf8 100644
--- a/_includes/code/python/quickstart.short.import_vectors.query.nearvector.py
+++ b/_includes/code/python/quickstart.short.import_vectors.query.nearvector.py
@@ -18,9 +18,16 @@
# Step 2.3: Perform a vector search with NearVector
# highlight-start
+# END NearText
+# fmt: off
+# NearText
response = movies.query.near_vector(
- near_vector=[0.11, 0.21, 0.31, 0.41, 0.51, 0.61, 0.71, 0.81], limit=2
+ near_vector=[0.11, 0.21, 0.31, 0.41, 0.51, 0.61, 0.71, 0.81],
+ limit=2
)
+# END NearText
+# fmt: on
+# NearText
# highlight-end
for obj in response.objects:
diff --git a/_includes/code/python/quickstart.short.query.neartext.py b/_includes/code/python/quickstart.short.query.neartext.py
index 71a3409b..fe4b9245 100644
--- a/_includes/code/python/quickstart.short.query.neartext.py
+++ b/_includes/code/python/quickstart.short.query.neartext.py
@@ -18,7 +18,16 @@
# Step 2.3: Perform a semantic search with NearText
# highlight-start
-response = movies.query.near_text(query="sci-fi", limit=2)
+# END NearText
+# fmt: off
+# NearText
+response = movies.query.near_text(
+ query="sci-fi",
+ limit=2
+)
+# END NearText
+# fmt: on
+# NearText
# highlight-end
for obj in response.objects:
diff --git a/docs/weaviate/quickstart/index.md b/docs/weaviate/quickstart/index.md
index 0f8e1fd7..f119c292 100644
--- a/docs/weaviate/quickstart/index.md
+++ b/docs/weaviate/quickstart/index.md
@@ -35,6 +35,13 @@ Weaviate is an open-source vector database built to power AI applications, from
There are two paths you can choose from:
+
+
+:::note Local Quickstart
+
+If you don't want to use Weaviate Cloud, check out the [Local Quickstart](local.md) with Docker.
+
+:::
---
@@ -62,6 +69,7 @@ This quickstart guide will show you how to:
import KapaAI from '/src/components/KapaAI';
If you encounter any issues along the way or have additional questions, use the Ask AI feature.
+
## Prerequisites
A **[Weaviate Cloud](https://console.weaviate.cloud/)** Sandbox instance - you will need an admin **API key** and a **REST endpoint URL** to connect to your instance. See the instructions below for more info.
@@ -169,12 +177,12 @@ import CodeClientInstall from "/_includes/code/quickstart/clients.install.new.md
## Step 1: Create a collection & import data {#create-a-collection}
-We can populate our database by first defining a collection and then adding data. You can either **[vectorize each object during the import](?import=vectorization#create-a-collection)** (we will use the Weaviate Embeddings service to vectorize the data), or you can **[import pre-computed vector embeddings](?import=custom-embeddings#create-a-collection)**.
+We can populate our database by first defining a collection and then adding data. You can either **[vectorize each object during the import](?import=vectorization#create-a-collection)** (we will use the Weaviate Embeddings service to vectorize the data), or you can **[import pre-computed vector embeddings](?import=custom-embeddings#create-a-collection)**.
-The following example creates a collection called `Movie` with the [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service for creating vectors during ingestion and for querying.
+The following example creates a collection called `Movie` with the [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service for vectorizing data during import and for querying. We will define the collection properties explicitly, but you can also use the [auto-schema](../config-refs/collections.mdx#auto-schema) feature to infer the data schema automatically.
import CreateCollection from "/_includes/code/quickstart/quickstart.short.create_collection.mdx";
@@ -183,7 +191,7 @@ import CreateCollection from "/_includes/code/quickstart/quickstart.short.create
-The following example creates a collection called `Movie` and imports pre-computed vectors along with the movie data.
+The following example creates a collection called `Movie` and imports pre-computed vectors along with the movie data. We will define the collection properties explicitly, but you can also use the [auto-schema](../config-refs/collections.mdx#auto-schema) feature to infer the data schema automatically.
import CreateCollectionCustomVectors from "/_includes/code/quickstart/quickstart.short.import_vectors.create_collection.mdx";
@@ -234,10 +242,16 @@ import QueryNearVectorImportVectors from "/_includes/code/quickstart/quickstart.
+:::tip Weaviate Agents
+
+Try querying your Weaviate Cloud data using the [Query Agent](/agents/query/index.md). You simply provide a prompt/question in natural language, and the Query Agent takes care of all the needed steps to provide an answer.
+
+:::
+
## Step 3: Retrieval augmented generation (RAG)
-:::note
-For Retrieval Augmented Generation (RAG) in the last step, you will need a [Claude](https://console.anthropic.com/settings/keys) API key. You can also use another [model provider](/weaviate/model-providers) instead.
+:::note Requirement: Claude API key
+For Retrieval Augmented Generation (RAG) in this step, you will need a [Claude API key](https://console.anthropic.com/settings/keys). You can also use another generative [model provider](/weaviate/model-providers) instead.
:::
From 09d95bcf61925a70fff9cbd41ddc8bac7152d3db Mon Sep 17 00:00:00 2001
From: Ivan Despot <66276597+g-despot@users.noreply.github.com>
Date: Wed, 22 Oct 2025 16:02:34 +0200
Subject: [PATCH 06/16] Update cards and tooltips
---
.../quickstart.short.create_collection.py | 2 +-
....short.import_vectors.create_collection.py | 2 +-
docs/weaviate/quickstart/index.md | 21 ++++++++-----------
src/components/CardsSection/index.jsx | 12 +++++++----
src/components/Tooltip/index.jsx | 10 ++++-----
5 files changed, 23 insertions(+), 24 deletions(-)
diff --git a/_includes/code/python/quickstart.short.create_collection.py b/_includes/code/python/quickstart.short.create_collection.py
index 2165ba8e..4c5489f7 100644
--- a/_includes/code/python/quickstart.short.create_collection.py
+++ b/_includes/code/python/quickstart.short.create_collection.py
@@ -48,7 +48,7 @@
# START CreateCollection
movies = client.collections.use("Movie")
-with movies.batch.dynamic() as batch:
+with movies.batch.fixed_size(batch_size=200) as batch:
for obj in data_objects:
batch.add_object(properties=obj)
diff --git a/_includes/code/python/quickstart.short.import_vectors.create_collection.py b/_includes/code/python/quickstart.short.import_vectors.create_collection.py
index bc0c1da4..b393a495 100644
--- a/_includes/code/python/quickstart.short.import_vectors.create_collection.py
+++ b/_includes/code/python/quickstart.short.import_vectors.create_collection.py
@@ -52,7 +52,7 @@
# Insert the objects with vectors
movies = client.collections.get("Movie")
-with movies.batch.dynamic() as batch:
+with movies.batch.fixed_size(batch_size=200) as batch:
for obj in data_objects:
batch.add_object(properties=obj["properties"], vector=obj["vector"])
diff --git a/docs/weaviate/quickstart/index.md b/docs/weaviate/quickstart/index.md
index f119c292..d0e9adce 100644
--- a/docs/weaviate/quickstart/index.md
+++ b/docs/weaviate/quickstart/index.md
@@ -9,6 +9,7 @@ import TabItem from "@theme/TabItem";
import SkipLink from "/src/components/SkipValidationLink";
import CardsSection from "/src/components/CardsSection";
import Tooltip from "/src/components/Tooltip";
+import styles from "/src/components/CardsSection/styles.module.scss";
export const quickstartOptions = [
{
@@ -30,22 +31,20 @@ export const quickstartOptions = [
},
];
-Weaviate is an open-source vector database built to power AI applications, from prototypes to production-scale systems. This guide will show you how to connect to a Weaviate Cloud instance, import data, vectorize objects and perform searches.
-
-There are two paths you can choose from:
-
-
-
-
:::note Local Quickstart
If you don't want to use Weaviate Cloud, check out the [Local Quickstart](local.md) with Docker.
:::
----
+Weaviate is an open-source vector database built to power AI applications, from prototypes to production-scale systems. This guide will show you how to connect to a Weaviate Cloud instance, import data, vectorize objects and perform searches.
-
+There are two paths you can choose from:
+
+
+
+
+
This quickstart guide will show you how to:
@@ -169,7 +168,7 @@ Once you have the **REST Endpoint URL** and the **admin API key**, you can conne
## Install a client library
-We recommend using a [client library](../client-libraries/index.mdx) to work with Weaviate. Follow the instructions below to install one of the official client libraries, available in [Python](../client-libraries/python/index.mdx), [JavaScript/TypeScript](../client-libraries/typescript/index.mdx), [Go](../client-libraries/go.md), and [Java](../client-libraries/java.md).
+Follow the instructions below to install one of the official client libraries, available in [Python](../client-libraries/python/index.mdx), [JavaScript/TypeScript](../client-libraries/typescript/index.mdx), [Go](../client-libraries/go.md), and [Java](../client-libraries/java.md).
import CodeClientInstall from "/_includes/code/quickstart/clients.install.new.mdx";
@@ -299,8 +298,6 @@ Are you ready to see how deep the rabbit hole goes? ðīðĩ #TheMatrix #WakeUp
We recommend you check out the following resources to continue learning about Weaviate.
-import styles from "/src/components/CardsSection/styles.module.scss";
-
export const nextStepsCardsData = [
{
title: "Quick tour of Weaviate",
diff --git a/src/components/CardsSection/index.jsx b/src/components/CardsSection/index.jsx
index dec3cc90..54f5b164 100644
--- a/src/components/CardsSection/index.jsx
+++ b/src/components/CardsSection/index.jsx
@@ -16,7 +16,9 @@ const CardsSection = ({
// Get all query parameters to check against activeTab
const getCurrentTab = (groupId) => {
- return searchParams.get(groupId);
+ const param = searchParams.get(groupId);
+ // Default to "vectorization" if no parameter is set
+ return param || "vectorization";
};
return (
@@ -26,9 +28,11 @@ const CardsSection = ({
} ${recipeCards ? styles.recipeCards : ""}`}
>
{Object.entries(items).map(([key, item]) => {
- // Check if this card's activeTab matches the current URL parameter
- const currentTab = getCurrentTab(item.groupId);
- const isActive = item.activeTab && currentTab === item.activeTab;
+ // Only check activeTab logic if both groupId and activeTab exist
+ const isActive =
+ item.groupId && item.activeTab
+ ? getCurrentTab(item.groupId) === item.activeTab
+ : false;
return (
{
if (isVisible) {
- // We need a minimal delay to allow the tooltip to render with its actual content and size
- // before we can measure it accurately.
const timer = setTimeout(calculatePosition, 0);
window.addEventListener("resize", calculatePosition);
window.addEventListener("scroll", calculatePosition);
@@ -104,10 +102,8 @@ const Tooltip = ({
window.removeEventListener("resize", calculatePosition);
window.removeEventListener("scroll", calculatePosition);
};
- } else {
- // Reset styles when hidden to prevent stale positions
- setDynamicStyles({});
}
+ // Remove the else block entirely - no need to reset styles
}, [isVisible, calculatePosition]);
const handleMouseEnter = () => {
@@ -135,7 +131,9 @@ const Tooltip = ({
isVisible ? styles.visible : ""
}`}
style={dynamicStyles}
- data-position={position} // Keep data-position for arrow styling
+ data-position={position}
+ onMouseEnter={handleMouseEnter}
+ onMouseLeave={handleMouseLeave}
>
{content}
From 37aca1d60c723203aa723cbd08d6fb067fc482b6 Mon Sep 17 00:00:00 2001
From: Ivan Despot <66276597+g-despot@users.noreply.github.com>
Date: Mon, 27 Oct 2025 16:25:19 +0100
Subject: [PATCH 07/16] Update docs
---
.../code/python/quickstart.short.create_collection.py | 5 -----
.../quickstart.short.import_vectors.create_collection.py | 5 -----
docs/weaviate/quickstart/index.md | 9 ++++++---
3 files changed, 6 insertions(+), 13 deletions(-)
diff --git a/_includes/code/python/quickstart.short.create_collection.py b/_includes/code/python/quickstart.short.create_collection.py
index 4c5489f7..cc215579 100644
--- a/_includes/code/python/quickstart.short.create_collection.py
+++ b/_includes/code/python/quickstart.short.create_collection.py
@@ -25,11 +25,6 @@
movies = client.collections.create(
name="Movie",
vector_config=Configure.Vectors.text2vec_weaviate(), # Configure the Weaviate Embeddings vectorizer
- properties=[
- Property(name="title", data_type=DataType.TEXT),
- Property(name="description", data_type=DataType.TEXT),
- Property(name="genre", data_type=DataType.TEXT),
- ], # You can also use auto-schema, here we define the schema manually
)
# highlight-end
# START CreateCollection
diff --git a/_includes/code/python/quickstart.short.import_vectors.create_collection.py b/_includes/code/python/quickstart.short.import_vectors.create_collection.py
index b393a495..98452c3b 100644
--- a/_includes/code/python/quickstart.short.import_vectors.create_collection.py
+++ b/_includes/code/python/quickstart.short.import_vectors.create_collection.py
@@ -25,11 +25,6 @@
movies = client.collections.create(
name="Movie",
vector_config=Configure.Vectors.self_provided(), # No automatic vectorization since we're providing vectors
- properties=[
- Property(name="title", data_type=DataType.TEXT),
- Property(name="description", data_type=DataType.TEXT),
- Property(name="genre", data_type=DataType.TEXT),
- ], # You can also use auto-schema, here we define the schema manually
)
# highlight-end
# START CreateCollection
diff --git a/docs/weaviate/quickstart/index.md b/docs/weaviate/quickstart/index.md
index d0e9adce..26249429 100644
--- a/docs/weaviate/quickstart/index.md
+++ b/docs/weaviate/quickstart/index.md
@@ -176,12 +176,15 @@ import CodeClientInstall from "/_includes/code/quickstart/clients.install.new.md
## Step 1: Create a collection & import data {#create-a-collection}
+
+
-The following example creates a collection called `Movie` with the [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service for vectorizing data during import and for querying. We will define the collection properties explicitly, but you can also use the [auto-schema](../config-refs/collections.mdx#auto-schema) feature to infer the data schema automatically.
+The following example creates a collection called `Movie` with the [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service for vectorizing data during import and for querying.
+
+
import CreateCollection from "/_includes/code/quickstart/quickstart.short.create_collection.mdx";
From 4444c923132859b23fa56ae1a45122d93efce02c Mon Sep 17 00:00:00 2001
From: Ivan Despot <66276597+g-despot@users.noreply.github.com>
Date: Wed, 5 Nov 2025 08:28:46 +0100
Subject: [PATCH 08/16] Add TS code
---
.../quickstart.short.create_collection.ts | 49 ++++++++
....short.import_vectors.create_collection.ts | 59 ++++++++++
...art.short.import_vectors.query.neartext.ts | 40 +++++++
...ickstart.short.import_vectors.query.rag.ts | 42 +++++++
.../quickstart.short.query.neartext.ts | 40 +++++++
.../typescript/quickstart.short.query.rag.ts | 42 +++++++
docs/weaviate/quickstart/index.md | 110 +++++++++---------
7 files changed, 327 insertions(+), 55 deletions(-)
create mode 100644 _includes/code/typescript/quickstart.short.create_collection.ts
create mode 100644 _includes/code/typescript/quickstart.short.import_vectors.create_collection.ts
create mode 100644 _includes/code/typescript/quickstart.short.import_vectors.query.neartext.ts
create mode 100644 _includes/code/typescript/quickstart.short.import_vectors.query.rag.ts
create mode 100644 _includes/code/typescript/quickstart.short.query.neartext.ts
create mode 100644 _includes/code/typescript/quickstart.short.query.rag.ts
diff --git a/_includes/code/typescript/quickstart.short.create_collection.ts b/_includes/code/typescript/quickstart.short.create_collection.ts
new file mode 100644
index 00000000..3c7e5fb8
--- /dev/null
+++ b/_includes/code/typescript/quickstart.short.create_collection.ts
@@ -0,0 +1,49 @@
+// START CreateCollection
+import weaviate, { WeaviateClient, ApiKey, vectors } from 'weaviate-client';
+
+// Best practice: store your credentials in environment variables
+const weaviateUrl = process.env.WEAVIATE_URL!;
+const weaviateApiKey = process.env.WEAVIATE_API_KEY!;
+
+// Step 1.1: Connect to your Weaviate Cloud instance
+const client: WeaviateClient = await weaviate.connectToWeaviateCloud(
+ weaviateUrl,
+ {
+ authCredentials: new ApiKey(weaviateApiKey),
+ }
+);
+
+// END CreateCollection
+
+// NOT SHOWN TO THE USER - DELETE EXISTING COLLECTION
+await client.collections.delete('Movie');
+
+// START CreateCollection
+// Step 1.2: Create a collection
+// highlight-start
+const movies = await client.collections.create({
+ name: 'Movie',
+ vectorizers: vectors.text2VecWeaviate(),
+});
+// highlight-end
+
+// END CreateCollection
+
+// START CreateCollection
+// Step 1.3: Import three objects
+const dataObjects = [
+ { title: 'The Matrix', description: 'A computer hacker learns about the true nature of reality and his role in the war against its controllers.', genre: 'Science Fiction' },
+ { title: 'Spirited Away', description: 'A young girl becomes trapped in a mysterious world of spirits and must find a way to save her parents and return home.', genre: 'Animation' },
+ { title: 'The Lord of the Rings: The Fellowship of the Ring', description: 'A meek Hobbit and his companions set out on a perilous journey to destroy a powerful ring and save Middle-earth.', genre: 'Fantasy' },
+];
+
+// END CreateCollection
+
+// START CreateCollection
+const movieCollection = client.collections.get('Movie');
+const response = await movieCollection.data.insertMany(dataObjects);
+
+console.log(`Imported & vectorized ${dataObjects.length} objects into the Movie collection`);
+
+await client.close(); // Free up resources
+// END CreateCollection
diff --git a/_includes/code/typescript/quickstart.short.import_vectors.create_collection.ts b/_includes/code/typescript/quickstart.short.import_vectors.create_collection.ts
new file mode 100644
index 00000000..a8f0cced
--- /dev/null
+++ b/_includes/code/typescript/quickstart.short.import_vectors.create_collection.ts
@@ -0,0 +1,59 @@
+// START CreateCollection
+import weaviate, { WeaviateClient, ApiKey, vectors } from 'weaviate-client';
+
+// Best practice: store your credentials in environment variables
+const weaviateUrl = process.env.WEAVIATE_URL!;
+const weaviateApiKey = process.env.WEAVIATE_API_KEY!;
+
+// Step 1.1: Connect to your Weaviate Cloud instance
+const client: WeaviateClient = await weaviate.connectToWeaviateCloud(
+ weaviateUrl,
+ {
+ authCredentials: new ApiKey(weaviateApiKey),
+ }
+);
+
+// END CreateCollection
+
+// NOT SHOWN TO THE USER - DELETE EXISTING COLLECTION
+await client.collections.delete('Movie');
+
+// START CreateCollection
+// Step 1.2: Create a collection
+// highlight-start
+const movies = await client.collections.create({
+ name: 'Movie',
+ vectorizers: vectors.selfProvided(), // No automatic vectorization since we're providing vectors
+});
+// highlight-end
+
+// END CreateCollection
+
+// START CreateCollection
+// Step 1.3: Import three objects
+const dataObjects = [
+ {
+ properties: { title: 'The Matrix', description: 'A computer hacker learns about the true nature of reality and his role in the war against its controllers.', genre: 'Science Fiction' },
+ vectors: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8],
+ },
+ {
+ properties: { title: 'Spirited Away', description: 'A young girl becomes trapped in a mysterious world of spirits and must find a way to save her parents and return home.', genre: 'Animation' },
+ vectors: [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9],
+ },
+ {
+ properties: { title: 'The Lord of the Rings: The Fellowship of the Ring', description: 'A meek Hobbit and his companions set out on a perilous journey to destroy a powerful ring and save Middle-earth.', genre: 'Fantasy' },
+ vectors: [0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0],
+ },
+];
+
+// END CreateCollection
+
+// START CreateCollection
+// Insert the objects with vectors
+const movieCollection = client.collections.get('Movie');
+const response = await movieCollection.data.insertMany(dataObjects);
+
+console.log(`Imported ${dataObjects.length} objects with vectors into the Movie collection`);
+
+await client.close(); // Free up resources
+// END CreateCollection
diff --git a/_includes/code/typescript/quickstart.short.import_vectors.query.neartext.ts b/_includes/code/typescript/quickstart.short.import_vectors.query.neartext.ts
new file mode 100644
index 00000000..266bbde1
--- /dev/null
+++ b/_includes/code/typescript/quickstart.short.import_vectors.query.neartext.ts
@@ -0,0 +1,40 @@
+// NearText
+import weaviate, { WeaviateClient, ApiKey } from 'weaviate-client';
+
+// Best practice: store your credentials in environment variables
+const weaviateUrl = process.env.WEAVIATE_URL!;
+const weaviateApiKey = process.env.WEAVIATE_API_KEY!;
+
+// Step 2.1: Connect to your Weaviate Cloud instance
+const client: WeaviateClient = await weaviate.connectToWeaviateCloud(
+ weaviateUrl,
+ {
+ authCredentials: new ApiKey(weaviateApiKey),
+ }
+);
+
+// Step 2.2: Use this collection
+const movies = client.collections.get('Movie');
+
+// Step 2.3: Perform a vector search with NearVector
+// highlight-start
+// END NearText
+
+// NearText
+const response = await movies.query.nearVector(
+ [0.11, 0.21, 0.31, 0.41, 0.51, 0.61, 0.71, 0.81],
+ {
+ limit: 2,
+ }
+);
+// END NearText
+
+// NearText
+// highlight-end
+
+for (const obj of response.objects) {
+ console.log(JSON.stringify(obj.properties, null, 2)); // Inspect the results
+}
+
+await client.close(); // Free up resources
+// END NearText
diff --git a/_includes/code/typescript/quickstart.short.import_vectors.query.rag.ts b/_includes/code/typescript/quickstart.short.import_vectors.query.rag.ts
new file mode 100644
index 00000000..93d18b24
--- /dev/null
+++ b/_includes/code/typescript/quickstart.short.import_vectors.query.rag.ts
@@ -0,0 +1,42 @@
+// RAG
+import weaviate, { WeaviateClient, ApiKey, generativeParameters } from 'weaviate-client';
+
+// Best practice: store your credentials in environment variables
+const weaviateUrl = process.env.WEAVIATE_URL!;
+const weaviateApiKey = process.env.WEAVIATE_API_KEY!;
+const anthropicApiKey = process.env.ANTHROPIC_API_KEY!;
+
+// Step 2.1: Connect to your Weaviate Cloud instance
+const client: WeaviateClient = await weaviate.connectToWeaviateCloud(
+ weaviateUrl,
+ {
+ authCredentials: new ApiKey(weaviateApiKey),
+ // highlight-start
+ headers: { 'X-Anthropic-Api-Key': anthropicApiKey },
+ // highlight-end
+ }
+);
+
+// Step 2.2: Use this collection
+const movies = client.collections.get('Movie');
+
+// Step 2.3: Perform RAG with on NearVector results
+// highlight-start
+const response = await movies.generate.nearVector(
+ [0.11, 0.21, 0.31, 0.41, 0.51, 0.61, 0.71, 0.81],
+ {
+ groupedTask: 'Write a tweet with emojis about this movie.',
+ config: generativeParameters.anthropic({
+ model: "claude-3-5-haiku-latest",
+ }),
+ },
+ {
+ limit: 1,
+ }
+);
+// highlight-end
+
+console.log(response.generative); // Inspect the results
+
+await client.close(); // Free up resources
+// END RAG
\ No newline at end of file
diff --git a/_includes/code/typescript/quickstart.short.query.neartext.ts b/_includes/code/typescript/quickstart.short.query.neartext.ts
new file mode 100644
index 00000000..8047abcf
--- /dev/null
+++ b/_includes/code/typescript/quickstart.short.query.neartext.ts
@@ -0,0 +1,40 @@
+// NearText
+import weaviate, { WeaviateClient, ApiKey } from 'weaviate-client';
+
+// Best practice: store your credentials in environment variables
+const weaviateUrl = process.env.WEAVIATE_URL!;
+const weaviateApiKey = process.env.WEAVIATE_API_KEY!;
+
+// Step 2.1: Connect to your Weaviate Cloud instance
+const client: WeaviateClient = await weaviate.connectToWeaviateCloud(
+ weaviateUrl,
+ {
+ authCredentials: new ApiKey(weaviateApiKey),
+ }
+);
+
+// Step 2.2: Use this collection
+const movies = client.collections.get('Movie');
+
+// Step 2.3: Perform a semantic search with NearText
+// highlight-start
+// END NearText
+
+// NearText
+const response = await movies.query.nearText(
+ 'sci-fi',
+ {
+ limit: 2,
+ }
+);
+// END NearText
+
+// NearText
+// highlight-end
+
+for (const obj of response.objects) {
+ console.log(JSON.stringify(obj.properties, null, 2)); // Inspect the results
+}
+
+await client.close(); // Free up resources
+// END NearText
diff --git a/_includes/code/typescript/quickstart.short.query.rag.ts b/_includes/code/typescript/quickstart.short.query.rag.ts
new file mode 100644
index 00000000..14b74860
--- /dev/null
+++ b/_includes/code/typescript/quickstart.short.query.rag.ts
@@ -0,0 +1,42 @@
+// RAG
+import weaviate, { WeaviateClient, ApiKey, generativeParameters } from 'weaviate-client';
+
+// Best practice: store your credentials in environment variables
+const weaviateUrl = process.env.WEAVIATE_URL!;
+const weaviateApiKey = process.env.WEAVIATE_API_KEY!;
+const anthropicApiKey = process.env.ANTHROPIC_API_KEY!;
+
+// Step 2.1: Connect to your Weaviate Cloud instance
+const client: WeaviateClient = await weaviate.connectToWeaviateCloud(
+ weaviateUrl,
+ {
+ authCredentials: new ApiKey(weaviateApiKey),
+ // highlight-start
+ headers: { 'X-Anthropic-Api-Key': anthropicApiKey },
+ // highlight-end
+ }
+);
+
+// Step 2.2: Use this collection
+const movies = client.collections.get('Movie');
+
+// Step 2.3: Perform RAG with on NearText results
+// highlight-start
+const response = await movies.generate.nearText(
+ 'sci-fi',
+ {
+ groupedTask: 'Write a tweet with emojis about this movie.',
+ config: generativeParameters.anthropic({
+ model: "claude-3-5-haiku-latest",
+ }),
+ },
+ {
+ limit: 1,
+ }
+);
+// highlight-end
+
+console.log(response.generative); // Inspect the results
+
+await client.close(); // Free up resources
+// END RAG
diff --git a/docs/weaviate/quickstart/index.md b/docs/weaviate/quickstart/index.md
index ccd281e2..5cfafb02 100644
--- a/docs/weaviate/quickstart/index.md
+++ b/docs/weaviate/quickstart/index.md
@@ -12,23 +12,23 @@ import Tooltip from "/src/components/Tooltip";
import styles from "/src/components/CardsSection/styles.module.scss";
export const quickstartOptions = [
- {
- title: ( <> Vectorize objects during import (recommended) >),
- description:
- "Import objects and vectorize them with the Weaviate Embeddings service.",
- link: "?import=vectorization",
- icon: "fas fa-arrows-spin",
- groupId: "import",
- activeTab: "vectorization",
- },
- {
- title: "Import vectors",
- description: "Import pre-computed vector embeddings along with your data.",
- link: "?import=custom-embeddings",
- icon: "fas fa-circle-nodes",
- groupId: "import",
- activeTab: "custom-embeddings",
- },
+{
+title: ( <> Vectorize objects during import (recommended) >),
+description:
+"Import objects and vectorize them with the Weaviate Embeddings service.",
+link: "?import=vectorization",
+icon: "fas fa-arrows-spin",
+groupId: "import",
+activeTab: "vectorization",
+},
+{
+title: "Import vectors",
+description: "Import pre-computed vector embeddings along with your data.",
+link: "?import=custom-embeddings",
+icon: "fas fa-circle-nodes",
+groupId: "import",
+activeTab: "custom-embeddings",
+},
];
:::note Local Quickstart
@@ -39,7 +39,7 @@ If you don't want to use Weaviate Cloud, check out the [Local Quickstart](local.
Weaviate is an open-source vector database built to power AI applications, from prototypes to production-scale systems. This guide will show you how to connect to a Weaviate Cloud instance, import data, vectorize objects and perform searches.
-There are two paths you can choose from:
+There are two paths you can choose from:
@@ -49,7 +49,7 @@ There are two paths you can choose from:
This quickstart guide will show you how to:
-1. **Create a collection & import data** - Create a collection and import data into it. The data will be vectorized with the Weaviate Embeddings service.
+1. **Create a collection & import data** - Create a collection and import data into it. The data will be vectorized with the Weaviate Embeddings service. You are also free to use any other available embedding model provider.
2. **Search** - Perform a similarity (vector) search on your data using a text query.
3. **RAG** - Perform Retrieval Augmented Generation (RAG) with a generative model.
@@ -58,7 +58,7 @@ This quickstart guide will show you how to:
This quickstart guide will show you how to:
-1. **Create a collection & import data**- Create a collection and import data into it. The data should already contain the pre-computed vector embeddings.
+1. **Create a collection & import data**- Create a collection and import data into it. The data should already contain the pre-computed vector embeddings. This option is useful for when you are migrating data from a different vector database.
2. **Search** - Perform a similarity (vector) search on your data using a vector query.
3. **RAG** - Perform Retrieval Augmented Generation (RAG) with a generative model.
@@ -170,32 +170,32 @@ Once you have the **REST Endpoint URL** and the **admin API key**, you can conne
Follow the instructions below to install one of the official client libraries, available in [Python](../client-libraries/python/index.mdx), [JavaScript/TypeScript](../client-libraries/typescript/index.mdx), [Go](../client-libraries/go.md), and [Java](../client-libraries/java.md).
-import CodeClientInstall from "/_includes/code/quickstart/clients.install.new.mdx";
+import CodeClientInstall from "/\_includes/code/quickstart/clients.install.new.mdx";
## Step 1: Create a collection & import data {#create-a-collection}
-The following example creates a collection called `Movie` with the [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service for vectorizing data during import and for querying.
+The following example creates a collection called `Movie` with the [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service for vectorizing data during import and for querying.
-import CreateCollection from "/_includes/code/quickstart/quickstart.short.create_collection.mdx";
+import CreateCollection from "/\_includes/code/quickstart/quickstart.short.create_collection.mdx";
-The following example creates a collection called `Movie` and imports pre-computed vectors along with the movie data. We will define the collection properties explicitly, but you can also use the [auto-schema](../config-refs/collections.mdx#auto-schema) feature to infer the data schema automatically.
+The following example creates a collection called `Movie` and imports pre-computed vectors along with the movie data. We will define the collection properties explicitly, but you can also use the [auto-schema](../config-refs/collections.mdx#auto-schema) feature to infer the data schema automatically.
-import CreateCollectionCustomVectors from "/_includes/code/quickstart/quickstart.short.import_vectors.create_collection.mdx";
+import CreateCollectionCustomVectors from "/\_includes/code/quickstart/quickstart.short.import_vectors.create_collection.mdx";
@@ -209,7 +209,7 @@ import CreateCollectionCustomVectors from "/_includes/code/quickstart/quickstart
Semantic search finds results based on meaning. This is called `nearText` in Weaviate. The following example searches for 2 objects (_limit_) whose meaning is most similar to that of `sci-fi`.
-import QueryNearText from "/_includes/code/quickstart/quickstart.short.query.neartext.mdx";
+import QueryNearText from "/\_includes/code/quickstart/quickstart.short.query.neartext.mdx";
@@ -218,7 +218,7 @@ import QueryNearText from "/_includes/code/quickstart/quickstart.short.query.nea
Semantic search finds results based on meaning. This is called `nearVector` in Weaviate. The following example searches for 2 objects (_limit_) whose vector is most similar to the query vector.
-import QueryNearVectorImportVectors from "/_includes/code/quickstart/quickstart.short.import_vectors.query.nearvector.mdx";
+import QueryNearVectorImportVectors from "/\_includes/code/quickstart/quickstart.short.import_vectors.query.nearvector.mdx";
@@ -263,7 +263,7 @@ Retrieval augmented generation (RAG), also called generative search, works by pr
The following example combines the semantic search for the query `sci-fi` with a prompt to generate a tweet.
-import QueryRAG from "/_includes/code/quickstart/quickstart.short.query.rag.mdx";
+import QueryRAG from "/\_includes/code/quickstart/quickstart.short.query.rag.mdx";
@@ -274,7 +274,7 @@ Retrieval augmented generation (RAG), also called generative search, works by pr
The following example combines the vector similarity search with a prompt to generate a tweet.
-import QueryRAGCustomVectors from "/_includes/code/quickstart/quickstart.short.import-vectors.query.rag.mdx";
+import QueryRAGCustomVectors from "/\_includes/code/quickstart/quickstart.short.import-vectors.query.rag.mdx";
@@ -302,30 +302,30 @@ Are you ready to see how deep the rabbit hole goes? ðīðĩ #TheMatrix #WakeUp
We recommend you check out the following resources to continue learning about Weaviate.
export const nextStepsCardsData = [
- {
- title: "Quick tour of Weaviate",
- description: (
- <>
- Continue with the{" "}
- Quick tour tutorial â an
- end-to-end guide that covers important topics like configuring
- collections, searches, etc.
- >
- ),
- link: "/weaviate/tutorials/quick-tour-of-weaviate",
- icon: "fas fa-signs-post",
- },
- {
- title: "Weaviate Academy",
- description: (
- <>
- Check out Weaviate Academy â a
- learning platform centered around AI-native development.
- >
- ),
- link: "https://academy.weaviate.io/",
- icon: "fa-solid fa-graduation-cap",
- },
+{
+title: "Quick tour of Weaviate",
+description: (
+<>
+Continue with the{" "}
+Quick tour tutorial â an
+end-to-end guide that covers important topics like configuring
+collections, searches, etc.
+>
+),
+link: "/weaviate/tutorials/quick-tour-of-weaviate",
+icon: "fas fa-signs-post",
+},
+{
+title: "Weaviate Academy",
+description: (
+<>
+Check out Weaviate Academy â a
+learning platform centered around AI-native development.
+>
+),
+link: "https://academy.weaviate.io/",
+icon: "fa-solid fa-graduation-cap",
+},
];
@@ -333,6 +333,6 @@ export const nextStepsCardsData = [
## Questions and feedback
-import DocsFeedback from "/_includes/docs-feedback.mdx";
+import DocsFeedback from "/\_includes/docs-feedback.mdx";
From 89c97407ecaccaccfb9624c10fcd3955188626cc Mon Sep 17 00:00:00 2001
From: Ivan Despot <66276597+g-despot@users.noreply.github.com>
Date: Wed, 5 Nov 2025 09:43:30 +0100
Subject: [PATCH 09/16] Add Java and Go code
---
.../quickstart.short.create_collection.go | 93 +++++++++++++++
.../quickstart.short.query.neartext.go | 75 +++++++++++++
.../short_3/quickstart.short.query.rag.go | 70 ++++++++++++
....short.import_vectors.create_collection.go | 106 ++++++++++++++++++
...t.short.import_vectors.query.nearvector.go | 75 +++++++++++++
...ickstart.short.import_vectors.query.rag.go | 70 ++++++++++++
.../docs/quickstart/QuickstartCreate.java | 77 +++++++++++++
.../quickstart/QuickstartCreateVectors.java | 91 +++++++++++++++
.../quickstart/QuickstartQueryNearText.java | 55 +++++++++
.../QuickstartQueryNearTextRAG.java | 64 +++++++++++
.../quickstart/QuickstartQueryNearVector.java | 75 +++++++++++++
.../QuickstartQueryNearVectorRAG.java | 65 +++++++++++
12 files changed, 916 insertions(+)
create mode 100644 _includes/code/howto/go/docs/quickstart/short_1/quickstart.short.create_collection.go
create mode 100644 _includes/code/howto/go/docs/quickstart/short_2/quickstart.short.query.neartext.go
create mode 100644 _includes/code/howto/go/docs/quickstart/short_3/quickstart.short.query.rag.go
create mode 100644 _includes/code/howto/go/docs/quickstart/short_vectors_1/quickstart.short.import_vectors.create_collection.go
create mode 100644 _includes/code/howto/go/docs/quickstart/short_vectors_2/quickstart.short.import_vectors.query.nearvector.go
create mode 100644 _includes/code/howto/go/docs/quickstart/short_vectors_3/quickstart.short.import_vectors.query.rag.go
create mode 100644 _includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartCreate.java
create mode 100644 _includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartCreateVectors.java
create mode 100644 _includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearText.java
create mode 100644 _includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearTextRAG.java
create mode 100644 _includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearVector.java
create mode 100644 _includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearVectorRAG.java
diff --git a/_includes/code/howto/go/docs/quickstart/short_1/quickstart.short.create_collection.go b/_includes/code/howto/go/docs/quickstart/short_1/quickstart.short.create_collection.go
new file mode 100644
index 00000000..dd531839
--- /dev/null
+++ b/_includes/code/howto/go/docs/quickstart/short_1/quickstart.short.create_collection.go
@@ -0,0 +1,93 @@
+package main
+
+// START CreateCollection
+import (
+ "context"
+ "fmt"
+ "os"
+
+ "github.com/weaviate/weaviate-go-client/v5/weaviate"
+ "github.com/weaviate/weaviate-go-client/v5/weaviate/auth"
+ "github.com/weaviate/weaviate/entities/models"
+)
+
+func main() {
+ // Best practice: store your credentials in environment variables
+ weaviateURL := os.Getenv("WEAVIATE_HOST")
+ weaviateAPIKey := os.Getenv("WEAVIATE_API_KEY")
+
+ // Step 1.1: Connect to your Weaviate Cloud instance
+ cfg := weaviate.Config{
+ Host: weaviateURL,
+ Scheme: "https",
+ AuthConfig: auth.ApiKey{Value: weaviateAPIKey},
+ }
+ client, err := weaviate.NewClient(cfg)
+ if err != nil {
+ panic(err)
+ }
+
+ // END CreateCollection
+
+ // NOT SHOWN TO THE USER - DELETE EXISTING COLLECTION
+ client.Schema().ClassDeleter().WithClassName("Movie").Do(context.Background())
+
+ // START CreateCollection
+ // Step 1.2: Create a collection
+ // highlight-start
+ classObj := &models.Class{
+ Class: "Movie",
+ Vectorizer: "text2vec-weaviate",
+ ModuleConfig: map[string]interface{}{
+ "generative-anthropic": map[string]interface{}{},
+ },
+ }
+
+ err = client.Schema().ClassCreator().WithClass(classObj).Do(context.Background())
+ if err != nil {
+ panic(err)
+ }
+ // highlight-end
+
+ // END CreateCollection
+
+ // START CreateCollection
+ // Step 1.3: Import three objects
+ dataObjects := []map[string]interface{}{
+ {
+ "title": "The Matrix",
+ "description": "A computer hacker learns about the true nature of reality and his role in the war against its controllers.",
+ "genre": "Science Fiction",
+ },
+ {
+ "title": "Spirited Away",
+ "description": "A young girl becomes trapped in a mysterious world of spirits and must find a way to save her parents and return home.",
+ "genre": "Animation",
+ },
+ {
+ "title": "The Lord of the Rings: The Fellowship of the Ring",
+ "description": "A meek Hobbit and his companions set out on a perilous journey to destroy a powerful ring and save Middle-earth.",
+ "genre": "Fantasy",
+ },
+ }
+
+ // END CreateCollection
+
+ // START CreateCollection
+ // Insert objects
+ objects := make([]*models.Object, len(dataObjects))
+ for i, obj := range dataObjects {
+ objects[i] = &models.Object{
+ Class: "Movie",
+ Properties: obj,
+ }
+ }
+
+ _, err = client.Batch().ObjectsBatcher().WithObjects(objects...).Do(context.Background())
+ if err != nil {
+ panic(err)
+ }
+
+ fmt.Printf("Imported & vectorized %d objects into the Movie collection\n", len(dataObjects))
+ // END CreateCollection
+}
diff --git a/_includes/code/howto/go/docs/quickstart/short_2/quickstart.short.query.neartext.go b/_includes/code/howto/go/docs/quickstart/short_2/quickstart.short.query.neartext.go
new file mode 100644
index 00000000..72d96a0d
--- /dev/null
+++ b/_includes/code/howto/go/docs/quickstart/short_2/quickstart.short.query.neartext.go
@@ -0,0 +1,75 @@
+package main
+
+// NearText
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+ "os"
+
+ "github.com/weaviate/weaviate-go-client/v5/weaviate"
+ "github.com/weaviate/weaviate-go-client/v5/weaviate/auth"
+ "github.com/weaviate/weaviate-go-client/v5/weaviate/graphql"
+)
+
+func main() {
+ // Best practice: store your credentials in environment variables
+ weaviateURL := os.Getenv("WEAVIATE_HOST")
+ weaviateAPIKey := os.Getenv("WEAVIATE_API_KEY")
+
+ // Step 1.1: Connect to your Weaviate Cloud instance
+ cfg := weaviate.Config{
+ Host: weaviateURL,
+ Scheme: "https",
+ AuthConfig: auth.ApiKey{Value: weaviateAPIKey},
+ }
+ client, err := weaviate.NewClient(cfg)
+ if err != nil {
+ panic(err)
+ }
+
+ // Step 2.2 & 2.3: Perform a semantic search with NearText
+ // highlight-start
+ // END NearText
+
+ // NearText
+ title := graphql.Field{Name: "title"}
+ description := graphql.Field{Name: "description"}
+ genre := graphql.Field{Name: "genre"}
+
+ nearText := client.GraphQL().NearTextArgBuilder().
+ WithConcepts([]string{"sci-fi"})
+
+ result, err := client.GraphQL().Get().
+ WithClassName("Movie").
+ WithNearText(nearText).
+ WithLimit(2).
+ WithFields(title, description, genre).
+ Do(context.Background())
+ // END NearText
+
+ // NearText
+ // highlight-end
+
+ if err != nil {
+ panic(err)
+ }
+
+ // Inspect the results
+ if result.Errors != nil {
+ fmt.Printf("Error: %v\n", result.Errors)
+ return
+ }
+
+ data := result.Data["Get"].(map[string]interface{})
+ movies := data["Movie"].([]interface{})
+
+ for _, movie := range movies {
+ jsonData, err := json.MarshalIndent(movie, "", " ")
+ if err != nil {
+ panic(err)
+ }
+ fmt.Println(string(jsonData))
+ }
+ // END NearText
+}
diff --git a/_includes/code/howto/go/docs/quickstart/short_3/quickstart.short.query.rag.go b/_includes/code/howto/go/docs/quickstart/short_3/quickstart.short.query.rag.go
new file mode 100644
index 00000000..27f14565
--- /dev/null
+++ b/_includes/code/howto/go/docs/quickstart/short_3/quickstart.short.query.rag.go
@@ -0,0 +1,70 @@
+package main
+
+// RAG
+import (
+ "context"
+ "fmt"
+ "os"
+
+ "github.com/weaviate/weaviate-go-client/v5/weaviate"
+ "github.com/weaviate/weaviate-go-client/v5/weaviate/auth"
+ "github.com/weaviate/weaviate-go-client/v5/weaviate/graphql"
+)
+
+func main() {
+ // Best practice: store your credentials in environment variables
+ weaviateURL := os.Getenv("WEAVIATE_URL")
+ weaviateAPIKey := os.Getenv("WEAVIATE_API_KEY")
+ anthropicAPIKey := os.Getenv("ANTHROPIC_API_KEY")
+
+ // Step 2.1: Connect to your Weaviate Cloud instance
+ // highlight-start
+ headers := map[string]string{
+ "X-Anthropic-Api-Key": anthropicAPIKey,
+ }
+
+ cfg := weaviate.Config{
+ Host: weaviateURL,
+ Scheme: "https",
+ AuthConfig: auth.ApiKey{Value: weaviateAPIKey},
+ Headers: headers,
+ }
+ client, err := weaviate.NewClient(cfg)
+ if err != nil {
+ panic(err)
+ }
+ // highlight-end
+
+ // Step 2.2 & 2.3: Perform RAG with NearText results
+ // highlight-start
+ title := graphql.Field{Name: "title"}
+ description := graphql.Field{Name: "description"}
+ genre := graphql.Field{Name: "genre"}
+
+ nearText := client.GraphQL().NearTextArgBuilder().
+ WithConcepts([]string{"sci-fi"})
+
+ generate := graphql.NewGenerativeSearch().GroupedResult("Write a tweet with emojis about this movie.")
+
+ result, err := client.GraphQL().Get().
+ WithClassName("Movie").
+ WithNearText(nearText).
+ WithLimit(1).
+ WithFields(title, description, genre).
+ WithGenerativeSearch(generate).
+ Do(context.Background())
+ // highlight-end
+
+ if err != nil {
+ panic(err)
+ }
+
+ // Inspect the results
+ if result.Errors != nil {
+ fmt.Printf("Error: %v\n", result.Errors)
+ return
+ }
+
+ fmt.Printf("%v", result)
+ // END RAG
+}
diff --git a/_includes/code/howto/go/docs/quickstart/short_vectors_1/quickstart.short.import_vectors.create_collection.go b/_includes/code/howto/go/docs/quickstart/short_vectors_1/quickstart.short.import_vectors.create_collection.go
new file mode 100644
index 00000000..b73dbf40
--- /dev/null
+++ b/_includes/code/howto/go/docs/quickstart/short_vectors_1/quickstart.short.import_vectors.create_collection.go
@@ -0,0 +1,106 @@
+package main
+
+// START CreateCollection
+import (
+ "context"
+ "fmt"
+ "os"
+
+ "github.com/weaviate/weaviate-go-client/v5/weaviate"
+ "github.com/weaviate/weaviate-go-client/v5/weaviate/auth"
+ "github.com/weaviate/weaviate/entities/models"
+)
+
+func main() {
+ // Best practice: store your credentials in environment variables
+ weaviateURL := os.Getenv("WEAVIATE_HOST")
+ weaviateAPIKey := os.Getenv("WEAVIATE_API_KEY")
+
+ // Step 1.1: Connect to your Weaviate Cloud instance
+ cfg := weaviate.Config{
+ Host: weaviateURL,
+ Scheme: "https",
+ AuthConfig: auth.ApiKey{Value: weaviateAPIKey},
+ }
+ client, err := weaviate.NewClient(cfg)
+ if err != nil {
+ panic(err)
+ }
+
+ // END CreateCollection
+
+ // NOT SHOWN TO THE USER - DELETE EXISTING COLLECTION
+ client.Schema().ClassDeleter().WithClassName("Movie").Do(context.Background())
+
+ // START CreateCollection
+ // Step 1.2: Create a collection
+ // highlight-start
+ classObj := &models.Class{
+ Class: "Movie",
+ Vectorizer: "none", // No automatic vectorization since we're providing vectors
+ ModuleConfig: map[string]interface{}{
+ "generative-anthropic": map[string]interface{}{},
+ },
+ }
+
+ err = client.Schema().ClassCreator().WithClass(classObj).Do(context.Background())
+ if err != nil {
+ panic(err)
+ }
+ // highlight-end
+
+ // END CreateCollection
+
+ // START CreateCollection
+ // Step 1.3: Import three objects
+ dataObjects := []struct {
+ Properties map[string]interface{}
+ Vector []float32
+ }{
+ {
+ Properties: map[string]interface{}{
+ "title": "The Matrix",
+ "description": "A computer hacker learns about the true nature of reality and his role in the war against its controllers.",
+ "genre": "Science Fiction",
+ },
+ Vector: []float32{0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8},
+ },
+ {
+ Properties: map[string]interface{}{
+ "title": "Spirited Away",
+ "description": "A young girl becomes trapped in a mysterious world of spirits and must find a way to save her parents and return home.",
+ "genre": "Animation",
+ },
+ Vector: []float32{0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9},
+ },
+ {
+ Properties: map[string]interface{}{
+ "title": "The Lord of the Rings: The Fellowship of the Ring",
+ "description": "A meek Hobbit and his companions set out on a perilous journey to destroy a powerful ring and save Middle-earth.",
+ "genre": "Fantasy",
+ },
+ Vector: []float32{0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0},
+ },
+ }
+
+ // END CreateCollection
+
+ // START CreateCollection
+ // Insert the objects with vectors
+ objects := make([]*models.Object, len(dataObjects))
+ for i, obj := range dataObjects {
+ objects[i] = &models.Object{
+ Class: "Movie",
+ Properties: obj.Properties,
+ Vector: obj.Vector,
+ }
+ }
+
+ _, err = client.Batch().ObjectsBatcher().WithObjects(objects...).Do(context.Background())
+ if err != nil {
+ panic(err)
+ }
+
+ fmt.Printf("Imported %d objects with vectors into the Movie collection\n", len(dataObjects))
+ // END CreateCollection
+}
diff --git a/_includes/code/howto/go/docs/quickstart/short_vectors_2/quickstart.short.import_vectors.query.nearvector.go b/_includes/code/howto/go/docs/quickstart/short_vectors_2/quickstart.short.import_vectors.query.nearvector.go
new file mode 100644
index 00000000..626ab521
--- /dev/null
+++ b/_includes/code/howto/go/docs/quickstart/short_vectors_2/quickstart.short.import_vectors.query.nearvector.go
@@ -0,0 +1,75 @@
+package main
+
+// NearText
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+ "os"
+
+ "github.com/weaviate/weaviate-go-client/v5/weaviate"
+ "github.com/weaviate/weaviate-go-client/v5/weaviate/auth"
+ "github.com/weaviate/weaviate-go-client/v5/weaviate/graphql"
+)
+
+func main() {
+ // Best practice: store your credentials in environment variables
+ weaviateURL := os.Getenv("WEAVIATE_HOST")
+ weaviateAPIKey := os.Getenv("WEAVIATE_API_KEY")
+
+ // Step 1.1: Connect to your Weaviate Cloud instance
+ cfg := weaviate.Config{
+ Host: weaviateURL,
+ Scheme: "https",
+ AuthConfig: auth.ApiKey{Value: weaviateAPIKey},
+ }
+ client, err := weaviate.NewClient(cfg)
+ if err != nil {
+ panic(err)
+ }
+
+ // Step 2.2 & 2.3: Perform a vector search with NearVector
+ // highlight-start
+ // END NearText
+
+ // NearText
+ title := graphql.Field{Name: "title"}
+ description := graphql.Field{Name: "description"}
+ genre := graphql.Field{Name: "genre"}
+
+ nearVector := client.GraphQL().NearVectorArgBuilder().
+ WithVector([]float32{0.11, 0.21, 0.31, 0.41, 0.51, 0.61, 0.71, 0.81})
+
+ result, err := client.GraphQL().Get().
+ WithClassName("Movie").
+ WithNearVector(nearVector).
+ WithLimit(2).
+ WithFields(title, description, genre).
+ Do(context.Background())
+ // END NearText
+
+ // NearText
+ // highlight-end
+
+ if err != nil {
+ panic(err)
+ }
+
+ // Inspect the results
+ if result.Errors != nil {
+ fmt.Printf("Error: %v\n", result.Errors)
+ return
+ }
+
+ data := result.Data["Get"].(map[string]interface{})
+ movies := data["Movie"].([]interface{})
+
+ for _, movie := range movies {
+ jsonData, err := json.MarshalIndent(movie, "", " ")
+ if err != nil {
+ panic(err)
+ }
+ fmt.Println(string(jsonData))
+ }
+ // END NearText
+}
diff --git a/_includes/code/howto/go/docs/quickstart/short_vectors_3/quickstart.short.import_vectors.query.rag.go b/_includes/code/howto/go/docs/quickstart/short_vectors_3/quickstart.short.import_vectors.query.rag.go
new file mode 100644
index 00000000..82d4c45a
--- /dev/null
+++ b/_includes/code/howto/go/docs/quickstart/short_vectors_3/quickstart.short.import_vectors.query.rag.go
@@ -0,0 +1,70 @@
+package main
+
+// RAG
+import (
+ "context"
+ "fmt"
+ "os"
+
+ "github.com/weaviate/weaviate-go-client/v5/weaviate"
+ "github.com/weaviate/weaviate-go-client/v5/weaviate/auth"
+ "github.com/weaviate/weaviate-go-client/v5/weaviate/graphql"
+)
+
+func main() {
+ // Best practice: store your credentials in environment variables
+ weaviateURL := os.Getenv("WEAVIATE_URL")
+ weaviateAPIKey := os.Getenv("WEAVIATE_API_KEY")
+ anthropicAPIKey := os.Getenv("ANTHROPIC_API_KEY")
+
+ // Step 2.1: Connect to your Weaviate Cloud instance
+ // highlight-start
+ headers := map[string]string{
+ "X-Anthropic-Api-Key": anthropicAPIKey,
+ }
+
+ cfg := weaviate.Config{
+ Host: weaviateURL,
+ Scheme: "https",
+ AuthConfig: auth.ApiKey{Value: weaviateAPIKey},
+ Headers: headers,
+ }
+ client, err := weaviate.NewClient(cfg)
+ if err != nil {
+ panic(err)
+ }
+ // highlight-end
+
+ // Step 2.2 & 2.3: Perform RAG with NearText results
+ // highlight-start
+ title := graphql.Field{Name: "title"}
+ description := graphql.Field{Name: "description"}
+ genre := graphql.Field{Name: "genre"}
+
+ nearVector := client.GraphQL().NearVectorArgBuilder().
+ WithVector([]float32{0.11, 0.21, 0.31, 0.41, 0.51, 0.61, 0.71, 0.81})
+
+ generate := graphql.NewGenerativeSearch().GroupedResult("Write a tweet with emojis about this movie.")
+
+ result, err := client.GraphQL().Get().
+ WithClassName("Movie").
+ WithNearVector(nearVector).
+ WithLimit(1).
+ WithFields(title, description, genre).
+ WithGenerativeSearch(generate).
+ Do(context.Background())
+ // highlight-end
+
+ if err != nil {
+ panic(err)
+ }
+
+ // Inspect the results
+ if result.Errors != nil {
+ fmt.Printf("Error: %v\n", result.Errors)
+ return
+ }
+
+ fmt.Printf("%v", result)
+ // END RAG
+}
diff --git a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartCreate.java b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartCreate.java
new file mode 100644
index 00000000..b4e0a1fa
--- /dev/null
+++ b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartCreate.java
@@ -0,0 +1,77 @@
+package io.weaviate.docs.quickstart;
+
+// START CreateCollection
+import io.weaviate.client.Config;
+import io.weaviate.client.WeaviateAuthClient;
+import io.weaviate.client.WeaviateClient;
+import io.weaviate.client.base.Result;
+import io.weaviate.client.v1.auth.exception.AuthException;
+import io.weaviate.client.v1.schema.model.WeaviateClass;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class QuickstartCreate {
+ public static void main(String[] args) throws AuthException {
+ // Best practice: store your credentials in environment variables
+ String weaviateUrl = System.getenv("WEAVIATE_URL");
+ String weaviateApiKey = System.getenv("WEAVIATE_API_KEY");
+
+ // Step 1.1: Connect to your Weaviate Cloud instance
+ Config config = new Config("https", weaviateUrl.replace("https://", ""));
+ WeaviateClient client = WeaviateAuthClient.apiKey(config, weaviateApiKey);
+
+ // END CreateCollection
+
+ // NOT SHOWN TO THE USER - DELETE EXISTING COLLECTION
+ client.schema().classDeleter().withClassName("Movie").run();
+
+ // START CreateCollection
+ // Step 1.2: Create a collection
+ Map moduleConfig = new HashMap<>();
+ Map generativeAnthropicSettings = new HashMap<>();
+ moduleConfig.put("generative-anthropic", generativeAnthropicSettings);
+
+ // highlight-start
+ WeaviateClass movieClass = WeaviateClass.builder()
+ .className("Movie")
+ .vectorizer("text2vec-weaviate")
+ .moduleConfig(moduleConfig)
+ .build();
+
+ Result result = client.schema().classCreator()
+ .withClass(movieClass)
+ .run();
+ // highlight-end
+
+ // Step 1.3: Import three objects
+ List
@@ -54,35 +49,7 @@ The collection also contains a configuration for the generative (RAG) integratio
startMarker="// START CreateCollection"
endMarker="// END CreateCollection"
language="javaraw"
- title="quickstart/CreateCollection.java"
/>
-
-
-
-
-The collection also contains a configuration for the generative (RAG) integration:
-
-- OpenAI [generative AI integrations](/weaviate/model-providers/openai/generative) for retrieval augmented generation (RAG).
-
-```bash
-# Best practice: store your credentials in environment variables
-# export WEAVIATE_URL="YOUR_INSTANCE_URL" # Your Weaviate instance URL
-# export WEAVIATE_API_KEY="YOUR_API_KEY" # Your Weaviate instance API key
-
-curl -X POST \
--H "Content-Type: application/json" \
--H "Authorization: Bearer $WEAVIATE_API_KEY" \
--d '{
- "class": "Question",
- "vectorizer": "text2vec-weaviate",
- "moduleConfig": {
- "text2vec-weaviate": {},
- "generative-cohere": {}
- }
-}' \
-"$WEAVIATE_URL/v1/schema"
-```
-
diff --git a/_includes/code/quickstart/quickstart.short.import-vectors.query.rag.mdx b/_includes/code/quickstart/quickstart.short.import-vectors.query.rag.mdx
index 49d7cf03..f1cedfa3 100644
--- a/_includes/code/quickstart/quickstart.short.import-vectors.query.rag.mdx
+++ b/_includes/code/quickstart/quickstart.short.import-vectors.query.rag.mdx
@@ -2,27 +2,25 @@ import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import FilteredTextBlock from "@site/src/components/Documentation/FilteredTextBlock";
import PyCode from "!!raw-loader!/_includes/code/python/quickstart.short.import_vectors.query.rag.py";
-import TSCode from "!!raw-loader!/_includes/code/typescript/quickstart.query.rag.ts";
-import GoCode from "!!raw-loader!/_includes/code/howto/go/docs/quickstart/3_2_rag/main.go";
-import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/RAG.java";
+import TSCode from "!!raw-loader!/_includes/code/typescript/quickstart.short.import_vectors.query.rag.ts";
+import GoCode from "!!raw-loader!/_includes/code/howto/go/docs/quickstart/short_vectors_3/quickstart.short.import_vectors.query.rag.go";
+import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearVectorRAG.java";
@@ -31,7 +29,6 @@ import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/w
startMarker="// RAG"
endMarker="// END RAG"
language="goraw"
- title="quickstart/3_2_rag/main.go"
/>
@@ -40,52 +37,6 @@ import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/w
startMarker="// START RAG"
endMarker="// END RAG"
language="javaraw"
- title="quickstart/RAG.java"
/>
-
-
-```bash
-# Best practice: store your credentials in environment variables
-# export WEAVIATE_URL="YOUR_INSTANCE_URL" # Your Weaviate instance URL
-# export WEAVIATE_API_KEY="YOUR_API_KEY" # Your Weaviate instance API key
-# export COHERE_APIKEY="YOUR_API_KEY" # Your Cohere API key
-
-echo '{
- "query": "{
- Get {
- Question (
- limit: 2
- nearText: {
- concepts: [\"biology\"],
- }
- ) {
- question
- answer
- category
- _additional {
- generate(
- groupedResult: {
- task: \"\"\"
- Write a tweet with emojis about this movie.
- \"\"\"
- }
- ) {
- groupedResult
- error
- }
- }
- }
- }
- }"
-}' | tr -d "\n" | curl \
- -X POST \
- -H 'Content-Type: application/json' \
- -H "Authorization: Bearer $WEAVIATE_API_KEY" \
- -H "X-Cohere-Api-Key: $COHERE_APIKEY" \
- -d @- \
- $WEAVIATE_URL/v1/graphql
-```
-
-
diff --git a/_includes/code/quickstart/quickstart.short.import_vectors.create_collection.mdx b/_includes/code/quickstart/quickstart.short.import_vectors.create_collection.mdx
index 25722c65..e277274b 100644
--- a/_includes/code/quickstart/quickstart.short.import_vectors.create_collection.mdx
+++ b/_includes/code/quickstart/quickstart.short.import_vectors.create_collection.mdx
@@ -2,11 +2,9 @@ import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import FilteredTextBlock from "@site/src/components/Documentation/FilteredTextBlock";
import PyCode from "!!raw-loader!/_includes/code/python/quickstart.short.import_vectors.create_collection.py";
-import TSCode from "!!raw-loader!/_includes/code/typescript/quickstart.create_collection.ts";
-import GoCode from "!!raw-loader!/_includes/code/howto/go/docs/quickstart/2_1_create_collection/main.go";
-import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/CreateCollection.java";
-import VectorConfigSyntax from "/_includes/vector-config-syntax.mdx";
-import VectorsAutoSchemaError from "/_includes/error-note-vectors-autoschema.mdx";
+import TSCode from "!!raw-loader!/_includes/code/typescript/quickstart.short.import_vectors.create_collection.ts";
+import GoCode from "!!raw-loader!/_includes/code/howto/go/docs/quickstart/short_vectors_1/quickstart.short.import_vectors.create_collection.go";
+import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartCreateVectors.java";
@@ -15,16 +13,14 @@ import VectorsAutoSchemaError from "/_includes/error-note-vectors-autoschema.mdx
startMarker="# START CreateCollection"
endMarker="# END CreateCollection"
language="py"
- title="quickstart_create_collection.py"
/>
@@ -39,7 +35,6 @@ The collection also contains a configuration for the generative (RAG) integratio
startMarker="// START CreateCollection"
endMarker="// END CreateCollection"
language="goraw"
- title="quickstart/2_1_create_collection/main.go"
/>
@@ -54,35 +49,7 @@ The collection also contains a configuration for the generative (RAG) integratio
startMarker="// START CreateCollection"
endMarker="// END CreateCollection"
language="javaraw"
- title="quickstart/CreateCollection.java"
/>
-
-
-
-
-The collection also contains a configuration for the generative (RAG) integration:
-
-- OpenAI [generative AI integrations](/weaviate/model-providers/openai/generative) for retrieval augmented generation (RAG).
-
-```bash
-# Best practice: store your credentials in environment variables
-# export WEAVIATE_URL="YOUR_INSTANCE_URL" # Your Weaviate instance URL
-# export WEAVIATE_API_KEY="YOUR_API_KEY" # Your Weaviate instance API key
-
-curl -X POST \
--H "Content-Type: application/json" \
--H "Authorization: Bearer $WEAVIATE_API_KEY" \
--d '{
- "class": "Question",
- "vectorizer": "text2vec-weaviate",
- "moduleConfig": {
- "text2vec-weaviate": {},
- "generative-cohere": {}
- }
-}' \
-"$WEAVIATE_URL/v1/schema"
-```
-
diff --git a/_includes/code/quickstart/quickstart.short.import_vectors.query.nearvector.mdx b/_includes/code/quickstart/quickstart.short.import_vectors.query.nearvector.mdx
index 8fd27b68..def81df3 100644
--- a/_includes/code/quickstart/quickstart.short.import_vectors.query.nearvector.mdx
+++ b/_includes/code/quickstart/quickstart.short.import_vectors.query.nearvector.mdx
@@ -1,86 +1,42 @@
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-import FilteredTextBlock from '@site/src/components/Documentation/FilteredTextBlock';
-import PyCode from '!!raw-loader!/_includes/code/python/quickstart.short.import_vectors.query.nearvector.py';
-import TSCode from '!!raw-loader!/_includes/code/typescript/quickstart.query.neartext.ts';
-import GoCode from '!!raw-loader!/_includes/code/howto/go/docs/quickstart/3_1_neartext/main.go';
-import JavaCode from '!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/NearText.java';
-
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+import FilteredTextBlock from "@site/src/components/Documentation/FilteredTextBlock";
+import PyCode from "!!raw-loader!/_includes/code/python/quickstart.short.import_vectors.query.nearvector.py";
+import TSCode from "!!raw-loader!/_includes/code/typescript/quickstart.short.import_vectors.query.nearvector.ts";
+import GoCode from "!!raw-loader!/_includes/code/howto/go/docs/quickstart/short_vectors_2/quickstart.short.import_vectors.query.nearvector.go";
+import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearVector.java";
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-```bash
-# Best practice: store your credentials in environment variables
-# export WEAVIATE_URL="YOUR_INSTANCE_URL" # Your Weaviate instance URL
-# export WEAVIATE_API_KEY="YOUR_API_KEY" # Your Weaviate instance API key
-
-echo '{
- "query": "{
- Get {
- Question (
- limit: 2
- nearText: {
- concepts: [\"biology\"],
- }
- ) {
- question
- answer
- category
- }
- }
- }"
-}' | tr -d "\n" | curl \
- -X POST \
- -H 'Content-Type: application/json' \
- -H "Authorization: Bearer $WEAVIATE_API_KEY" \
- -d @- \
- $WEAVIATE_URL/v1/graphql
-```
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/_includes/code/quickstart/quickstart.short.query.neartext.mdx b/_includes/code/quickstart/quickstart.short.query.neartext.mdx
index 1dc96e77..9889910c 100644
--- a/_includes/code/quickstart/quickstart.short.query.neartext.mdx
+++ b/_includes/code/quickstart/quickstart.short.query.neartext.mdx
@@ -1,86 +1,42 @@
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-import FilteredTextBlock from '@site/src/components/Documentation/FilteredTextBlock';
-import PyCode from '!!raw-loader!/_includes/code/python/quickstart.short.query.neartext.py';
-import TSCode from '!!raw-loader!/_includes/code/typescript/quickstart.query.neartext.ts';
-import GoCode from '!!raw-loader!/_includes/code/howto/go/docs/quickstart/3_1_neartext/main.go';
-import JavaCode from '!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/NearText.java';
-
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+import FilteredTextBlock from "@site/src/components/Documentation/FilteredTextBlock";
+import PyCode from "!!raw-loader!/_includes/code/python/quickstart.short.query.neartext.py";
+import TSCode from "!!raw-loader!/_includes/code/typescript/quickstart.short.query.neartext.ts";
+import GoCode from "!!raw-loader!/_includes/code/howto/go/docs/quickstart/short_2/quickstart.short.query.neartext.go";
+import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearText.java";
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-```bash
-# Best practice: store your credentials in environment variables
-# export WEAVIATE_URL="YOUR_INSTANCE_URL" # Your Weaviate instance URL
-# export WEAVIATE_API_KEY="YOUR_API_KEY" # Your Weaviate instance API key
-
-echo '{
- "query": "{
- Get {
- Question (
- limit: 2
- nearText: {
- concepts: [\"biology\"],
- }
- ) {
- question
- answer
- category
- }
- }
- }"
-}' | tr -d "\n" | curl \
- -X POST \
- -H 'Content-Type: application/json' \
- -H "Authorization: Bearer $WEAVIATE_API_KEY" \
- -d @- \
- $WEAVIATE_URL/v1/graphql
-```
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/_includes/code/quickstart/quickstart.short.query.rag.mdx b/_includes/code/quickstart/quickstart.short.query.rag.mdx
index 7f4783be..6eb7061d 100644
--- a/_includes/code/quickstart/quickstart.short.query.rag.mdx
+++ b/_includes/code/quickstart/quickstart.short.query.rag.mdx
@@ -2,36 +2,33 @@ import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";
import FilteredTextBlock from "@site/src/components/Documentation/FilteredTextBlock";
import PyCode from "!!raw-loader!/_includes/code/python/quickstart.short.query.rag.py";
-import TSCode from "!!raw-loader!/_includes/code/typescript/quickstart.query.rag.ts";
-import GoCode from "!!raw-loader!/_includes/code/howto/go/docs/quickstart/3_2_rag/main.go";
-import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/RAG.java";
+import TSCode from "!!raw-loader!/_includes/code/typescript/quickstart.short.query.rag.ts";
+import GoCode from "!!raw-loader!/_includes/code/howto/go/docs/quickstart/short_3/quickstart.short.query.rag.go";
+import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearTextRAG.java";
@@ -40,52 +37,6 @@ import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/w
startMarker="// START RAG"
endMarker="// END RAG"
language="javaraw"
- title="quickstart/RAG.java"
/>
-
-
-```bash
-# Best practice: store your credentials in environment variables
-# export WEAVIATE_URL="YOUR_INSTANCE_URL" # Your Weaviate instance URL
-# export WEAVIATE_API_KEY="YOUR_API_KEY" # Your Weaviate instance API key
-# export COHERE_APIKEY="YOUR_API_KEY" # Your Cohere API key
-
-echo '{
- "query": "{
- Get {
- Question (
- limit: 2
- nearText: {
- concepts: [\"biology\"],
- }
- ) {
- question
- answer
- category
- _additional {
- generate(
- groupedResult: {
- task: \"\"\"
- Write a tweet with emojis about this movie.
- \"\"\"
- }
- ) {
- groupedResult
- error
- }
- }
- }
- }
- }"
-}' | tr -d "\n" | curl \
- -X POST \
- -H 'Content-Type: application/json' \
- -H "Authorization: Bearer $WEAVIATE_API_KEY" \
- -H "X-Cohere-Api-Key: $COHERE_APIKEY" \
- -d @- \
- $WEAVIATE_URL/v1/graphql
-```
-
-
diff --git a/_includes/code/typescript/quickstart.short.import_vectors.query.neartext.ts b/_includes/code/typescript/quickstart.short.import_vectors.query.nearvector.ts
similarity index 94%
rename from _includes/code/typescript/quickstart.short.import_vectors.query.neartext.ts
rename to _includes/code/typescript/quickstart.short.import_vectors.query.nearvector.ts
index 266bbde1..3b732cc5 100644
--- a/_includes/code/typescript/quickstart.short.import_vectors.query.neartext.ts
+++ b/_includes/code/typescript/quickstart.short.import_vectors.query.nearvector.ts
@@ -1,4 +1,4 @@
-// NearText
+// START NearText
import weaviate, { WeaviateClient, ApiKey } from 'weaviate-client';
// Best practice: store your credentials in environment variables
@@ -20,7 +20,7 @@ const movies = client.collections.get('Movie');
// highlight-start
// END NearText
-// NearText
+// START NearText
const response = await movies.query.nearVector(
[0.11, 0.21, 0.31, 0.41, 0.51, 0.61, 0.71, 0.81],
{
@@ -29,7 +29,7 @@ const response = await movies.query.nearVector(
);
// END NearText
-// NearText
+// START NearText
// highlight-end
for (const obj of response.objects) {
diff --git a/_includes/code/typescript/quickstart.short.import_vectors.query.rag.ts b/_includes/code/typescript/quickstart.short.import_vectors.query.rag.ts
index 93d18b24..aed74f97 100644
--- a/_includes/code/typescript/quickstart.short.import_vectors.query.rag.ts
+++ b/_includes/code/typescript/quickstart.short.import_vectors.query.rag.ts
@@ -1,4 +1,4 @@
-// RAG
+// START RAG
import weaviate, { WeaviateClient, ApiKey, generativeParameters } from 'weaviate-client';
// Best practice: store your credentials in environment variables
diff --git a/_includes/code/typescript/quickstart.short.query.neartext.ts b/_includes/code/typescript/quickstart.short.query.neartext.ts
index 8047abcf..3eef3dca 100644
--- a/_includes/code/typescript/quickstart.short.query.neartext.ts
+++ b/_includes/code/typescript/quickstart.short.query.neartext.ts
@@ -1,4 +1,4 @@
-// NearText
+// START NearText
import weaviate, { WeaviateClient, ApiKey } from 'weaviate-client';
// Best practice: store your credentials in environment variables
@@ -20,7 +20,7 @@ const movies = client.collections.get('Movie');
// highlight-start
// END NearText
-// NearText
+// START NearText
const response = await movies.query.nearText(
'sci-fi',
{
@@ -29,7 +29,7 @@ const response = await movies.query.nearText(
);
// END NearText
-// NearText
+// START NearText
// highlight-end
for (const obj of response.objects) {
diff --git a/_includes/code/typescript/quickstart.short.query.rag.ts b/_includes/code/typescript/quickstart.short.query.rag.ts
index 14b74860..9947075e 100644
--- a/_includes/code/typescript/quickstart.short.query.rag.ts
+++ b/_includes/code/typescript/quickstart.short.query.rag.ts
@@ -1,4 +1,4 @@
-// RAG
+// START RAG
import weaviate, { WeaviateClient, ApiKey, generativeParameters } from 'weaviate-client';
// Best practice: store your credentials in environment variables
From 22cc66a4ec7cdf2da39e371cc4abbe7c0847e3be Mon Sep 17 00:00:00 2001
From: Ivan Despot <66276597+g-despot@users.noreply.github.com>
Date: Wed, 5 Nov 2025 16:52:41 +0100
Subject: [PATCH 11/16] Update docs
---
docs/weaviate/quickstart/_category_.json | 4 -
docs/weaviate/quickstart/index.md | 115 ++---
docs/weaviate/quickstart/local.md | 598 +++++++----------------
3 files changed, 228 insertions(+), 489 deletions(-)
delete mode 100644 docs/weaviate/quickstart/_category_.json
diff --git a/docs/weaviate/quickstart/_category_.json b/docs/weaviate/quickstart/_category_.json
deleted file mode 100644
index 60eb4886..00000000
--- a/docs/weaviate/quickstart/_category_.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "label": "Quickstart",
- "position": 10
-}
\ No newline at end of file
diff --git a/docs/weaviate/quickstart/index.md b/docs/weaviate/quickstart/index.md
index 5cfafb02..1200344b 100644
--- a/docs/weaviate/quickstart/index.md
+++ b/docs/weaviate/quickstart/index.md
@@ -12,23 +12,29 @@ import Tooltip from "/src/components/Tooltip";
import styles from "/src/components/CardsSection/styles.module.scss";
export const quickstartOptions = [
-{
-title: ( <> Vectorize objects during import (recommended) >),
-description:
-"Import objects and vectorize them with the Weaviate Embeddings service.",
-link: "?import=vectorization",
-icon: "fas fa-arrows-spin",
-groupId: "import",
-activeTab: "vectorization",
-},
-{
-title: "Import vectors",
-description: "Import pre-computed vector embeddings along with your data.",
-link: "?import=custom-embeddings",
-icon: "fas fa-circle-nodes",
-groupId: "import",
-activeTab: "custom-embeddings",
-},
+ {
+ title: (
+ <>
+ Vectorize objects during import
+
+ (recommended)
+ >
+ ),
+ description:
+ "Import objects and vectorize them with the Weaviate Embeddings service.",
+ link: "?import=vectorization",
+ icon: "fas fa-arrows-spin",
+ groupId: "import",
+ activeTab: "vectorization",
+ },
+ {
+ title: "Import vectors",
+ description: "Import pre-computed vector embeddings along with your data.",
+ link: "?import=custom-embeddings",
+ icon: "fas fa-circle-nodes",
+ groupId: "import",
+ activeTab: "custom-embeddings",
+ },
];
:::note Local Quickstart
@@ -42,7 +48,7 @@ Weaviate is an open-source vector database built to power AI applications, from
There are two paths you can choose from:
-
+
@@ -65,7 +71,7 @@ This quickstart guide will show you how to:
-import KapaAI from '/src/components/KapaAI';
+import KapaAI from "/src/components/KapaAI";
If you encounter any issues along the way or have additional questions, use the Ask AI feature.
@@ -90,7 +96,7 @@ Go to the [Weaviate Cloud console](https://console.weaviate.cloud) and create a
src="https://app.guideflow.com/embed/mk6l470aqk"
width="100%"
height="100%"
- style={{overflow: "hidden", position: "absolute", border: "none"}}
+ style={{ overflow: "hidden", position: "absolute", border: "none" }}
scrolling="no"
allow="clipboard-read; clipboard-write"
webKitAllowFullScreen
@@ -170,23 +176,18 @@ Once you have the **REST Endpoint URL** and the **admin API key**, you can conne
Follow the instructions below to install one of the official client libraries, available in [Python](../client-libraries/python/index.mdx), [JavaScript/TypeScript](../client-libraries/typescript/index.mdx), [Go](../client-libraries/go.md), and [Java](../client-libraries/java.md).
-import CodeClientInstall from "/\_includes/code/quickstart/clients.install.new.mdx";
+import CodeClientInstall from "/_includes/code/quickstart/clients.install.new.mdx";
## Step 1: Create a collection & import data {#create-a-collection}
-
The following example creates a collection called `Movie` with the [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service for vectorizing data during import and for querying.
-
-
-import CreateCollection from "/\_includes/code/quickstart/quickstart.short.create_collection.mdx";
+import CreateCollection from "/_includes/code/quickstart/quickstart.short.create_collection.mdx";
@@ -195,7 +196,7 @@ import CreateCollection from "/\_includes/code/quickstart/quickstart.short.creat
The following example creates a collection called `Movie` and imports pre-computed vectors along with the movie data. We will define the collection properties explicitly, but you can also use the [auto-schema](../config-refs/collections.mdx#auto-schema) feature to infer the data schema automatically.
-import CreateCollectionCustomVectors from "/\_includes/code/quickstart/quickstart.short.import_vectors.create_collection.mdx";
+import CreateCollectionCustomVectors from "/_includes/code/quickstart/quickstart.short.import_vectors.create_collection.mdx";
@@ -209,7 +210,7 @@ import CreateCollectionCustomVectors from "/\_includes/code/quickstart/quickstar
Semantic search finds results based on meaning. This is called `nearText` in Weaviate. The following example searches for 2 objects (_limit_) whose meaning is most similar to that of `sci-fi`.
-import QueryNearText from "/\_includes/code/quickstart/quickstart.short.query.neartext.mdx";
+import QueryNearText from "/_includes/code/quickstart/quickstart.short.query.neartext.mdx";
@@ -218,7 +219,7 @@ import QueryNearText from "/\_includes/code/quickstart/quickstart.short.query.ne
Semantic search finds results based on meaning. This is called `nearVector` in Weaviate. The following example searches for 2 objects (_limit_) whose vector is most similar to the query vector.
-import QueryNearVectorImportVectors from "/\_includes/code/quickstart/quickstart.short.import_vectors.query.nearvector.mdx";
+import QueryNearVectorImportVectors from "/_includes/code/quickstart/quickstart.short.import_vectors.query.nearvector.mdx";
@@ -263,7 +264,7 @@ Retrieval augmented generation (RAG), also called generative search, works by pr
The following example combines the semantic search for the query `sci-fi` with a prompt to generate a tweet.
-import QueryRAG from "/\_includes/code/quickstart/quickstart.short.query.rag.mdx";
+import QueryRAG from "/_includes/code/quickstart/quickstart.short.query.rag.mdx";
@@ -274,7 +275,7 @@ Retrieval augmented generation (RAG), also called generative search, works by pr
The following example combines the vector similarity search with a prompt to generate a tweet.
-import QueryRAGCustomVectors from "/\_includes/code/quickstart/quickstart.short.import-vectors.query.rag.mdx";
+import QueryRAGCustomVectors from "/_includes/code/quickstart/quickstart.short.import-vectors.query.rag.mdx";
@@ -302,30 +303,30 @@ Are you ready to see how deep the rabbit hole goes? ðīðĩ #TheMatrix #WakeUp
We recommend you check out the following resources to continue learning about Weaviate.
export const nextStepsCardsData = [
-{
-title: "Quick tour of Weaviate",
-description: (
-<>
-Continue with the{" "}
-Quick tour tutorial â an
-end-to-end guide that covers important topics like configuring
-collections, searches, etc.
->
-),
-link: "/weaviate/tutorials/quick-tour-of-weaviate",
-icon: "fas fa-signs-post",
-},
-{
-title: "Weaviate Academy",
-description: (
-<>
-Check out Weaviate Academy â a
-learning platform centered around AI-native development.
->
-),
-link: "https://academy.weaviate.io/",
-icon: "fa-solid fa-graduation-cap",
-},
+ {
+ title: "Quick tour of Weaviate",
+ description: (
+ <>
+ Continue with the{" "}
+ Quick tour tutorial â an
+ end-to-end guide that covers important topics like configuring
+ collections, searches, etc.
+ >
+ ),
+ link: "/weaviate/tutorials/quick-tour-of-weaviate",
+ icon: "fas fa-signs-post",
+ },
+ {
+ title: "Weaviate Academy",
+ description: (
+ <>
+ Check out Weaviate Academy â a
+ learning platform centered around AI-native development.
+ >
+ ),
+ link: "https://academy.weaviate.io/",
+ icon: "fa-solid fa-graduation-cap",
+ },
];
@@ -333,6 +334,6 @@ icon: "fa-solid fa-graduation-cap",
## Questions and feedback
-import DocsFeedback from "/\_includes/docs-feedback.mdx";
+import DocsFeedback from "/_includes/docs-feedback.mdx";
diff --git a/docs/weaviate/quickstart/local.md b/docs/weaviate/quickstart/local.md
index 0a558f88..1d97938b 100644
--- a/docs/weaviate/quickstart/local.md
+++ b/docs/weaviate/quickstart/local.md
@@ -2,98 +2,86 @@
title: 'Quickstart: Locally hosted'
sidebar_label: Locally hosted
image: og/docs/quickstart-tutorial.jpg
-hide_table_of_contents: true
+# tags: ['getting started']
---
-import Tabs from '@theme/Tabs';
-import TabItem from '@theme/TabItem';
-import SkipLink from '/src/components/SkipValidationLink'
-
-Expected time: 30 minutesPrerequisites: None
-
-
-:::info What you will learn
-
-This quickstart shows you how to combine open-source Weaviate and Ollama to:
-
-1. Set up a Weaviate instance. (10 minutes)
-1. Add and vectorize your data. (10 minutes)
-1. Perform a semantic search and retrieval augmented generation (RAG). (10 minutes)
-
-```mermaid
-flowchart LR
- %% Define nodes with white backgrounds and darker borders
- A1["Run Weaviate with Docker"] --> A2["Install client library"]
- A2 --> A3["Connect to Weaviate"]
- A3 --> B1["Define collection (with Ollama)"]
- B1 --> B2["Batch import objects"]
- B2 --> C1["Semantic search (nearText)"]
- C1 --> C2["RAG (Generate)"]
-
- %% Group nodes in subgraphs with brand colors
- subgraph sg1 ["1\. Setup"]
- A1
- A2
- A3
- end
-
- subgraph sg2 ["2\. Populate"]
- B1
- B2
- end
-
- subgraph sg3 ["3\. Query"]
- C1
- C2
- end
-
- %% Style nodes with white background and darker borders
- style A1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style A2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style A3 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style B1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style B2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style C1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style C2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
-
- %% Style subgraphs with brand colors
- style sg1 fill:#ffffff,stroke:#61BD73,stroke-width:2px,color:#130C49
- style sg2 fill:#ffffff,stroke:#130C49,stroke-width:2px,color:#130C49
- style sg3 fill:#ffffff,stroke:#7AD6EB,stroke-width:2px,color:#130C49
-```
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+import SkipLink from "/src/components/SkipValidationLink";
+import CardsSection from "/src/components/CardsSection";
+import Tooltip from "/src/components/Tooltip";
+import styles from "/src/components/CardsSection/styles.module.scss";
-Notes:
+export const quickstartOptions = [
+ {
+ title: (
+ <>
+ Vectorize objects during import
+
+ (recommended)
+ >
+ ),
+ description:
+ "Import objects and vectorize them with the Ollama embedding model.",
+ link: "?import=vectorization",
+ icon: "fas fa-arrows-spin",
+ groupId: "import",
+ activeTab: "vectorization",
+ },
+ {
+ title: "Import vectors",
+ description: "Import pre-computed vector embeddings along with your data.",
+ link: "?import=custom-embeddings",
+ icon: "fas fa-circle-nodes",
+ groupId: "import",
+ activeTab: "custom-embeddings",
+ },
+];
-- The code examples here are self-contained. You can copy and paste them into your own environment to try them out.
-
-- If you prefer to use cloud-based resources, see [Quickstart: with cloud resources](./local.md).
-:::
+Weaviate is an open-source vector database built to power AI applications, from prototypes to production-scale systems. This guide will show you how to connect to a local Weaviate instance, import data, vectorize objects and perform searches.
-
+There are two paths you can choose from:
-### Prerequisites
+
+
-Before we get started, install [Docker](https://docs.docker.com/get-started/get-docker/) and [Ollama](https://ollama.com/download) on your machine.
+
+
-Then, download the `nomic-embed-text` and `llama3.2` models by running the following command:
+This quickstart guide will show you how to:
-```bash
-ollama pull nomic-embed-text
-ollama pull llama3.2
-```
+1. **Create a collection & import data** - Create a collection and import data into it. The data will be vectorized with the Ollama embedding model service. You are also free to use any other available embedding model provider.
+2. **Search** - Perform a similarity (vector) search on your data using a text query.
+3. **RAG** - Perform Retrieval Augmented Generation (RAG) with a generative model.
+
+
+
+
+This quickstart guide will show you how to:
+
+1. **Create a collection & import data**- Create a collection and import data into it. The data should already contain the pre-computed vector embeddings. This option is useful for when you are migrating data from a different vector database.
+2. **Search** - Perform a similarity (vector) search on your data using a vector query.
+3. **RAG** - Perform Retrieval Augmented Generation (RAG) with a generative model.
-We will be running Weaviate and language models locally. We recommend that you use a modern computer with at least 8GB of RAM, preferably 16GB or more.
+
+
-
+import KapaAI from "/src/components/KapaAI";
-## Step 1: Set up Weaviate
+If you encounter any issues along the way or have additional questions, use the Ask AI feature.
-### 1.1 Create a Weaviate database
+## Prerequisites
+
+Before we get started, install [Docker](https://docs.docker.com/get-started/get-docker/) on your machine.
+We will be running Weaviate and Ollama language models locally. We recommend that you use a modern computer with at least 8GB of RAM, preferably 16GB or more.
+
+---
+
+## Start Weaviate and Ollama with Docker Compose
Save the following code to a file named `docker-compose.yml` in your project directory.
```yaml
----
services:
weaviate:
command:
@@ -116,436 +104,190 @@ services:
PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
ENABLE_MODULES: 'text2vec-ollama,generative-ollama'
CLUSTER_HOSTNAME: 'node1'
+ OLLAMA_API_ENDPOINT: 'http://ollama:11434'
+ ollama:
+ image: ollama/ollama:0.12.9
+ volumes:
+ - ~/.ollama:/root/.ollama
+ ports:
+ - "11434:11434"
+ environment:
+ - OLLAMA_HOST=0.0.0.0
volumes:
weaviate_data:
-...
+ ollama_data:
```
-Run the following command to start a Weaviate instance using Docker:
+Run the following command to start a Weaviate instance and Ollama using Docker:
```bash
docker-compose up -d
```
-### 1.2 Install a client library
-
-We recommend using a [client library](../client-libraries/index.mdx) to work with Weaviate. Follow the instructions below to install one of the official client libraries, available in [Python](../client-libraries/python/index.mdx), [JavaScript/TypeScript](../client-libraries/typescript/index.mdx), [Go](../client-libraries/go.md), and [Java](../client-libraries/java.md).
-
-import CodeClientInstall from '/_includes/code/quickstart/clients.install.mdx';
-
-
-
-### 1.3: Connect to Weaviate
-
-Now you can connect to your Weaviate instance.
-
-The example below shows how to connect to Weaviate and perform a basic operation, like checking the cluster status.
-
-import ConnectIsReady from '/_includes/code/quickstart/local.quickstart.is_ready.mdx'
-
-
+---
-If you did not see any errors, you are ready to proceed. We will replace the simple cluster status check with more meaningful operations in the next steps.
+## Install a client library
-
+Follow the instructions below to install one of the official client libraries, available in [Python](../client-libraries/python/index.mdx), [JavaScript/TypeScript](../client-libraries/typescript/index.mdx), [Go](../client-libraries/go.md), and [Java](../client-libraries/java.md).
-## Step 2: Populate the database
+import CodeClientInstall from "/_includes/code/quickstart/clients.install.new.mdx";
-Now, we can populate our database by first defining a collection then adding data.
+
-### 2.1 Define a collection
+## Step 1: Create a collection & import data {#create-a-collection}
-:::info What is a collection?
-A collection is a set of objects that share the same data structure, like a table in relational databases or a collection in NoSQL databases. A collection also includes additional configurations that define how the data objects are stored and indexed.
-:::
+
+
-The following example creates a *collection* called `Question` with:
- - Ollama [embedding model integration](../model-providers/ollama/embeddings.md) to create vectors during ingestion & queries, using the `nomic-embed-text` model, and
+The following example creates a collection called `Movie` with the [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service for vectorizing data during import and for querying.
-import CreateCollection from '/_includes/code/quickstart/local.quickstart.create_collection.mdx'
+import CreateCollection from "/_includes/code/quickstart/quickstart.short.create_collection.mdx";
-Run this code to create the collection to which you can add data.
-
-import ModelProvider from '/\_includes/embedding-model-providers.mdx'
-
-
- Do you prefer a different setup?
-
-
-
-### 2.2 Add objects
+
+
-We can now add data to our collection.
+The following example creates a collection called `Movie` and imports pre-computed vectors along with the movie data. We will define the collection properties explicitly, but you can also use the [auto-schema](../config-refs/collections.mdx#auto-schema) feature to infer the data schema automatically.
-The following example:
-- Loads objects, and
-- Adds objects to the target collection (`Question`) using a batch process.
-
-:::tip Batch imports
-([Batch imports](../manage-objects/import.mdx)) are the most efficient way to add large amounts of data, as it sends multiple objects in a single request. See the [How-to: Batch import](../manage-objects/import.mdx) guide for more information.
-:::
+import CreateCollectionCustomVectors from "/_includes/code/quickstart/quickstart.short.import_vectors.create_collection.mdx";
-import ImportObjects from '/_includes/code/quickstart/local.quickstart.import_objects.mdx'
+
-
+
+
-Run this code to add the demo data.
+## Step 2: Semantic (vector) search {#semantic-search}
-
+
+
-## Step 3: Queries
+Semantic search finds results based on meaning. This is called `nearText` in Weaviate. The following example searches for 2 objects (_limit_) whose meaning is most similar to that of `sci-fi`.
-Weaviate provides a wide range of query tools to help you find the right data. We will try a few searches here.
+import QueryNearText from "/_includes/code/quickstart/quickstart.short.query.neartext.mdx";
-### 3.1 Semantic search
+
-Semantic search finds results based on meaning. This is called `nearText` in Weaviate.
+
+
-The following example searches for 2 objects whose meaning is most similar to that of `biology`.
+Semantic search finds results based on meaning. This is called `nearVector` in Weaviate. The following example searches for 2 objects (_limit_) whose vector is most similar to the query vector.
-import QueryNearText from '/_includes/code/quickstart/local.quickstart.query.neartext.mdx'
+import QueryNearVectorImportVectors from "/_includes/code/quickstart/quickstart.short.import_vectors.query.nearvector.mdx";
-
+
-Run this code to perform the query. Our query found entries for `DNA` and `species`.
+
+
- Example full response in JSON format
+
+Example response
```json
{
- {
- "answer": "DNA",
- "question": "In 1953 Watson & Crick built a model of the molecular structure of this, the gene-carrying substance",
- "category": "SCIENCE"
- },
- {
- "answer": "species",
- "question": "2000 news: the Gunnison sage grouse isn't just another northern sage grouse, but a new one of this classification",
- "category": "SCIENCE"
- }
+ "genre": "Science Fiction",
+ "title": "The Matrix",
+ "description": "A computer hacker learns about the true nature of reality and his role in the war against its controllers."
+}
+{
+ "genre": "Fantasy",
+ "title": "The Lord of the Rings: The Fellowship of the Ring",
+ "description": "A meek Hobbit and his companions set out on a perilous journey to destroy a powerful ring and save Middle-earth."
}
```
-If you inspect the full response, you will see that the word `biology` does not appear anywhere.
-
-Even so, Weaviate was able to return biology-related entries. This is made possible by *vector embeddings* that capture meaning. Under the hood, semantic search is powered by vectors, or vector embeddings.
-
-Here is a diagram showing the workflow in Weaviate.
-
-```mermaid
-flowchart LR
- Query["ð Search: 'biology'"]
-
- subgraph sg1 ["Vector Search"]
- direction LR
- VS1["Convert query to vector"] --> VS2["Find similar vectors"]
- VS2 --> VS3["Return top matches"]
- end
-
- subgraph sg2 ["Results"]
- R1["Most similar documents"]
- end
-
- Query --> VS1
- VS3 --> R1
-
- %% Style nodes with white background and darker borders
- style Query fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style VS1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style VS2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style VS3 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style R1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
-
- %% Style subgraphs with brand colors
- style sg1 fill:#ffffff,stroke:#61BD73,stroke-width:2px,color:#130C49
- style sg2 fill:#ffffff,stroke:#130C49,stroke-width:2px,color:#130C49
-```
+:::tip Weaviate Agents
-:::info Where did the vectors come from?
-Weaviate used the locally hosted Ollama model to generate a vector embedding for each object during import. During the query, Weaviate similarly converted the query (`biology`) into a vector.
+Try querying your Weaviate Cloud data using the [Query Agent](/agents/query/index.md). You simply provide a prompt/question in natural language, and the Query Agent takes care of all the needed steps to provide an answer.
-As we mentioned above, this is optional. See [Starter Guide: Bring Your Own Vectors](/weaviate/starter-guides/custom-vectors.mdx) if you would prefer to provide your own vectors.
:::
-:::tip More search types available
-
-Weaviate is capable of many types of searches. See, for example, our how-to guides on [similarity searches](../search/similarity.md), [keyword searches](../search/bm25.md), [hybrid searches](../search/hybrid.md), and [filtered searches](../search/filters.md).
+## Step 3: Retrieval augmented generation (RAG)
+:::note Requirement: Claude API key
+For Retrieval Augmented Generation (RAG) in this step, you will need a [Claude API key](https://console.anthropic.com/settings/keys). You can also use another generative [model provider](/weaviate/model-providers) instead.
:::
-### 3.2 Retrieval augmented generation
-
-Retrieval augmented generation (RAG), also called generative search, combines the power of generative AI models such as large language models (LLMs) with the up-to-date truthfulness of a database.
-
-RAG works by prompting a large language model (LLM) with a combination of a *user query* and *data retrieved from a database*.
-
-This diagram shows the RAG workflow in Weaviate.
-
-```mermaid
-flowchart LR
- subgraph sg0 ["Weaviate Query"]
- direction TB
- Search["ð Search: 'biology'"]
- Prompt["âïļ Prompt: 'Write a tweet...'"]
- end
-
- subgraph sg1 ["Vector Search"]
- direction LR
- VS1["Convert query to vector"] --> VS2["Find similar vectors"]
- VS2 --> VS3["Return top matches"]
- end
-
- subgraph sg2 ["Generation"]
- direction LR
- G1["Send (results + prompt) to LLM"]
- G1 --> G2["Generate response"]
- end
-
- subgraph sg3 ["Results"]
- direction TB
- R1["Most similar documents"]
- R2["Generated content"]
- end
-
- Search --> VS1
- VS3 --> R1
- Prompt --> G1
- VS3 --> G1
- G2 --> R2
-
- %% Style nodes with white background and darker borders
- style Search fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style Prompt fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style VS1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style VS2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style VS3 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style G1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style G2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style R1 fill:#ffffff,stroke:#B9C8DF,color:#130C49
- style R2 fill:#ffffff,stroke:#B9C8DF,color:#130C49
-
- %% Style subgraphs with brand colors
- style sg0 fill:#ffffff,stroke:#130C49,stroke-width:2px,color:#130C49
- style sg1 fill:#ffffff,stroke:#61BD73,stroke-width:2px,color:#130C49
- style sg2 fill:#ffffff,stroke:#7AD6EB,stroke-width:2px,color:#130C49
- style sg3 fill:#ffffff,stroke:#130C49,stroke-width:2px,color:#130C49
-```
-
-The following example combines the same search (for `biology`) with a prompt to generate a tweet.
-
-import QueryRAG from '/_includes/code/quickstart/local.quickstart.query.rag.mdx'
-
-
-
-Run this code to perform the query. Here is one possible response (your response will likely be different).
-
-```text
-ð§Ž In 1953 Watson & Crick built a model of the molecular structure of DNA, the gene-carrying substance! ð§ŽðŽ
-
-ðĶĒ 2000 news: the Gunnison sage grouse isn't just another northern sage grouse, but a new species! ðĶĒðŋ #ScienceFacts #DNA #SpeciesClassification
-```
-
-The response should be new, yet familiar. This because you have seen the entries above for `DNA` and `species` in the [semantic search](#31-semantic-search) section.
-
-The power of RAG comes from the ability to transform your own data. Weaviate helps you in this journey by making it easy to perform a combined search & generation in just a few lines of code.
-
-
-
-## Recap
-
-In this quickstart guide, you:
-
-- Created a Serverless Weaviate sandbox instance on Weaviate Cloud.
-- Defined a collection and added data.
-- Performed queries, including:
- - Semantic search, and
- - Retrieval augmented generation.
-
-Where to go next is up to you. We include some suggested steps and resources below.
-
-
-
-## Next
-
-Try these additional resources to learn more about Weaviate:
-
-
-
-
-
-
-
More on search
-
-
-
- See how to perform searches, such as keyword, similarity, hybrid, image, filtered and reranked searches.
-
-
-
-
-
-
-
-
Manage data
-
-
-
- See how to manage data, such as manage collections, create objects, batch import data and use multi-tenancy.
-
-
-
-
-
-
-
-
RAG
-
-
-
- Check out the Starter guide: retrieval augmented generation.
-
-
-
-
-
-
-
-
Workshops and office hours
-
-
-
- We hold in-person and online workshops, office hours and events for different experience levels. Join us!
-
-
-
-
-
-
-
-
-
-## FAQs & Troubleshooting
-
-We provide answers to some common questions, or potential issues below.
-
-### Questions
-
-#### Can I use different integrations?
-
-
- See answer
+
+
-In this example, we use the `OpenAI` inference API. But you can use others.
+Retrieval augmented generation (RAG), also called generative search, works by prompting a large language model (LLM) with a combination of a _user query_ and _data retrieved from a database_.
-If you do want to change the embeddings, or the generative AI integrations, you can. You will need to:
-- Ensure that the Weaviate module is available in the Weaviate instance you are using,
-- Modify your collection definition to use your preferred integration, and
-- Make sure to use the right API key(s) (if necessary) for your integration.
+The following example combines the semantic search for the query `sci-fi` with a prompt to generate a tweet.
-See the [model providers integration](../model-providers/index.md) section for more information.
+import QueryRAG from "/_includes/code/quickstart/quickstart.short.query.rag.mdx";
-
-
-### Troubleshooting
+
-#### If you see Error: Name 'Question' already used as a name for an Object class
+
+
-
- See answer
+Retrieval augmented generation (RAG), also called generative search, works by prompting a large language model (LLM) with a combination of a _user query_ and _data retrieved from a database_.
-You may see this error if you try to create a collection that already exists in your instance of Weaviate. In this case, you can follow these instructions to delete the collection.
+The following example combines the vector similarity search with a prompt to generate a tweet.
-import CautionSchemaDeleteClass from '/_includes/schema-delete-class.mdx'
+import QueryRAGCustomVectors from "/_includes/code/quickstart/quickstart.short.import-vectors.query.rag.mdx";
-
-
-
+
-#### How to confirm collection creation
+
+
- See answer
-If you are not sure whether the collection has been created, check the `schema` endpoint.
-
-Replace WEAVIATE_INSTANCE_URL with your instance's REST Endpoint URL.:
-
-```
-https://WEAVIATE_INSTANCE_URL/v1/schema
-```
-
-You should see:
+Example response
```json
-{
- "classes": [
- {
- "class": "Question",
- ... // truncated additional information here
- "vectorizer": "text2vec-openai"
- }
- ]
-}
-```
-
-Where the schema should indicate that the `Question` collection has been added.
-
-:::note REST & GraphQL in Weaviate
-Weaviate uses a combination of RESTful and GraphQL APIs. In Weaviate, RESTful API endpoints can be used to add data or obtain information about the Weaviate instance, and the GraphQL interface to retrieve data.
-:::
-
-
+ðķïļ Unplug from the system & join Neo's journey ðð°
-#### How to confirm data import
+"The Matrix" will blow your mind ðĪŊ as reality unravels ð
-
- See answer
-
-To confirm successful data import, check the `objects` endpoint to verify that all objects are imported.
+Kung-fu, slow-mo & mind-bending sci-fi ðĨðīïļ
-Replace WEAVIATE_INSTANCE_URL with your instance REST Endpoint URL:
-
-```
-https://WEAVIATE_INSTANCE_URL/v1/objects
+Are you ready to see how deep the rabbit hole goes? ðīðĩ #TheMatrix #WakeUp
```
-You should see:
-
-```json
-{
- "deprecations": null,
- "objects": [
- ... // Details of each object
- ],
- "totalResults": 10 // You should see 10 results here
-}
-```
-
-Where you should be able to confirm that you have imported all `10` objects.
-
-#### If the `nearText` search is not working
-
-
- See answer
-
-To perform text-based (`nearText`) similarity searches, you need to have a vectorizer enabled, and configured in your collection.
+## Next steps
-Make sure the vectorizer is configured [like this](#21-define-a-collection).
+We recommend you check out the following resources to continue learning about Weaviate.
-If the search still doesn't work, [contact us](#questions-and-feedback)!
-
-
+export const nextStepsCardsData = [
+ {
+ title: "Quick tour of Weaviate",
+ description: (
+ <>
+ Continue with the{" "}
+ Quick tour tutorial â an
+ end-to-end guide that covers important topics like configuring
+ collections, searches, etc.
+ >
+ ),
+ link: "/weaviate/tutorials/quick-tour-of-weaviate",
+ icon: "fas fa-signs-post",
+ },
+ {
+ title: "Weaviate Academy",
+ description: (
+ <>
+ Check out Weaviate Academy â a
+ learning platform centered around AI-native development.
+ >
+ ),
+ link: "https://academy.weaviate.io/",
+ icon: "fa-solid fa-graduation-cap",
+ },
+];
+
+
## Questions and feedback
-import DocsFeedback from '/_includes/docs-feedback.mdx';
+import DocsFeedback from "/_includes/docs-feedback.mdx";
-
+
From 26f86240af5acdc37cb05ac1aa587afa5712a858 Mon Sep 17 00:00:00 2001
From: Ivan Despot <66276597+g-despot@users.noreply.github.com>
Date: Thu, 6 Nov 2025 14:56:28 +0100
Subject: [PATCH 12/16] Update local code
---
...uickstart.short.local.create_collection.go | 87 +++++++++++++++++
.../quickstart.short.local.query.neartext.go | 62 ++++++++++++
.../quickstart.short.local.query.rag.go | 57 +++++++++++
....local.import_vectors.create_collection.go | 96 +++++++++++++++++++
...t.local.import_vectors.query.nearvector.go | 62 ++++++++++++
...rt.short.local.import_vectors.query.rag.go | 57 +++++++++++
.../docs/quickstart/QuickstartCreate.java | 14 ++-
.../quickstart/QuickstartCreateVectors.java | 9 +-
.../quickstart/QuickstartLocalCreate.java | 72 ++++++++++++++
.../QuickstartLocalCreateVectors.java | 86 +++++++++++++++++
.../QuickstartLocalQueryNearText.java | 44 +++++++++
.../QuickstartLocalQueryNearTextRAG.java | 53 ++++++++++
.../QuickstartLocalQueryNearVector.java | 64 +++++++++++++
.../QuickstartLocalQueryNearVectorRAG.java | 52 ++++++++++
.../quickstart.short.create_collection.py | 5 +-
....short.import_vectors.create_collection.py | 5 +-
...t.short.import_vectors.query.nearvector.py | 3 +-
...ickstart.short.import_vectors.query.rag.py | 4 +-
...uickstart.short.local.create_collection.py | 47 +++++++++
....local.import_vectors.create_collection.py | 48 ++++++++++
...t.local.import_vectors.query.nearvector.py | 29 ++++++
...rt.short.local.import_vectors.query.rag.py | 35 +++++++
.../quickstart.short.local.query.neartext.py | 29 ++++++
.../quickstart.short.local.query.rag.py | 35 +++++++
.../python/quickstart.short.query.neartext.py | 3 +-
.../code/python/quickstart.short.query.rag.py | 4 +-
...ickstart.short.local.create_collection.mdx | 55 +++++++++++
...t.short.local.import-vectors.query.rag.mdx | 42 ++++++++
...local.import_vectors.create_collection.mdx | 55 +++++++++++
....local.import_vectors.query.nearvector.mdx | 42 ++++++++
.../quickstart.short.local.query.neartext.mdx | 42 ++++++++
.../quickstart.short.local.query.rag.mdx | 42 ++++++++
...uickstart.short.local.create_collection.ts | 43 +++++++++
....local.import_vectors.create_collection.ts | 44 +++++++++
...t.local.import_vectors.query.nearvector.ts | 25 +++++
...rt.short.local.import_vectors.query.rag.ts | 37 +++++++
.../quickstart.short.local.query.neartext.ts | 25 +++++
.../quickstart.short.local.query.rag.ts | 37 +++++++
docs/weaviate/quickstart/index.md | 4 +-
docs/weaviate/quickstart/local.md | 18 ++--
40 files changed, 1540 insertions(+), 33 deletions(-)
create mode 100644 _includes/code/howto/go/docs/quickstart/short_local_1/quickstart.short.local.create_collection.go
create mode 100644 _includes/code/howto/go/docs/quickstart/short_local_2/quickstart.short.local.query.neartext.go
create mode 100644 _includes/code/howto/go/docs/quickstart/short_local_3/quickstart.short.local.query.rag.go
create mode 100644 _includes/code/howto/go/docs/quickstart/short_local_vectors_1/quickstart.short.local.import_vectors.create_collection.go
create mode 100644 _includes/code/howto/go/docs/quickstart/short_local_vectors_2/quickstart.short.local.import_vectors.query.nearvector.go
create mode 100644 _includes/code/howto/go/docs/quickstart/short_local_vectors_3/quickstart.short.local.import_vectors.query.rag.go
create mode 100644 _includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalCreate.java
create mode 100644 _includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalCreateVectors.java
create mode 100644 _includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearText.java
create mode 100644 _includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearTextRAG.java
create mode 100644 _includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearVector.java
create mode 100644 _includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearVectorRAG.java
create mode 100644 _includes/code/python/quickstart.short.local.create_collection.py
create mode 100644 _includes/code/python/quickstart.short.local.import_vectors.create_collection.py
create mode 100644 _includes/code/python/quickstart.short.local.import_vectors.query.nearvector.py
create mode 100644 _includes/code/python/quickstart.short.local.import_vectors.query.rag.py
create mode 100644 _includes/code/python/quickstart.short.local.query.neartext.py
create mode 100644 _includes/code/python/quickstart.short.local.query.rag.py
create mode 100644 _includes/code/quickstart/quickstart.short.local.create_collection.mdx
create mode 100644 _includes/code/quickstart/quickstart.short.local.import-vectors.query.rag.mdx
create mode 100644 _includes/code/quickstart/quickstart.short.local.import_vectors.create_collection.mdx
create mode 100644 _includes/code/quickstart/quickstart.short.local.import_vectors.query.nearvector.mdx
create mode 100644 _includes/code/quickstart/quickstart.short.local.query.neartext.mdx
create mode 100644 _includes/code/quickstart/quickstart.short.local.query.rag.mdx
create mode 100644 _includes/code/typescript/quickstart.short.local.create_collection.ts
create mode 100644 _includes/code/typescript/quickstart.short.local.import_vectors.create_collection.ts
create mode 100644 _includes/code/typescript/quickstart.short.local.import_vectors.query.nearvector.ts
create mode 100644 _includes/code/typescript/quickstart.short.local.import_vectors.query.rag.ts
create mode 100644 _includes/code/typescript/quickstart.short.local.query.neartext.ts
create mode 100644 _includes/code/typescript/quickstart.short.local.query.rag.ts
diff --git a/_includes/code/howto/go/docs/quickstart/short_local_1/quickstart.short.local.create_collection.go b/_includes/code/howto/go/docs/quickstart/short_local_1/quickstart.short.local.create_collection.go
new file mode 100644
index 00000000..15fa9f45
--- /dev/null
+++ b/_includes/code/howto/go/docs/quickstart/short_local_1/quickstart.short.local.create_collection.go
@@ -0,0 +1,87 @@
+package main
+
+// START CreateCollection
+import (
+ "context"
+ "fmt"
+
+ "github.com/weaviate/weaviate-go-client/v5/weaviate"
+ "github.com/weaviate/weaviate/entities/models"
+)
+
+func main() {
+ // Step 1.1: Connect to your local Weaviate instance
+ cfg := weaviate.Config{
+ Host: "localhost:8080",
+ Scheme: "http",
+ }
+ client, err := weaviate.NewClient(cfg)
+ if err != nil {
+ panic(err)
+ }
+
+ // END CreateCollection
+
+ // NOT SHOWN TO THE USER - DELETE EXISTING COLLECTION
+ client.Schema().ClassDeleter().WithClassName("Movie").Do(context.Background())
+
+ // START CreateCollection
+ // Step 1.2: Create a collection
+ // highlight-start
+ classObj := &models.Class{
+ Class: "Movie",
+ Vectorizer: "text2vec-ollama",
+ ModuleConfig: map[string]interface{}{
+ "text2vec-ollama": map[string]interface{}{ // Configure the Ollama embedding integration
+ "apiEndpoint": "http://ollama:11434", // If using Docker you might need: http://host.docker.internal:11434
+ "model": "nomic-embed-text", // The model to use
+ },
+ "generative-ollama": map[string]interface{}{ // Configure the Ollama generative integration
+ "apiEndpoint": "http://ollama:11434", // If using Docker you might need: http://host.docker.internal:11434
+ "model": "llama3.2", // The model to use
+ },
+ },
+ }
+
+ err = client.Schema().ClassCreator().WithClass(classObj).Do(context.Background())
+ if err != nil {
+ panic(err)
+ }
+ // highlight-end
+
+ // Step 1.3: Import three objects
+ dataObjects := []map[string]interface{}{
+ {
+ "title": "The Matrix",
+ "description": "A computer hacker learns about the true nature of reality and his role in the war against its controllers.",
+ "genre": "Science Fiction",
+ },
+ {
+ "title": "Spirited Away",
+ "description": "A young girl becomes trapped in a mysterious world of spirits and must find a way to save her parents and return home.",
+ "genre": "Animation",
+ },
+ {
+ "title": "The Lord of the Rings: The Fellowship of the Ring",
+ "description": "A meek Hobbit and his companions set out on a perilous journey to destroy a powerful ring and save Middle-earth.",
+ "genre": "Fantasy",
+ },
+ }
+
+ // Insert objects
+ objects := make([]*models.Object, len(dataObjects))
+ for i, obj := range dataObjects {
+ objects[i] = &models.Object{
+ Class: "Movie",
+ Properties: obj,
+ }
+ }
+
+ _, err = client.Batch().ObjectsBatcher().WithObjects(objects...).Do(context.Background())
+ if err != nil {
+ panic(err)
+ }
+
+ fmt.Printf("Imported & vectorized %d objects into the Movie collection\n", len(dataObjects))
+ // END CreateCollection
+}
diff --git a/_includes/code/howto/go/docs/quickstart/short_local_2/quickstart.short.local.query.neartext.go b/_includes/code/howto/go/docs/quickstart/short_local_2/quickstart.short.local.query.neartext.go
new file mode 100644
index 00000000..6d8833bb
--- /dev/null
+++ b/_includes/code/howto/go/docs/quickstart/short_local_2/quickstart.short.local.query.neartext.go
@@ -0,0 +1,62 @@
+package main
+
+// START NearText
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+
+ "github.com/weaviate/weaviate-go-client/v5/weaviate"
+ "github.com/weaviate/weaviate-go-client/v5/weaviate/graphql"
+)
+
+func main() {
+ // Step 1.1: Connect to your local Weaviate instance
+ cfg := weaviate.Config{
+ Host: "localhost:8080",
+ Scheme: "http",
+ }
+ client, err := weaviate.NewClient(cfg)
+ if err != nil {
+ panic(err)
+ }
+
+ // Step 2.2: Perform a semantic search with NearText
+ // highlight-start
+ title := graphql.Field{Name: "title"}
+ description := graphql.Field{Name: "description"}
+ genre := graphql.Field{Name: "genre"}
+
+ nearText := client.GraphQL().NearTextArgBuilder().
+ WithConcepts([]string{"sci-fi"})
+
+ result, err := client.GraphQL().Get().
+ WithClassName("Movie").
+ WithNearText(nearText).
+ WithLimit(2).
+ WithFields(title, description, genre).
+ Do(context.Background())
+ // highlight-end
+
+ if err != nil {
+ panic(err)
+ }
+
+ // Inspect the results
+ if result.Errors != nil {
+ fmt.Printf("Error: %v\n", result.Errors)
+ return
+ }
+
+ data := result.Data["Get"].(map[string]interface{})
+ movies := data["Movie"].([]interface{})
+
+ for _, movie := range movies {
+ jsonData, err := json.MarshalIndent(movie, "", " ")
+ if err != nil {
+ panic(err)
+ }
+ fmt.Println(string(jsonData))
+ }
+ // END NearText
+}
diff --git a/_includes/code/howto/go/docs/quickstart/short_local_3/quickstart.short.local.query.rag.go b/_includes/code/howto/go/docs/quickstart/short_local_3/quickstart.short.local.query.rag.go
new file mode 100644
index 00000000..a9cbce86
--- /dev/null
+++ b/_includes/code/howto/go/docs/quickstart/short_local_3/quickstart.short.local.query.rag.go
@@ -0,0 +1,57 @@
+package main
+
+// START RAG
+import (
+ "context"
+ "fmt"
+
+ "github.com/weaviate/weaviate-go-client/v5/weaviate"
+ "github.com/weaviate/weaviate-go-client/v5/weaviate/graphql"
+)
+
+func main() {
+ // Step 2.1: Connect to your local Weaviate instance
+ // highlight-start
+ cfg := weaviate.Config{
+ Host: "localhost:8080",
+ Scheme: "http",
+ }
+ client, err := weaviate.NewClient(cfg)
+ if err != nil {
+ panic(err)
+ }
+ // highlight-end
+
+ // Step 2.2: Perform RAG with NearText results
+ // highlight-start
+ title := graphql.Field{Name: "title"}
+ description := graphql.Field{Name: "description"}
+ genre := graphql.Field{Name: "genre"}
+
+ nearText := client.GraphQL().NearTextArgBuilder().
+ WithConcepts([]string{"sci-fi"})
+
+ generate := graphql.NewGenerativeSearch().GroupedResult("Write a tweet with emojis about this movie.")
+
+ result, err := client.GraphQL().Get().
+ WithClassName("Movie").
+ WithNearText(nearText).
+ WithLimit(1).
+ WithFields(title, description, genre).
+ WithGenerativeSearch(generate).
+ Do(context.Background())
+ // highlight-end
+
+ if err != nil {
+ panic(err)
+ }
+
+ // Inspect the results
+ if result.Errors != nil {
+ fmt.Printf("Error: %v\n", result.Errors)
+ return
+ }
+
+ fmt.Printf("%v", result)
+ // END RAG
+}
diff --git a/_includes/code/howto/go/docs/quickstart/short_local_vectors_1/quickstart.short.local.import_vectors.create_collection.go b/_includes/code/howto/go/docs/quickstart/short_local_vectors_1/quickstart.short.local.import_vectors.create_collection.go
new file mode 100644
index 00000000..71c01d45
--- /dev/null
+++ b/_includes/code/howto/go/docs/quickstart/short_local_vectors_1/quickstart.short.local.import_vectors.create_collection.go
@@ -0,0 +1,96 @@
+package main
+
+// START CreateCollection
+import (
+ "context"
+ "fmt"
+
+ "github.com/weaviate/weaviate-go-client/v5/weaviate"
+ "github.com/weaviate/weaviate/entities/models"
+)
+
+func main() {
+ // Step 1.1: Connect to your local Weaviate instance
+ cfg := weaviate.Config{
+ Host: "localhost:8080",
+ Scheme: "http",
+ }
+ client, err := weaviate.NewClient(cfg)
+ if err != nil {
+ panic(err)
+ }
+
+ // END CreateCollection
+
+ // NOT SHOWN TO THE USER - DELETE EXISTING COLLECTION
+ client.Schema().ClassDeleter().WithClassName("Movie").Do(context.Background())
+
+ // START CreateCollection
+ // Step 1.2: Create a collection
+ // highlight-start
+ classObj := &models.Class{
+ Class: "Movie",
+ Vectorizer: "none", // No automatic vectorization since we're providing vectors
+ ModuleConfig: map[string]interface{}{
+ "generative-ollama": map[string]interface{}{ // Configure the Ollama generative integration
+ "apiEndpoint": "http://ollama:11434", // If using Docker you might need: http://host.docker.internal:11434
+ "model": "llama3.2", // The model to use
+ },
+ },
+ }
+
+ err = client.Schema().ClassCreator().WithClass(classObj).Do(context.Background())
+ if err != nil {
+ panic(err)
+ }
+ // highlight-end
+
+ // Step 1.3: Import three objects
+ dataObjects := []struct {
+ Properties map[string]interface{}
+ Vector []float32
+ }{
+ {
+ Properties: map[string]interface{}{
+ "title": "The Matrix",
+ "description": "A computer hacker learns about the true nature of reality and his role in the war against its controllers.",
+ "genre": "Science Fiction",
+ },
+ Vector: []float32{0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8},
+ },
+ {
+ Properties: map[string]interface{}{
+ "title": "Spirited Away",
+ "description": "A young girl becomes trapped in a mysterious world of spirits and must find a way to save her parents and return home.",
+ "genre": "Animation",
+ },
+ Vector: []float32{0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9},
+ },
+ {
+ Properties: map[string]interface{}{
+ "title": "The Lord of the Rings: The Fellowship of the Ring",
+ "description": "A meek Hobbit and his companions set out on a perilous journey to destroy a powerful ring and save Middle-earth.",
+ "genre": "Fantasy",
+ },
+ Vector: []float32{0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0},
+ },
+ }
+
+ // Insert the objects with vectors
+ objects := make([]*models.Object, len(dataObjects))
+ for i, obj := range dataObjects {
+ objects[i] = &models.Object{
+ Class: "Movie",
+ Properties: obj.Properties,
+ Vector: obj.Vector,
+ }
+ }
+
+ _, err = client.Batch().ObjectsBatcher().WithObjects(objects...).Do(context.Background())
+ if err != nil {
+ panic(err)
+ }
+
+ fmt.Printf("Imported %d objects with vectors into the Movie collection\n", len(dataObjects))
+ // END CreateCollection
+}
diff --git a/_includes/code/howto/go/docs/quickstart/short_local_vectors_2/quickstart.short.local.import_vectors.query.nearvector.go b/_includes/code/howto/go/docs/quickstart/short_local_vectors_2/quickstart.short.local.import_vectors.query.nearvector.go
new file mode 100644
index 00000000..62ec416a
--- /dev/null
+++ b/_includes/code/howto/go/docs/quickstart/short_local_vectors_2/quickstart.short.local.import_vectors.query.nearvector.go
@@ -0,0 +1,62 @@
+package main
+
+// START NearText
+import (
+ "context"
+ "encoding/json"
+ "fmt"
+
+ "github.com/weaviate/weaviate-go-client/v5/weaviate"
+ "github.com/weaviate/weaviate-go-client/v5/weaviate/graphql"
+)
+
+func main() {
+ // Step 1.1: Connect to your local Weaviate instance
+ cfg := weaviate.Config{
+ Host: "localhost:8080",
+ Scheme: "http",
+ }
+ client, err := weaviate.NewClient(cfg)
+ if err != nil {
+ panic(err)
+ }
+
+ // Step 2.2 & 2.3: Perform a vector search with NearVector
+ // highlight-start
+ title := graphql.Field{Name: "title"}
+ description := graphql.Field{Name: "description"}
+ genre := graphql.Field{Name: "genre"}
+
+ nearVector := client.GraphQL().NearVectorArgBuilder().
+ WithVector([]float32{0.11, 0.21, 0.31, 0.41, 0.51, 0.61, 0.71, 0.81})
+
+ result, err := client.GraphQL().Get().
+ WithClassName("Movie").
+ WithNearVector(nearVector).
+ WithLimit(2).
+ WithFields(title, description, genre).
+ Do(context.Background())
+ // highlight-end
+
+ if err != nil {
+ panic(err)
+ }
+
+ // Inspect the results
+ if result.Errors != nil {
+ fmt.Printf("Error: %v\n", result.Errors)
+ return
+ }
+
+ data := result.Data["Get"].(map[string]interface{})
+ movies := data["Movie"].([]interface{})
+
+ for _, movie := range movies {
+ jsonData, err := json.MarshalIndent(movie, "", " ")
+ if err != nil {
+ panic(err)
+ }
+ fmt.Println(string(jsonData))
+ }
+ // END NearText
+}
diff --git a/_includes/code/howto/go/docs/quickstart/short_local_vectors_3/quickstart.short.local.import_vectors.query.rag.go b/_includes/code/howto/go/docs/quickstart/short_local_vectors_3/quickstart.short.local.import_vectors.query.rag.go
new file mode 100644
index 00000000..e0d641f5
--- /dev/null
+++ b/_includes/code/howto/go/docs/quickstart/short_local_vectors_3/quickstart.short.local.import_vectors.query.rag.go
@@ -0,0 +1,57 @@
+package main
+
+// START RAG
+import (
+ "context"
+ "fmt"
+
+ "github.com/weaviate/weaviate-go-client/v5/weaviate"
+ "github.com/weaviate/weaviate-go-client/v5/weaviate/graphql"
+)
+
+func main() {
+ // Step 2.1: Connect to your local Weaviate instance
+ // highlight-start
+ cfg := weaviate.Config{
+ Host: "localhost:8080",
+ Scheme: "http",
+ }
+ client, err := weaviate.NewClient(cfg)
+ if err != nil {
+ panic(err)
+ }
+ // highlight-end
+
+ // Step 2.2: Perform RAG with NearText results
+ // highlight-start
+ title := graphql.Field{Name: "title"}
+ description := graphql.Field{Name: "description"}
+ genre := graphql.Field{Name: "genre"}
+
+ nearVector := client.GraphQL().NearVectorArgBuilder().
+ WithVector([]float32{0.11, 0.21, 0.31, 0.41, 0.51, 0.61, 0.71, 0.81})
+
+ generate := graphql.NewGenerativeSearch().GroupedResult("Write a tweet with emojis about this movie.")
+
+ result, err := client.GraphQL().Get().
+ WithClassName("Movie").
+ WithNearVector(nearVector).
+ WithLimit(1).
+ WithFields(title, description, genre).
+ WithGenerativeSearch(generate).
+ Do(context.Background())
+ // highlight-end
+
+ if err != nil {
+ panic(err)
+ }
+
+ // Inspect the results
+ if result.Errors != nil {
+ fmt.Printf("Error: %v\n", result.Errors)
+ return
+ }
+
+ fmt.Printf("%v", result)
+ // END RAG
+}
diff --git a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartCreate.java b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartCreate.java
index b4e0a1fa..c26a04e2 100644
--- a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartCreate.java
+++ b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartCreate.java
@@ -29,9 +29,17 @@ public static void main(String[] args) throws AuthException {
// START CreateCollection
// Step 1.2: Create a collection
- Map moduleConfig = new HashMap<>();
- Map generativeAnthropicSettings = new HashMap<>();
- moduleConfig.put("generative-anthropic", generativeAnthropicSettings);
+ Map text2vecOllamaSettings = new HashMap<>();
+ text2vecOllamaSettings.put("apiEndpoint", "http://ollama:11434"); // If using Docker you might need: http://host.docker.internal:11434
+ text2vecOllamaSettings.put("model", "nomic-embed-text"); // The model to use
+
+ Map generativeOllamaSettings = new HashMap<>();
+ generativeOllamaSettings.put("apiEndpoint", "http://ollama:11434"); // If using Docker you might need: http://host.docker.internal:11434
+ generativeOllamaSettings.put("model", "llama3.2"); // The model to use
+
+ Map> moduleConfig = new HashMap<>();
+ moduleConfig.put("text2vec-ollama", text2vecOllamaSettings);
+ moduleConfig.put("generative-ollama", generativeOllamaSettings);
// highlight-start
WeaviateClass movieClass = WeaviateClass.builder()
diff --git a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartCreateVectors.java b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartCreateVectors.java
index e18e2d6d..35673e56 100644
--- a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartCreateVectors.java
+++ b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartCreateVectors.java
@@ -29,9 +29,12 @@ public static void main(String[] args) throws AuthException {
// START CreateCollection
// Step 1.2: Create a collection
- Map moduleConfig = new HashMap<>();
- Map generativeAnthropicSettings = new HashMap<>();
- moduleConfig.put("generative-anthropic", generativeAnthropicSettings);
+ Map generativeOllamaSettings = new HashMap<>();
+ generativeOllamaSettings.put("apiEndpoint", "http://ollama:11434"); // If using Docker you might need: http://host.docker.internal:11434
+ generativeOllamaSettings.put("model", "llama3.2"); // The model to use
+
+ Map> moduleConfig = new HashMap<>();
+ moduleConfig.put("generative-ollama", generativeOllamaSettings);
// highlight-start
WeaviateClass movieClass = WeaviateClass.builder()
diff --git a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalCreate.java b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalCreate.java
new file mode 100644
index 00000000..21b81617
--- /dev/null
+++ b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalCreate.java
@@ -0,0 +1,72 @@
+package io.weaviate.docs.quickstart;
+
+// START CreateCollection
+import io.weaviate.client.Config;
+import io.weaviate.client.WeaviateClient;
+import io.weaviate.client.base.Result;
+import io.weaviate.client.v1.auth.exception.AuthException;
+import io.weaviate.client.v1.schema.model.WeaviateClass;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class QuickstartLocalCreate {
+ public static void main(String[] args) throws AuthException {
+ // Step 1.1: Connect to your local Weaviate instance
+ Config config = new Config("http", "localhost:8080");
+ WeaviateClient client = new WeaviateClient(config);
+
+ // END CreateCollection
+
+ // NOT SHOWN TO THE USER - DELETE EXISTING COLLECTION
+ client.schema().classDeleter().withClassName("Movie").run();
+
+ // START CreateCollection
+ // Step 1.2: Create a collection
+ Map moduleConfig = new HashMap<>();
+ Map generativeAnthropicSettings = new HashMap<>();
+ moduleConfig.put("generative-anthropic", generativeAnthropicSettings);
+
+ // highlight-start
+ WeaviateClass movieClass = WeaviateClass.builder()
+ .className("Movie")
+ .vectorizer("text2vec-weaviate")
+ .moduleConfig(moduleConfig)
+ .build();
+
+ Result result = client.schema().classCreator()
+ .withClass(movieClass)
+ .run();
+ // highlight-end
+
+ // Step 1.3: Import three objects
+ List> dataObjects = List.of(
+ Map.of(
+ "title", "The Matrix",
+ "description",
+ "A computer hacker learns about the true nature of reality and his role in the war against its controllers.",
+ "genre", "Science Fiction"),
+ Map.of(
+ "title", "Spirited Away",
+ "description",
+ "A young girl becomes trapped in a mysterious world of spirits and must find a way to save her parents and return home.",
+ "genre", "Animation"),
+ Map.of(
+ "title", "The Lord of the Rings: The Fellowship of the Ring",
+ "description",
+ "A meek Hobbit and his companions set out on a perilous journey to destroy a powerful ring and save Middle-earth.",
+ "genre", "Fantasy"));
+
+ // Insert objects
+ for (Map obj : dataObjects) {
+ client.data().creator()
+ .withClassName("Movie")
+ .withProperties(obj)
+ .run();
+ }
+
+ System.out.println("Imported & vectorized " + dataObjects.size() + " objects into the Movie collection");
+ }
+}
+// END CreateCollection
diff --git a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalCreateVectors.java b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalCreateVectors.java
new file mode 100644
index 00000000..11b057ca
--- /dev/null
+++ b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalCreateVectors.java
@@ -0,0 +1,86 @@
+package io.weaviate.docs.quickstart;
+
+// START CreateCollection
+import io.weaviate.client.Config;
+import io.weaviate.client.WeaviateClient;
+import io.weaviate.client.base.Result;
+import io.weaviate.client.v1.auth.exception.AuthException;
+import io.weaviate.client.v1.schema.model.WeaviateClass;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class QuickstartLocalCreateVectors {
+ public static void main(String[] args) throws AuthException {
+ // Step 1.1: Connect to your Weaviate Cloud instance
+ Config config = new Config("http", "localhost:8080");
+ WeaviateClient client = new WeaviateClient(config);
+
+ // END CreateCollection
+
+ // NOT SHOWN TO THE USER - DELETE EXISTING COLLECTION
+ client.schema().classDeleter().withClassName("Movie").run();
+
+ // START CreateCollection
+ // Step 1.2: Create a collection
+ Map moduleConfig = new HashMap<>();
+ Map generativeAnthropicSettings = new HashMap<>();
+ moduleConfig.put("generative-anthropic", generativeAnthropicSettings);
+
+ // highlight-start
+ WeaviateClass movieClass = WeaviateClass.builder()
+ .className("Movie")
+ .vectorizer("none") // No automatic vectorization since we're providing vectors
+ .moduleConfig(moduleConfig)
+ .build();
+
+ Result result = client.schema().classCreator()
+ .withClass(movieClass)
+ .run();
+ // highlight-end
+
+ // END CreateCollection
+
+ // START CreateCollection
+ // Step 1.3: Import three objects
+ List> dataObjects = List.of(
+ Map.of(
+ "properties", Map.of(
+ "title", "The Matrix",
+ "description",
+ "A computer hacker learns about the true nature of reality and his role in the war against its controllers.",
+ "genre", "Science Fiction"),
+ "vector", new Float[] { 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f }),
+ Map.of(
+ "properties", Map.of(
+ "title", "Spirited Away",
+ "description",
+ "A young girl becomes trapped in a mysterious world of spirits and must find a way to save her parents and return home.",
+ "genre", "Animation"),
+ "vector", new Float[] { 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f }),
+ Map.of(
+ "properties", Map.of(
+ "title", "The Lord of the Rings: The Fellowship of the Ring",
+ "description",
+ "A meek Hobbit and his companions set out on a perilous journey to destroy a powerful ring and save Middle-earth.",
+ "genre", "Fantasy"),
+ "vector", new Float[] { 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f }));
+
+ // Insert the objects with vectors
+ for (Map obj : dataObjects) {
+ @SuppressWarnings("unchecked")
+ Map properties = (Map) obj.get("properties");
+ Float[] vector = (Float[]) obj.get("vector");
+
+ client.data().creator()
+ .withClassName("Movie")
+ .withProperties(properties)
+ .withVector(vector)
+ .run();
+ }
+
+ System.out.println("Imported " + dataObjects.size() + " objects with vectors into the Movie collection");
+ }
+}
+// END CreateCollection
diff --git a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearText.java b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearText.java
new file mode 100644
index 00000000..ebf0b939
--- /dev/null
+++ b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearText.java
@@ -0,0 +1,44 @@
+package io.weaviate.docs.quickstart;
+
+// START NearText
+import io.weaviate.client.Config;
+import io.weaviate.client.WeaviateClient;
+import io.weaviate.client.base.Result;
+import io.weaviate.client.v1.auth.exception.AuthException;
+import io.weaviate.client.v1.graphql.model.GraphQLResponse;
+import io.weaviate.client.v1.graphql.query.argument.NearTextArgument;
+import io.weaviate.client.v1.graphql.query.fields.Field;
+
+public class QuickstartLocalQueryNearText {
+ public static void main(String[] args) throws AuthException {
+ // Step 2.1: Connect to your Weaviate Cloud instance
+ Config config = new Config("http", "localhost:8080");
+ WeaviateClient client = new WeaviateClient(config);
+
+ // Step 2.2: Perform a semantic search with NearText
+ // highlight-start
+ Field title = Field.builder().name("title").build();
+ Field description = Field.builder().name("description").build();
+ Field genre = Field.builder().name("genre").build();
+
+ NearTextArgument nearText = NearTextArgument.builder()
+ .concepts(new String[] { "sci-fi" })
+ .build();
+
+ Result response = client.graphQL().get()
+ .withClassName("Movie")
+ .withNearText(nearText)
+ .withLimit(2)
+ .withFields(title, description, genre)
+ .run();
+ // highlight-end
+
+ // Inspect the results
+ if (response.hasErrors()) {
+ System.out.println("Error: " + response.getError());
+ } else {
+ System.out.println(response.getResult());
+ }
+ }
+}
+// END NearText
diff --git a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearTextRAG.java b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearTextRAG.java
new file mode 100644
index 00000000..0999a4c9
--- /dev/null
+++ b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearTextRAG.java
@@ -0,0 +1,53 @@
+package io.weaviate.docs.quickstart;
+
+// START RAG
+import io.weaviate.client.Config;
+import io.weaviate.client.WeaviateClient;
+import io.weaviate.client.base.Result;
+import io.weaviate.client.v1.auth.exception.AuthException;
+import io.weaviate.client.v1.graphql.model.GraphQLResponse;
+import io.weaviate.client.v1.graphql.query.argument.NearTextArgument;
+import io.weaviate.client.v1.graphql.query.fields.Field;
+import io.weaviate.client.v1.graphql.query.fields.GenerativeSearchBuilder;
+
+public class QuickstartLocalQueryNearTextRAG {
+ public static void main(String[] args) throws AuthException {
+ // Step 2.1: Connect to your local Weaviate instance
+ // highlight-start
+ Config config = new Config("http", "localhost:8080");
+ WeaviateClient client = new WeaviateClient(config);
+ // highlight-end
+
+ // Step 2.2: Perform RAG with NearVector results
+ // highlight-start
+ Field title = Field.builder().name("title").build();
+ Field description = Field.builder().name("description").build();
+ Field genre = Field.builder().name("genre").build();
+
+ NearTextArgument nearText = NearTextArgument.builder()
+ .concepts(new String[] {"sci-fi"})
+ .build();
+
+ GenerativeSearchBuilder generativeSearch = GenerativeSearchBuilder.builder()
+ .groupedResultTask("Write a tweet with emojis about this movie.")
+ .build();
+
+ Result response = client.graphQL()
+ .get()
+ .withClassName("Movie")
+ .withNearText(nearText)
+ .withLimit(1)
+ .withFields(title, description, genre)
+ .withGenerativeSearch(generativeSearch)
+ .run();
+ // highlight-end
+
+ // Inspect the results
+ if (response.hasErrors()) {
+ System.out.println("Error: " + response.getError());
+ } else {
+ System.out.println(response.getResult());
+ }
+ }
+}
+// END RAG
diff --git a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearVector.java b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearVector.java
new file mode 100644
index 00000000..d956db98
--- /dev/null
+++ b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearVector.java
@@ -0,0 +1,64 @@
+package io.weaviate.docs.quickstart;
+
+// START NearText
+import io.weaviate.client.Config;
+import io.weaviate.client.WeaviateClient;
+import io.weaviate.client.base.Result;
+import io.weaviate.client.v1.auth.exception.AuthException;
+import io.weaviate.client.v1.graphql.model.GraphQLResponse;
+import io.weaviate.client.v1.graphql.query.argument.NearVectorArgument;
+import io.weaviate.client.v1.graphql.query.fields.Field;
+
+import com.google.gson.Gson;
+import com.google.gson.GsonBuilder;
+
+import java.util.List;
+import java.util.Map;
+
+public class QuickstartLocalQueryNearVector {
+ public static void main(String[] args) throws AuthException {
+ // Step 2.1: Connect to your local Weaviate instance
+ Config config = new Config("http", "localhost:8080");
+ WeaviateClient client = new WeaviateClient(config);
+
+ // Step 2.2: Perform a vector search with NearVector
+ // highlight-start
+ Field title = Field.builder().name("title").build();
+ Field description = Field.builder().name("description").build();
+ Field genre = Field.builder().name("genre").build();
+
+ NearVectorArgument nearVector = NearVectorArgument.builder()
+ .vector(new Float[] { 0.11f, 0.21f, 0.31f, 0.41f, 0.51f, 0.61f, 0.71f, 0.81f })
+ .build();
+
+ Result response = client.graphQL().get()
+ .withClassName("Movie")
+ .withNearVector(nearVector)
+ .withLimit(2)
+ .withFields(title, description, genre)
+ .run();
+ // highlight-end
+
+ // Inspect the results
+ if (response.hasErrors()) {
+ System.out.println("Error: " + response.getError());
+ } else {
+ GraphQLResponse data = response.getResult();
+ Gson gson = new GsonBuilder().setPrettyPrinting().create();
+
+ if (data.getData() != null) {
+ @SuppressWarnings("unchecked")
+ Map dataMap = (Map) data.getData();
+ @SuppressWarnings("unchecked")
+ Map get = (Map) dataMap.get("Get");
+ @SuppressWarnings("unchecked")
+ List movies = (List) get.get("Movie");
+
+ for (Object movie : movies) {
+ System.out.println(gson.toJson(movie));
+ }
+ }
+ }
+ }
+}
+// END NearText
diff --git a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearVectorRAG.java b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearVectorRAG.java
new file mode 100644
index 00000000..df8e13f1
--- /dev/null
+++ b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearVectorRAG.java
@@ -0,0 +1,52 @@
+package io.weaviate.docs.quickstart;
+
+// START RAG
+import io.weaviate.client.Config;
+import io.weaviate.client.WeaviateClient;
+import io.weaviate.client.base.Result;
+import io.weaviate.client.v1.auth.exception.AuthException;
+import io.weaviate.client.v1.graphql.model.GraphQLResponse;
+import io.weaviate.client.v1.graphql.query.argument.NearVectorArgument;
+import io.weaviate.client.v1.graphql.query.fields.Field;
+import io.weaviate.client.v1.graphql.query.fields.GenerativeSearchBuilder;
+
+public class QuickstartLocalQueryNearVectorRAG {
+ public static void main(String[] args) throws AuthException {
+ // Step 2.1: Connect to your local Weaviate instance
+ // highlight-start
+ Config config = new Config("http", "localhost:8080");
+ WeaviateClient client = new WeaviateClient(config);
+ // highlight-end
+
+ // Step 2.2: Perform RAG with NearVector results
+ // highlight-start
+ Field title = Field.builder().name("title").build();
+ Field description = Field.builder().name("description").build();
+ Field genre = Field.builder().name("genre").build();
+
+ NearVectorArgument nearVector = NearVectorArgument.builder()
+ .vector(new Float[] { 0.11f, 0.21f, 0.31f, 0.41f, 0.51f, 0.61f, 0.71f, 0.81f })
+ .build();
+
+ GenerativeSearchBuilder generativeSearch = GenerativeSearchBuilder.builder()
+ .groupedResultTask("Write a tweet with emojis about this movie.")
+ .build();
+
+ Result response = client.graphQL().get()
+ .withClassName("Movie")
+ .withNearVector(nearVector)
+ .withLimit(1)
+ .withFields(title, description, genre)
+ .withGenerativeSearch(generativeSearch)
+ .run();
+ // highlight-end
+
+ // Inspect the results
+ if (response.hasErrors()) {
+ System.out.println("Error: " + response.getError());
+ } else {
+ System.out.println(response.getResult());
+ }
+ // END RAG
+ }
+}
\ No newline at end of file
diff --git a/_includes/code/python/quickstart.short.create_collection.py b/_includes/code/python/quickstart.short.create_collection.py
index cc215579..461d3324 100644
--- a/_includes/code/python/quickstart.short.create_collection.py
+++ b/_includes/code/python/quickstart.short.create_collection.py
@@ -1,7 +1,6 @@
# START CreateCollection
import weaviate
-from weaviate.classes.init import Auth
-from weaviate.classes.config import Configure, Property, DataType
+from weaviate.classes.config import Configure
import os
# Best practice: store your credentials in environment variables
@@ -11,7 +10,7 @@
# Step 1.1: Connect to your Weaviate Cloud instance
client = weaviate.connect_to_weaviate_cloud(
cluster_url=weaviate_url,
- auth_credentials=Auth.api_key(weaviate_api_key),
+ auth_credentials=weaviate_api_key,
)
# END CreateCollection
diff --git a/_includes/code/python/quickstart.short.import_vectors.create_collection.py b/_includes/code/python/quickstart.short.import_vectors.create_collection.py
index 98452c3b..efa9103c 100644
--- a/_includes/code/python/quickstart.short.import_vectors.create_collection.py
+++ b/_includes/code/python/quickstart.short.import_vectors.create_collection.py
@@ -1,7 +1,6 @@
# START CreateCollection
import weaviate
-from weaviate.classes.init import Auth
-from weaviate.classes.config import Configure, Property, DataType
+from weaviate.classes.config import Configure
import os
# Best practice: store your credentials in environment variables
@@ -11,7 +10,7 @@
# Step 1.1: Connect to your Weaviate Cloud instance
client = weaviate.connect_to_weaviate_cloud(
cluster_url=weaviate_url,
- auth_credentials=Auth.api_key(weaviate_api_key),
+ auth_credentials=weaviate_api_key,
)
# END CreateCollection
diff --git a/_includes/code/python/quickstart.short.import_vectors.query.nearvector.py b/_includes/code/python/quickstart.short.import_vectors.query.nearvector.py
index 621b429e..b8c061a7 100644
--- a/_includes/code/python/quickstart.short.import_vectors.query.nearvector.py
+++ b/_includes/code/python/quickstart.short.import_vectors.query.nearvector.py
@@ -1,6 +1,5 @@
# START NearText
import weaviate
-from weaviate.classes.init import Auth
import os, json
# Best practice: store your credentials in environment variables
@@ -10,7 +9,7 @@
# Step 2.1: Connect to your Weaviate Cloud instance
client = weaviate.connect_to_weaviate_cloud(
cluster_url=weaviate_url,
- auth_credentials=Auth.api_key(weaviate_api_key),
+ auth_credentials=weaviate_api_key,
)
# Step 2.2: Use this collection
diff --git a/_includes/code/python/quickstart.short.import_vectors.query.rag.py b/_includes/code/python/quickstart.short.import_vectors.query.rag.py
index d582816b..7b6e126f 100644
--- a/_includes/code/python/quickstart.short.import_vectors.query.rag.py
+++ b/_includes/code/python/quickstart.short.import_vectors.query.rag.py
@@ -1,10 +1,8 @@
# START RAG
import os
import weaviate
-from weaviate.classes.init import Auth
from weaviate.classes.generate import GenerativeConfig
-
# Best practice: store your credentials in environment variables
weaviate_url = os.environ["WEAVIATE_URL"]
weaviate_api_key = os.environ["WEAVIATE_API_KEY"]
@@ -13,7 +11,7 @@
# Step 2.1: Connect to your Weaviate Cloud instance
client = weaviate.connect_to_weaviate_cloud(
cluster_url=weaviate_url,
- auth_credentials=Auth.api_key(weaviate_api_key),
+ auth_credentials=weaviate_api_key,
# highlight-start
headers={"X-Anthropic-Api-Key": anthropic_api_key},
# highlight-end
diff --git a/_includes/code/python/quickstart.short.local.create_collection.py b/_includes/code/python/quickstart.short.local.create_collection.py
new file mode 100644
index 00000000..cbbfc867
--- /dev/null
+++ b/_includes/code/python/quickstart.short.local.create_collection.py
@@ -0,0 +1,47 @@
+# START CreateCollection
+import weaviate
+from weaviate.classes.config import Configure
+
+# Step 1.1: Connect to your local Weaviate instance
+client = weaviate.connect_to_local()
+
+# END CreateCollection
+
+# NOT SHOWN TO THE USER - DELETE EXISTING COLLECTION
+client.collections.delete("Movie")
+
+# START CreateCollection
+# Step 1.2: Create a collection
+# highlight-start
+movies = client.collections.create(
+ name="Movie",
+ vector_config=Configure.Vectors.text2vec_ollama( # Configure the Ollama embedding integration
+ api_endpoint="http://ollama:11434", # If using Docker you might need: http://host.docker.internal:11434
+ model="nomic-embed-text", # The model to use
+ ),
+)
+# highlight-end
+# START CreateCollection
+
+# END CreateCollection
+# fmt: off
+# START CreateCollection
+# Step 1.3: Import three objects
+data_objects = [
+ {"title": "The Matrix", "description": "A computer hacker learns about the true nature of reality and his role in the war against its controllers.", "genre": "Science Fiction"},
+ {"title": "Spirited Away", "description": "A young girl becomes trapped in a mysterious world of spirits and must find a way to save her parents and return home.", "genre": "Animation"},
+ {"title": "The Lord of the Rings: The Fellowship of the Ring", "description": "A meek Hobbit and his companions set out on a perilous journey to destroy a powerful ring and save Middle-earth.", "genre": "Fantasy"},
+]
+# END CreateCollection
+# fmt: on
+# START CreateCollection
+
+movies = client.collections.use("Movie")
+with movies.batch.fixed_size(batch_size=200) as batch:
+ for obj in data_objects:
+ batch.add_object(properties=obj)
+
+print(f"Imported & vectorized {len(movies)} objects into the Movie collection")
+
+client.close() # Free up resources
+# END CreateCollection
diff --git a/_includes/code/python/quickstart.short.local.import_vectors.create_collection.py b/_includes/code/python/quickstart.short.local.import_vectors.create_collection.py
new file mode 100644
index 00000000..6dcc4991
--- /dev/null
+++ b/_includes/code/python/quickstart.short.local.import_vectors.create_collection.py
@@ -0,0 +1,48 @@
+# START CreateCollection
+import weaviate
+from weaviate.classes.config import Configure
+
+# Step 1.1: Connect to your local Weaviate instance
+client = weaviate.connect_to_local()
+
+# END CreateCollection
+
+# NOT SHOWN TO THE USER - DELETE EXISTING COLLECTION
+client.collections.delete("Movie")
+
+# START CreateCollection
+# Step 1.2: Create a collection
+# highlight-start
+movies = client.collections.create(
+ name="Movie",
+ vector_config=Configure.Vectors.self_provided(), # No automatic vectorization since we're providing vectors
+)
+# highlight-end
+# START CreateCollection
+
+# END CreateCollection
+# fmt: off
+# START CreateCollection
+# Step 1.3: Import three objects
+data_objects = [
+ {"properties": {"title": "The Matrix", "description": "A computer hacker learns about the true nature of reality and his role in the war against its controllers.", "genre": "Science Fiction"},
+ "vector": [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8]},
+ {"properties": {"title": "Spirited Away", "description": "A young girl becomes trapped in a mysterious world of spirits and must find a way to save her parents and return home.", "genre": "Animation"},
+ "vector": [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9]},
+ {"properties": {"title": "The Lord of the Rings: The Fellowship of the Ring", "description": "A meek Hobbit and his companions set out on a perilous journey to destroy a powerful ring and save Middle-earth.", "genre": "Fantasy"},
+ "vector": [0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0]}
+]
+# END CreateCollection
+# fmt: on
+# START CreateCollection
+
+# Insert the objects with vectors
+movies = client.collections.get("Movie")
+with movies.batch.fixed_size(batch_size=200) as batch:
+ for obj in data_objects:
+ batch.add_object(properties=obj["properties"], vector=obj["vector"])
+
+print(f"Imported {len(data_objects)} objects with vectors into the Movie collection")
+
+client.close() # Free up resources
+# END CreateCollection
diff --git a/_includes/code/python/quickstart.short.local.import_vectors.query.nearvector.py b/_includes/code/python/quickstart.short.local.import_vectors.query.nearvector.py
new file mode 100644
index 00000000..65cb898e
--- /dev/null
+++ b/_includes/code/python/quickstart.short.local.import_vectors.query.nearvector.py
@@ -0,0 +1,29 @@
+# START NearText
+import weaviate
+import json
+
+# Step 2.1: Connect to your local Weaviate instance
+client = weaviate.connect_to_local()
+
+# Step 2.2: Use this collection
+movies = client.collections.use("Movie")
+
+# Step 2.3: Perform a vector search with NearVector
+# highlight-start
+# END NearText
+# fmt: off
+# START NearText
+response = movies.query.near_vector(
+ near_vector=[0.11, 0.21, 0.31, 0.41, 0.51, 0.61, 0.71, 0.81],
+ limit=2
+)
+# END NearText
+# fmt: on
+# START NearText
+# highlight-end
+
+for obj in response.objects:
+ print(json.dumps(obj.properties, indent=2)) # Inspect the results
+
+client.close() # Free up resources
+# END NearText
diff --git a/_includes/code/python/quickstart.short.local.import_vectors.query.rag.py b/_includes/code/python/quickstart.short.local.import_vectors.query.rag.py
new file mode 100644
index 00000000..6995ef3e
--- /dev/null
+++ b/_includes/code/python/quickstart.short.local.import_vectors.query.rag.py
@@ -0,0 +1,35 @@
+# START RAG
+import os
+import weaviate
+from weaviate.classes.generate import GenerativeConfig
+
+# Best practice: store your credentials in environment variables
+anthropic_api_key = os.environ["ANTHROPIC_API_KEY"]
+
+# Step 2.1: Connect to your local Weaviate instance
+client = weaviate.connect_to_local(
+ # highlight-start
+ headers={"X-Anthropic-Api-Key": anthropic_api_key},
+ # highlight-end
+)
+
+# Step 2.2: Use this collection
+movies = client.collections.use("Movie")
+
+# Step 2.3: Perform RAG with on NearVector results
+# highlight-start
+response = movies.generate.near_vector(
+ near_vector=[0.11, 0.21, 0.31, 0.41, 0.51, 0.61, 0.71, 0.81],
+ limit=1,
+ grouped_task="Write a tweet with emojis about this movie.",
+ generative_provider=GenerativeConfig.ollama( # Configure the Ollama generative integration
+ api_endpoint="http://ollama:11434", # If using Docker you might need: http://host.docker.internal:11434
+ model="llama3.2", # The model to use
+ ),
+)
+# highlight-end
+
+print(response.generative.text) # Inspect the results
+
+client.close() # Free up resources
+# END RAG
diff --git a/_includes/code/python/quickstart.short.local.query.neartext.py b/_includes/code/python/quickstart.short.local.query.neartext.py
new file mode 100644
index 00000000..2da086ed
--- /dev/null
+++ b/_includes/code/python/quickstart.short.local.query.neartext.py
@@ -0,0 +1,29 @@
+# START NearText
+import weaviate
+import json
+
+# Step 2.1: Connect to your local Weaviate instance
+client = weaviate.connect_to_local()
+
+# Step 2.2: Use this collection
+movies = client.collections.use("Movie")
+
+# Step 2.3: Perform a semantic search with NearText
+# highlight-start
+# END NearText
+# fmt: off
+# START NearText
+response = movies.query.near_text(
+ query="sci-fi",
+ limit=2
+)
+# END NearText
+# fmt: on
+# START NearText
+# highlight-end
+
+for obj in response.objects:
+ print(json.dumps(obj.properties, indent=2)) # Inspect the results
+
+client.close() # Free up resources
+# END NearText
diff --git a/_includes/code/python/quickstart.short.local.query.rag.py b/_includes/code/python/quickstart.short.local.query.rag.py
new file mode 100644
index 00000000..ef16499f
--- /dev/null
+++ b/_includes/code/python/quickstart.short.local.query.rag.py
@@ -0,0 +1,35 @@
+# START RAG
+import os
+import weaviate
+from weaviate.classes.generate import GenerativeConfig
+
+# Best practice: store your credentials in environment variables
+anthropic_api_key = os.environ["ANTHROPIC_API_KEY"]
+
+# Step 2.1: Connect to your local Weaviate instance
+client = weaviate.connect_to_local(
+ # highlight-start
+ headers={"X-Anthropic-Api-Key": anthropic_api_key},
+ # highlight-end
+)
+
+# Step 2.2: Use this collection
+movies = client.collections.use("Movie")
+
+# Step 2.3: Perform RAG with on NearText results
+# highlight-start
+response = movies.generate.near_text(
+ query="sci-fi",
+ limit=1,
+ grouped_task="Write a tweet with emojis about this movie.",
+ generative_provider=GenerativeConfig.ollama( # Configure the Ollama generative integration
+ api_endpoint="http://ollama:11434", # If using Docker you might need: http://host.docker.internal:11434
+ model="llama3.2", # The model to use
+ ),
+)
+# highlight-end
+
+print(response.generative.text) # Inspect the results
+
+client.close() # Free up resources
+# END RAG
diff --git a/_includes/code/python/quickstart.short.query.neartext.py b/_includes/code/python/quickstart.short.query.neartext.py
index 50cf13eb..1235ca62 100644
--- a/_includes/code/python/quickstart.short.query.neartext.py
+++ b/_includes/code/python/quickstart.short.query.neartext.py
@@ -1,6 +1,5 @@
# START NearText
import weaviate
-from weaviate.classes.init import Auth
import os, json
# Best practice: store your credentials in environment variables
@@ -10,7 +9,7 @@
# Step 2.1: Connect to your Weaviate Cloud instance
client = weaviate.connect_to_weaviate_cloud(
cluster_url=weaviate_url,
- auth_credentials=Auth.api_key(weaviate_api_key),
+ auth_credentials=weaviate_api_key,
)
# Step 2.2: Use this collection
diff --git a/_includes/code/python/quickstart.short.query.rag.py b/_includes/code/python/quickstart.short.query.rag.py
index 867af7d1..aa1c1940 100644
--- a/_includes/code/python/quickstart.short.query.rag.py
+++ b/_includes/code/python/quickstart.short.query.rag.py
@@ -1,10 +1,8 @@
# START RAG
import os
import weaviate
-from weaviate.classes.init import Auth
from weaviate.classes.generate import GenerativeConfig
-
# Best practice: store your credentials in environment variables
weaviate_url = os.environ["WEAVIATE_URL"]
weaviate_api_key = os.environ["WEAVIATE_API_KEY"]
@@ -13,7 +11,7 @@
# Step 2.1: Connect to your Weaviate Cloud instance
client = weaviate.connect_to_weaviate_cloud(
cluster_url=weaviate_url,
- auth_credentials=Auth.api_key(weaviate_api_key),
+ auth_credentials=weaviate_api_key,
# highlight-start
headers={"X-Anthropic-Api-Key": anthropic_api_key},
# highlight-end
diff --git a/_includes/code/quickstart/quickstart.short.local.create_collection.mdx b/_includes/code/quickstart/quickstart.short.local.create_collection.mdx
new file mode 100644
index 00000000..0b6cdb4c
--- /dev/null
+++ b/_includes/code/quickstart/quickstart.short.local.create_collection.mdx
@@ -0,0 +1,55 @@
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+import FilteredTextBlock from "@site/src/components/Documentation/FilteredTextBlock";
+import PyCode from "!!raw-loader!/_includes/code/python/quickstart.short.local.create_collection.py";
+import TSCode from "!!raw-loader!/_includes/code/typescript/quickstart.short.local.create_collection.ts";
+import GoCode from "!!raw-loader!/_includes/code/howto/go/docs/quickstart/short_local_1/quickstart.short.local.create_collection.go";
+import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalCreate.java";
+
+
+
+
+
+
+
+
+
+
+
+The collection also contains a configuration for the generative (RAG) integration:
+
+- OpenAI [generative AI integrations](/weaviate/model-providers/openai/generative) for retrieval augmented generation (RAG).
+
+
+
+
+
+
+The collection also contains a configuration for the generative (RAG) integration:
+
+- OpenAI [generative AI integrations](/weaviate/model-providers/openai/generative) for retrieval augmented generation (RAG).
+
+
+
+
+
diff --git a/_includes/code/quickstart/quickstart.short.local.import-vectors.query.rag.mdx b/_includes/code/quickstart/quickstart.short.local.import-vectors.query.rag.mdx
new file mode 100644
index 00000000..34b4ecbc
--- /dev/null
+++ b/_includes/code/quickstart/quickstart.short.local.import-vectors.query.rag.mdx
@@ -0,0 +1,42 @@
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+import FilteredTextBlock from "@site/src/components/Documentation/FilteredTextBlock";
+import PyCode from "!!raw-loader!/_includes/code/python/quickstart.short.local.import_vectors.query.rag.py";
+import TSCode from "!!raw-loader!/_includes/code/typescript/quickstart.short.local.import_vectors.query.rag.ts";
+import GoCode from "!!raw-loader!/_includes/code/howto/go/docs/quickstart/short_local_vectors_3/quickstart.short.local.import_vectors.query.rag.go";
+import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearVectorRAG.java";
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/_includes/code/quickstart/quickstart.short.local.import_vectors.create_collection.mdx b/_includes/code/quickstart/quickstart.short.local.import_vectors.create_collection.mdx
new file mode 100644
index 00000000..5fc4f775
--- /dev/null
+++ b/_includes/code/quickstart/quickstart.short.local.import_vectors.create_collection.mdx
@@ -0,0 +1,55 @@
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+import FilteredTextBlock from "@site/src/components/Documentation/FilteredTextBlock";
+import PyCode from "!!raw-loader!/_includes/code/python/quickstart.short.local.import_vectors.create_collection.py";
+import TSCode from "!!raw-loader!/_includes/code/typescript/quickstart.short.local.import_vectors.create_collection.ts";
+import GoCode from "!!raw-loader!/_includes/code/howto/go/docs/quickstart/short_local_vectors_1/quickstart.short.local.import_vectors.create_collection.go";
+import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalCreateVectors.java";
+
+
+
+
+
+
+
+
+
+
+
+The collection also contains a configuration for the generative (RAG) integration:
+
+- OpenAI [generative AI integrations](/weaviate/model-providers/openai/generative) for retrieval augmented generation (RAG).
+
+
+
+
+
+
+The collection also contains a configuration for the generative (RAG) integration:
+
+- OpenAI [generative AI integrations](/weaviate/model-providers/openai/generative) for retrieval augmented generation (RAG).
+
+
+
+
+
diff --git a/_includes/code/quickstart/quickstart.short.local.import_vectors.query.nearvector.mdx b/_includes/code/quickstart/quickstart.short.local.import_vectors.query.nearvector.mdx
new file mode 100644
index 00000000..a411f90a
--- /dev/null
+++ b/_includes/code/quickstart/quickstart.short.local.import_vectors.query.nearvector.mdx
@@ -0,0 +1,42 @@
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+import FilteredTextBlock from "@site/src/components/Documentation/FilteredTextBlock";
+import PyCode from "!!raw-loader!/_includes/code/python/quickstart.short.local.import_vectors.query.nearvector.py";
+import TSCode from "!!raw-loader!/_includes/code/typescript/quickstart.short.local.import_vectors.query.nearvector.ts";
+import GoCode from "!!raw-loader!/_includes/code/howto/go/docs/quickstart/short_local_vectors_2/quickstart.short.local.import_vectors.query.nearvector.go";
+import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearVector.java";
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/_includes/code/quickstart/quickstart.short.local.query.neartext.mdx b/_includes/code/quickstart/quickstart.short.local.query.neartext.mdx
new file mode 100644
index 00000000..2cc49224
--- /dev/null
+++ b/_includes/code/quickstart/quickstart.short.local.query.neartext.mdx
@@ -0,0 +1,42 @@
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+import FilteredTextBlock from "@site/src/components/Documentation/FilteredTextBlock";
+import PyCode from "!!raw-loader!/_includes/code/python/quickstart.short.local.query.neartext.py";
+import TSCode from "!!raw-loader!/_includes/code/typescript/quickstart.short.local.query.neartext.ts";
+import GoCode from "!!raw-loader!/_includes/code/howto/go/docs/quickstart/short_local_2/quickstart.short.local.query.neartext.go";
+import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearText.java";
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/_includes/code/quickstart/quickstart.short.local.query.rag.mdx b/_includes/code/quickstart/quickstart.short.local.query.rag.mdx
new file mode 100644
index 00000000..e39fcfeb
--- /dev/null
+++ b/_includes/code/quickstart/quickstart.short.local.query.rag.mdx
@@ -0,0 +1,42 @@
+import Tabs from "@theme/Tabs";
+import TabItem from "@theme/TabItem";
+import FilteredTextBlock from "@site/src/components/Documentation/FilteredTextBlock";
+import PyCode from "!!raw-loader!/_includes/code/python/quickstart.short.local.query.rag.py";
+import TSCode from "!!raw-loader!/_includes/code/typescript/quickstart.short.local.query.rag.ts";
+import GoCode from "!!raw-loader!/_includes/code/howto/go/docs/quickstart/short_local_3/quickstart.short.local.query.rag.go";
+import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearTextRAG.java";
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/_includes/code/typescript/quickstart.short.local.create_collection.ts b/_includes/code/typescript/quickstart.short.local.create_collection.ts
new file mode 100644
index 00000000..dabb209d
--- /dev/null
+++ b/_includes/code/typescript/quickstart.short.local.create_collection.ts
@@ -0,0 +1,43 @@
+// START CreateCollection
+import weaviate, { WeaviateClient, vectors } from 'weaviate-client';
+
+// Step 1.1: Connect to your local Weaviate instance
+const client: WeaviateClient = await weaviate.connectToLocal();
+
+// END CreateCollection
+
+// NOT SHOWN TO THE USER - DELETE EXISTING COLLECTION
+await client.collections.delete('Movie');
+
+// START CreateCollection
+// Step 1.2: Create a collection
+// highlight-start
+const movies = await client.collections.create({
+ name: 'Movie',
+ vectorizers: vectors.text2VecOllama({ // Configure the Ollama embedding integration
+ apiEndpoint: 'http://ollama:11434', // If using Docker you might need: http://host.docker.internal:11434
+ model: 'nomic-embed-text', // The model to use
+ }),
+});
+// highlight-end
+
+// END CreateCollection
+
+// START CreateCollection
+// Step 1.3: Import three objects
+const dataObjects = [
+ { title: 'The Matrix', description: 'A computer hacker learns about the true nature of reality and his role in the war against its controllers.', genre: 'Science Fiction' },
+ { title: 'Spirited Away', description: 'A young girl becomes trapped in a mysterious world of spirits and must find a way to save her parents and return home.', genre: 'Animation' },
+ { title: 'The Lord of the Rings: The Fellowship of the Ring', description: 'A meek Hobbit and his companions set out on a perilous journey to destroy a powerful ring and save Middle-earth.', genre: 'Fantasy' },
+];
+
+// END CreateCollection
+
+// START CreateCollection
+const movieCollection = client.collections.get('Movie');
+const response = await movieCollection.data.insertMany(dataObjects);
+
+console.log(`Imported & vectorized ${dataObjects.length} objects into the Movie collection`);
+
+await client.close(); // Free up resources
+// END CreateCollection
diff --git a/_includes/code/typescript/quickstart.short.local.import_vectors.create_collection.ts b/_includes/code/typescript/quickstart.short.local.import_vectors.create_collection.ts
new file mode 100644
index 00000000..871ffe26
--- /dev/null
+++ b/_includes/code/typescript/quickstart.short.local.import_vectors.create_collection.ts
@@ -0,0 +1,44 @@
+// START CreateCollection
+import weaviate, { WeaviateClient, vectors } from 'weaviate-client';
+
+// Step 1.1: Connect to your local Weaviate instance
+const client: WeaviateClient = await weaviate.connectToLocal();
+
+// END CreateCollection
+
+// NOT SHOWN TO THE USER - DELETE EXISTING COLLECTION
+await client.collections.delete('Movie');
+
+// START CreateCollection
+// Step 1.2: Create a collection
+// highlight-start
+const movies = await client.collections.create({
+ name: 'Movie',
+ vectorizers: vectors.selfProvided(), // No automatic vectorization since we're providing vectors
+});
+// highlight-end
+
+// Step 1.3: Import three objects
+const dataObjects = [
+ {
+ properties: { title: 'The Matrix', description: 'A computer hacker learns about the true nature of reality and his role in the war against its controllers.', genre: 'Science Fiction' },
+ vectors: [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8],
+ },
+ {
+ properties: { title: 'Spirited Away', description: 'A young girl becomes trapped in a mysterious world of spirits and must find a way to save her parents and return home.', genre: 'Animation' },
+ vectors: [0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9],
+ },
+ {
+ properties: { title: 'The Lord of the Rings: The Fellowship of the Ring', description: 'A meek Hobbit and his companions set out on a perilous journey to destroy a powerful ring and save Middle-earth.', genre: 'Fantasy' },
+ vectors: [0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0],
+ },
+];
+
+// Insert the objects with vectors
+const movieCollection = client.collections.get('Movie');
+const response = await movieCollection.data.insertMany(dataObjects);
+
+console.log(`Imported ${dataObjects.length} objects with vectors into the Movie collection`);
+
+await client.close(); // Free up resources
+// END CreateCollection
diff --git a/_includes/code/typescript/quickstart.short.local.import_vectors.query.nearvector.ts b/_includes/code/typescript/quickstart.short.local.import_vectors.query.nearvector.ts
new file mode 100644
index 00000000..76fbc134
--- /dev/null
+++ b/_includes/code/typescript/quickstart.short.local.import_vectors.query.nearvector.ts
@@ -0,0 +1,25 @@
+// START NearText
+import weaviate, { WeaviateClient } from 'weaviate-client';
+
+// Step 2.1: Connect to your local Weaviate instance
+const client: WeaviateClient = await weaviate.connectToLocal();
+
+// Step 2.2: Use this collection
+const movies = client.collections.get('Movie');
+
+// Step 2.3: Perform a vector search with NearVector
+// highlight-start
+const response = await movies.query.nearVector(
+ [0.11, 0.21, 0.31, 0.41, 0.51, 0.61, 0.71, 0.81],
+ {
+ limit: 2,
+ }
+);
+// highlight-end
+
+for (const obj of response.objects) {
+ console.log(JSON.stringify(obj.properties, null, 2)); // Inspect the results
+}
+
+await client.close(); // Free up resources
+// END NearText
diff --git a/_includes/code/typescript/quickstart.short.local.import_vectors.query.rag.ts b/_includes/code/typescript/quickstart.short.local.import_vectors.query.rag.ts
new file mode 100644
index 00000000..64764fa5
--- /dev/null
+++ b/_includes/code/typescript/quickstart.short.local.import_vectors.query.rag.ts
@@ -0,0 +1,37 @@
+// START RAG
+import weaviate, { WeaviateClient, generativeParameters } from 'weaviate-client';
+
+// Best practice: store your credentials in environment variables
+const anthropicApiKey = process.env.ANTHROPIC_API_KEY!;
+
+// Step 2.1: Connect to your local Weaviate instance
+const client: WeaviateClient = await weaviate.connectToLocal(
+ // highlight-start
+ { headers: { 'X-Anthropic-Api-Key': anthropicApiKey } },
+ // highlight-end
+);
+
+// Step 2.2: Use this collection
+const movies = client.collections.get('Movie');
+
+// Step 2.3: Perform RAG with on NearVector results
+// highlight-start
+const response = await movies.generate.nearVector(
+ [0.11, 0.21, 0.31, 0.41, 0.51, 0.61, 0.71, 0.81],
+ {
+ groupedTask: 'Write a tweet with emojis about this movie.',
+ config: generativeParameters.ollama({
+ apiEndpoint: 'http://ollama:11434', // If using Docker you might need: http://host.docker.internal:11434
+ model: 'llama3.2', // The model to use
+ }),
+ },
+ {
+ limit: 1,
+ }
+);
+// highlight-end
+
+console.log(response.generative); // Inspect the results
+
+await client.close(); // Free up resources
+// END RAG
\ No newline at end of file
diff --git a/_includes/code/typescript/quickstart.short.local.query.neartext.ts b/_includes/code/typescript/quickstart.short.local.query.neartext.ts
new file mode 100644
index 00000000..4cd4603c
--- /dev/null
+++ b/_includes/code/typescript/quickstart.short.local.query.neartext.ts
@@ -0,0 +1,25 @@
+// START NearText
+import weaviate, { WeaviateClient } from 'weaviate-client';
+
+// Step 2.1: Connect to your local Weaviate instance
+const client: WeaviateClient = await weaviate.connectToLocal();
+
+// Step 2.2: Use this collection
+const movies = client.collections.get('Movie');
+
+// Step 2.3: Perform a semantic search with NearText
+// highlight-start
+const response = await movies.query.nearText(
+ 'sci-fi',
+ {
+ limit: 2,
+ }
+);
+// highlight-end
+
+for (const obj of response.objects) {
+ console.log(JSON.stringify(obj.properties, null, 2)); // Inspect the results
+}
+
+await client.close(); // Free up resources
+// END NearText
diff --git a/_includes/code/typescript/quickstart.short.local.query.rag.ts b/_includes/code/typescript/quickstart.short.local.query.rag.ts
new file mode 100644
index 00000000..14523208
--- /dev/null
+++ b/_includes/code/typescript/quickstart.short.local.query.rag.ts
@@ -0,0 +1,37 @@
+// START RAG
+import weaviate, { WeaviateClient, generativeParameters } from 'weaviate-client';
+
+// Best practice: store your credentials in environment variables
+const anthropicApiKey = process.env.ANTHROPIC_API_KEY!;
+
+// Step 2.1: Connect to your local Weaviate instance
+const client: WeaviateClient = await weaviate.connectToLocal(
+ // highlight-start
+ { headers: { 'X-Anthropic-Api-Key': anthropicApiKey } },
+ // highlight-end
+);
+
+// Step 2.2: Use this collection
+const movies = client.collections.get('Movie');
+
+// Step 2.3: Perform RAG with on NearText results
+// highlight-start
+const response = await movies.generate.nearText(
+ 'sci-fi',
+ {
+ groupedTask: 'Write a tweet with emojis about this movie.',
+ config: generativeParameters.ollama({
+ apiEndpoint: 'http://ollama:11434', // If using Docker you might need: http://host.docker.internal:11434
+ model: 'llama3.2', // The model to use
+ }),
+ },
+ {
+ limit: 1,
+ }
+);
+// highlight-end
+
+console.log(response.generative); // Inspect the results
+
+await client.close(); // Free up resources
+// END RAG
diff --git a/docs/weaviate/quickstart/index.md b/docs/weaviate/quickstart/index.md
index 1200344b..38fbcdc7 100644
--- a/docs/weaviate/quickstart/index.md
+++ b/docs/weaviate/quickstart/index.md
@@ -1,5 +1,5 @@
---
-title: Quickstart (with Weaviate Cloud)
+title: "Quickstart: With Cloud resources"
image: og/docs/quickstart-tutorial.jpg
# tags: ['getting started']
---
@@ -55,7 +55,7 @@ There are two paths you can choose from:
This quickstart guide will show you how to:
-1. **Create a collection & import data** - Create a collection and import data into it. The data will be vectorized with the Weaviate Embeddings service. You are also free to use any other available embedding model provider.
+1. **Create a collection & import data** - Create a collection and import data into it. The data will be vectorized with the Weaviate Embeddings service. You are also free to use any other available [embedding model provider](../model-providers/index.md).
2. **Search** - Perform a similarity (vector) search on your data using a text query.
3. **RAG** - Perform Retrieval Augmented Generation (RAG) with a generative model.
diff --git a/docs/weaviate/quickstart/local.md b/docs/weaviate/quickstart/local.md
index 1d97938b..4effcea3 100644
--- a/docs/weaviate/quickstart/local.md
+++ b/docs/weaviate/quickstart/local.md
@@ -1,5 +1,5 @@
---
-title: 'Quickstart: Locally hosted'
+title: "Quickstart: Locally hosted"
sidebar_label: Locally hosted
image: og/docs/quickstart-tutorial.jpg
# tags: ['getting started']
@@ -50,8 +50,8 @@ There are two paths you can choose from:
This quickstart guide will show you how to:
-1. **Create a collection & import data** - Create a collection and import data into it. The data will be vectorized with the Ollama embedding model service. You are also free to use any other available embedding model provider.
-2. **Search** - Perform a similarity (vector) search on your data using a text query.
+1. **Create a collection & import data** - Create a collection and import data into it. The data will be vectorized with the Ollama embedding model service. You are also free to use any other available [embedding model provider](../model-providers/index.md).
+2. **Search** - Perform a similarity (vector) search on your data using a text query.
3. **RAG** - Perform Retrieval Augmented Generation (RAG) with a generative model.
@@ -141,7 +141,7 @@ import CodeClientInstall from "/_includes/code/quickstart/clients.install.new.md
The following example creates a collection called `Movie` with the [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service for vectorizing data during import and for querying.
-import CreateCollection from "/_includes/code/quickstart/quickstart.short.create_collection.mdx";
+import CreateCollection from "/_includes/code/quickstart/quickstart.short.local.create_collection.mdx";
@@ -150,7 +150,7 @@ import CreateCollection from "/_includes/code/quickstart/quickstart.short.create
The following example creates a collection called `Movie` and imports pre-computed vectors along with the movie data. We will define the collection properties explicitly, but you can also use the [auto-schema](../config-refs/collections.mdx#auto-schema) feature to infer the data schema automatically.
-import CreateCollectionCustomVectors from "/_includes/code/quickstart/quickstart.short.import_vectors.create_collection.mdx";
+import CreateCollectionCustomVectors from "/_includes/code/quickstart/quickstart.short.local.import_vectors.create_collection.mdx";
@@ -164,7 +164,7 @@ import CreateCollectionCustomVectors from "/_includes/code/quickstart/quickstart
Semantic search finds results based on meaning. This is called `nearText` in Weaviate. The following example searches for 2 objects (_limit_) whose meaning is most similar to that of `sci-fi`.
-import QueryNearText from "/_includes/code/quickstart/quickstart.short.query.neartext.mdx";
+import QueryNearText from "/_includes/code/quickstart/quickstart.short.local.query.neartext.mdx";
@@ -173,7 +173,7 @@ import QueryNearText from "/_includes/code/quickstart/quickstart.short.query.nea
Semantic search finds results based on meaning. This is called `nearVector` in Weaviate. The following example searches for 2 objects (_limit_) whose vector is most similar to the query vector.
-import QueryNearVectorImportVectors from "/_includes/code/quickstart/quickstart.short.import_vectors.query.nearvector.mdx";
+import QueryNearVectorImportVectors from "/_includes/code/quickstart/quickstart.short.local.import_vectors.query.nearvector.mdx";
@@ -218,7 +218,7 @@ Retrieval augmented generation (RAG), also called generative search, works by pr
The following example combines the semantic search for the query `sci-fi` with a prompt to generate a tweet.
-import QueryRAG from "/_includes/code/quickstart/quickstart.short.query.rag.mdx";
+import QueryRAG from "/_includes/code/quickstart/quickstart.short.local.query.rag.mdx";
@@ -229,7 +229,7 @@ Retrieval augmented generation (RAG), also called generative search, works by pr
The following example combines the vector similarity search with a prompt to generate a tweet.
-import QueryRAGCustomVectors from "/_includes/code/quickstart/quickstart.short.import-vectors.query.rag.mdx";
+import QueryRAGCustomVectors from "/_includes/code/quickstart/quickstart.short.local.import-vectors.query.rag.mdx";
From 51e8e53f92399fd0eb973c9b59af04879cddb80e Mon Sep 17 00:00:00 2001
From: Ivan Despot <66276597+g-despot@users.noreply.github.com>
Date: Thu, 6 Nov 2025 21:22:04 +0100
Subject: [PATCH 13/16] Update docs
---
docs/weaviate/quickstart/index.md | 2 +-
docs/weaviate/quickstart/local.md | 27 ++++++++++++------
tests/docker-compose.yml | 46 ++++++++++++++++++++-----------
3 files changed, 49 insertions(+), 26 deletions(-)
diff --git a/docs/weaviate/quickstart/index.md b/docs/weaviate/quickstart/index.md
index 38fbcdc7..45b3f14b 100644
--- a/docs/weaviate/quickstart/index.md
+++ b/docs/weaviate/quickstart/index.md
@@ -277,7 +277,7 @@ The following example combines the vector similarity search with a prompt to gen
import QueryRAGCustomVectors from "/_includes/code/quickstart/quickstart.short.import-vectors.query.rag.mdx";
-
+
diff --git a/docs/weaviate/quickstart/local.md b/docs/weaviate/quickstart/local.md
index 4effcea3..377b2972 100644
--- a/docs/weaviate/quickstart/local.md
+++ b/docs/weaviate/quickstart/local.md
@@ -105,14 +105,27 @@ services:
ENABLE_MODULES: 'text2vec-ollama,generative-ollama'
CLUSTER_HOSTNAME: 'node1'
OLLAMA_API_ENDPOINT: 'http://ollama:11434'
+ depends_on:
+ - ollama
+
ollama:
image: ollama/ollama:0.12.9
- volumes:
- - ~/.ollama:/root/.ollama
ports:
- "11434:11434"
+ volumes:
+ - ollama_data:/root/.ollama
environment:
- OLLAMA_HOST=0.0.0.0
+ command: >
+ sh -c "
+ ollama serve &
+ PID=$!
+ sleep 5
+ ollama pull nomic-embed-text
+ ollama pull llama3
+ wait $PID
+ "
+
volumes:
weaviate_data:
ollama_data:
@@ -139,7 +152,7 @@ import CodeClientInstall from "/_includes/code/quickstart/clients.install.new.md
-The following example creates a collection called `Movie` with the [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service for vectorizing data during import and for querying.
+The following example creates a collection called `Movie` with the [Ollama](../model-providers/ollama/embeddings.md) embedding model provider (`text2vec-ollama`) for vectorizing data during import and for querying.
import CreateCollection from "/_includes/code/quickstart/quickstart.short.local.create_collection.mdx";
@@ -201,16 +214,12 @@ import QueryNearVectorImportVectors from "/_includes/code/quickstart/quickstart.
:::tip Weaviate Agents
-Try querying your Weaviate Cloud data using the [Query Agent](/agents/query/index.md). You simply provide a prompt/question in natural language, and the Query Agent takes care of all the needed steps to provide an answer.
+Try the [Query Agent](/agents/query/index.md) with a Weaviate Cloud instance. You simply provide a prompt/question in natural language, and the Query Agent takes care of all the needed steps to provide an answer.
:::
## Step 3: Retrieval augmented generation (RAG)
-:::note Requirement: Claude API key
-For Retrieval Augmented Generation (RAG) in this step, you will need a [Claude API key](https://console.anthropic.com/settings/keys). You can also use another generative [model provider](/weaviate/model-providers) instead.
-:::
-
@@ -231,7 +240,7 @@ The following example combines the vector similarity search with a prompt to gen
import QueryRAGCustomVectors from "/_includes/code/quickstart/quickstart.short.local.import-vectors.query.rag.mdx";
-
+
diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml
index 714f2228..9ba8746c 100644
--- a/tests/docker-compose.yml
+++ b/tests/docker-compose.yml
@@ -1,6 +1,5 @@
----
services:
- weaviate_apikey:
+ weaviate:
command:
- --host
- 0.0.0.0
@@ -8,26 +7,41 @@ services:
- '8080'
- --scheme
- http
- image: cr.weaviate.io/semitechnologies/weaviate:1.34.0-rc.1
+ image: cr.weaviate.io/semitechnologies/weaviate:1.34.0
ports:
- - 8099:8080
- - 50052:50051
+ - 8080:8080
+ - 50051:50051
+ volumes:
+ - weaviate_data:/var/lib/weaviate
restart: on-failure:0
environment:
QUERY_DEFAULTS_LIMIT: 25
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
- BACKUP_FILESYSTEM_PATH: '/var/lib/weaviate/backups'
- ASYNC_INDEXING: 'true'
- ENABLE_MODULES: 'text2vec-ollama,generative-ollama,backup-filesystem,offload-s3'
+ ENABLE_MODULES: 'text2vec-ollama,generative-ollama'
CLUSTER_HOSTNAME: 'node1'
+ OLLAMA_API_ENDPOINT: 'http://ollama:11434'
+ depends_on:
+ - ollama
- # Enables API key authentication.
- AUTHENTICATION_APIKEY_ENABLED: 'true'
-
- # List one or more keys, separated by commas. Each key corresponds to a specific user identity below.
- AUTHENTICATION_APIKEY_ALLOWED_KEYS: 'secr3tk3y'
+ ollama:
+ image: ollama/ollama:0.12.9
+ ports:
+ - "11434:11434"
+ volumes:
+ - ollama_data:/root/.ollama
+ environment:
+ - OLLAMA_HOST=0.0.0.0
+ command: >
+ sh -c "
+ ollama serve &
+ PID=$!
+ sleep 5
+ ollama pull nomic-embed-text
+ ollama pull llama3
+ wait $PID
+ "
- # List one or more user identities, separated by commas. Each identity corresponds to a specific key above.
- AUTHENTICATION_APIKEY_USERS: 'testuser@weaviate.io'
-...
+volumes:
+ weaviate_data:
+ ollama_data:
\ No newline at end of file
From 264820950c4beb1e0dfbb5cfb1e0a65eb91a2998 Mon Sep 17 00:00:00 2001
From: Ivan Despot <66276597+g-despot@users.noreply.github.com>
Date: Fri, 7 Nov 2025 11:20:23 +0100
Subject: [PATCH 14/16] Update docs
---
.../quickstart.short.create_collection.go | 4 +++-
...art.short.import_vectors.create_collection.go | 4 +++-
.../docs/quickstart/QuickstartLocalCreate.java | 16 ++++++++++++----
.../quickstart/QuickstartLocalCreateVectors.java | 9 ++++++---
.../QuickstartLocalQueryNearTextRAG.java | 2 --
.../quickstart.short.import_vectors.query.rag.py | 4 +++-
...start.short.local.import_vectors.query.rag.py | 10 +---------
.../python/quickstart.short.local.query.rag.py | 10 +---------
.../code/python/quickstart.short.query.rag.py | 8 ++++----
docs/weaviate/quickstart/local.md | 9 ++++++++-
tests/docker-compose.yml | 11 -----------
11 files changed, 41 insertions(+), 46 deletions(-)
diff --git a/_includes/code/howto/go/docs/quickstart/short_1/quickstart.short.create_collection.go b/_includes/code/howto/go/docs/quickstart/short_1/quickstart.short.create_collection.go
index dd531839..bca2138f 100644
--- a/_includes/code/howto/go/docs/quickstart/short_1/quickstart.short.create_collection.go
+++ b/_includes/code/howto/go/docs/quickstart/short_1/quickstart.short.create_collection.go
@@ -39,7 +39,9 @@ func main() {
Class: "Movie",
Vectorizer: "text2vec-weaviate",
ModuleConfig: map[string]interface{}{
- "generative-anthropic": map[string]interface{}{},
+ "generative-anthropic": map[string]interface{}{
+ "model": "claude-3-5-haiku-latest",
+ },
},
}
diff --git a/_includes/code/howto/go/docs/quickstart/short_vectors_1/quickstart.short.import_vectors.create_collection.go b/_includes/code/howto/go/docs/quickstart/short_vectors_1/quickstart.short.import_vectors.create_collection.go
index b73dbf40..dcbf248c 100644
--- a/_includes/code/howto/go/docs/quickstart/short_vectors_1/quickstart.short.import_vectors.create_collection.go
+++ b/_includes/code/howto/go/docs/quickstart/short_vectors_1/quickstart.short.import_vectors.create_collection.go
@@ -39,7 +39,9 @@ func main() {
Class: "Movie",
Vectorizer: "none", // No automatic vectorization since we're providing vectors
ModuleConfig: map[string]interface{}{
- "generative-anthropic": map[string]interface{}{},
+ "generative-anthropic": map[string]interface{}{
+ "model": "claude-3-5-haiku-latest",
+ },
},
}
diff --git a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalCreate.java b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalCreate.java
index 21b81617..f98c6c2b 100644
--- a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalCreate.java
+++ b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalCreate.java
@@ -24,14 +24,22 @@ public static void main(String[] args) throws AuthException {
// START CreateCollection
// Step 1.2: Create a collection
- Map moduleConfig = new HashMap<>();
- Map generativeAnthropicSettings = new HashMap<>();
- moduleConfig.put("generative-anthropic", generativeAnthropicSettings);
+ Map text2vecOllamaSettings = new HashMap<>();
+ text2vecOllamaSettings.put("apiEndpoint", "http://ollama:11434"); // If using Docker you might need: http://host.docker.internal:11434
+ text2vecOllamaSettings.put("model", "nomic-embed-text"); // The model to use
+
+ Map generativeOllamaSettings = new HashMap<>();
+ generativeOllamaSettings.put("apiEndpoint", "http://ollama:11434"); // If using Docker you might need: http://host.docker.internal:11434
+ generativeOllamaSettings.put("model", "llama3.2"); // The model to use
+
+ Map> moduleConfig = new HashMap<>();
+ moduleConfig.put("text2vec-ollama", text2vecOllamaSettings);
+ moduleConfig.put("generative-ollama", generativeOllamaSettings);
// highlight-start
WeaviateClass movieClass = WeaviateClass.builder()
.className("Movie")
- .vectorizer("text2vec-weaviate")
+ .vectorizer("text2vec-ollama")
.moduleConfig(moduleConfig)
.build();
diff --git a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalCreateVectors.java b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalCreateVectors.java
index 11b057ca..e8ff0a18 100644
--- a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalCreateVectors.java
+++ b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalCreateVectors.java
@@ -24,9 +24,12 @@ public static void main(String[] args) throws AuthException {
// START CreateCollection
// Step 1.2: Create a collection
- Map moduleConfig = new HashMap<>();
- Map generativeAnthropicSettings = new HashMap<>();
- moduleConfig.put("generative-anthropic", generativeAnthropicSettings);
+ Map generativeOllamaSettings = new HashMap<>();
+ generativeOllamaSettings.put("apiEndpoint", "http://ollama:11434"); // If using Docker you might need: http://host.docker.internal:11434
+ generativeOllamaSettings.put("model", "llama3.2"); // The model to use
+
+ Map> moduleConfig = new HashMap<>();
+ moduleConfig.put("generative-ollama", generativeOllamaSettings);
// highlight-start
WeaviateClass movieClass = WeaviateClass.builder()
diff --git a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearTextRAG.java b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearTextRAG.java
index 0999a4c9..e3572159 100644
--- a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearTextRAG.java
+++ b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearTextRAG.java
@@ -13,10 +13,8 @@
public class QuickstartLocalQueryNearTextRAG {
public static void main(String[] args) throws AuthException {
// Step 2.1: Connect to your local Weaviate instance
- // highlight-start
Config config = new Config("http", "localhost:8080");
WeaviateClient client = new WeaviateClient(config);
- // highlight-end
// Step 2.2: Perform RAG with NearVector results
// highlight-start
diff --git a/_includes/code/python/quickstart.short.import_vectors.query.rag.py b/_includes/code/python/quickstart.short.import_vectors.query.rag.py
index 7b6e126f..17b2e255 100644
--- a/_includes/code/python/quickstart.short.import_vectors.query.rag.py
+++ b/_includes/code/python/quickstart.short.import_vectors.query.rag.py
@@ -26,7 +26,9 @@
near_vector=[0.11, 0.21, 0.31, 0.41, 0.51, 0.61, 0.71, 0.81],
limit=1,
grouped_task="Write a tweet with emojis about this movie.",
- generative_provider=GenerativeConfig.anthropic(), # Configure the Anthropic generative integration for RAG
+ generative_provider=GenerativeConfig.anthropic(
+ model="claude-3-5-haiku-latest"
+ ), # Configure the Anthropic generative integration for RAG
)
# highlight-end
diff --git a/_includes/code/python/quickstart.short.local.import_vectors.query.rag.py b/_includes/code/python/quickstart.short.local.import_vectors.query.rag.py
index 6995ef3e..80792798 100644
--- a/_includes/code/python/quickstart.short.local.import_vectors.query.rag.py
+++ b/_includes/code/python/quickstart.short.local.import_vectors.query.rag.py
@@ -1,17 +1,9 @@
# START RAG
-import os
import weaviate
from weaviate.classes.generate import GenerativeConfig
-# Best practice: store your credentials in environment variables
-anthropic_api_key = os.environ["ANTHROPIC_API_KEY"]
-
# Step 2.1: Connect to your local Weaviate instance
-client = weaviate.connect_to_local(
- # highlight-start
- headers={"X-Anthropic-Api-Key": anthropic_api_key},
- # highlight-end
-)
+client = weaviate.connect_to_local()
# Step 2.2: Use this collection
movies = client.collections.use("Movie")
diff --git a/_includes/code/python/quickstart.short.local.query.rag.py b/_includes/code/python/quickstart.short.local.query.rag.py
index ef16499f..006da78f 100644
--- a/_includes/code/python/quickstart.short.local.query.rag.py
+++ b/_includes/code/python/quickstart.short.local.query.rag.py
@@ -1,17 +1,9 @@
# START RAG
-import os
import weaviate
from weaviate.classes.generate import GenerativeConfig
-# Best practice: store your credentials in environment variables
-anthropic_api_key = os.environ["ANTHROPIC_API_KEY"]
-
# Step 2.1: Connect to your local Weaviate instance
-client = weaviate.connect_to_local(
- # highlight-start
- headers={"X-Anthropic-Api-Key": anthropic_api_key},
- # highlight-end
-)
+client = weaviate.connect_to_local()
# Step 2.2: Use this collection
movies = client.collections.use("Movie")
diff --git a/_includes/code/python/quickstart.short.query.rag.py b/_includes/code/python/quickstart.short.query.rag.py
index aa1c1940..1d353526 100644
--- a/_includes/code/python/quickstart.short.query.rag.py
+++ b/_includes/code/python/quickstart.short.query.rag.py
@@ -12,9 +12,7 @@
client = weaviate.connect_to_weaviate_cloud(
cluster_url=weaviate_url,
auth_credentials=weaviate_api_key,
- # highlight-start
- headers={"X-Anthropic-Api-Key": anthropic_api_key},
- # highlight-end
+
)
# Step 2.2: Use this collection
@@ -26,7 +24,9 @@
query="sci-fi",
limit=1,
grouped_task="Write a tweet with emojis about this movie.",
- generative_provider=GenerativeConfig.anthropic(), # Configure the Anthropic generative integration for RAG
+ generative_provider=GenerativeConfig.anthropic(
+ model="claude-3-5-haiku-latest"
+ ), # Configure the Anthropic generative integration for RAG
)
# highlight-end
diff --git a/docs/weaviate/quickstart/local.md b/docs/weaviate/quickstart/local.md
index 377b2972..c6116170 100644
--- a/docs/weaviate/quickstart/local.md
+++ b/docs/weaviate/quickstart/local.md
@@ -131,12 +131,19 @@ volumes:
ollama_data:
```
-Run the following command to start a Weaviate instance and Ollama using Docker:
+Run the following command to start a Weaviate instance and the Ollama server inside Docker containers:
```bash
docker-compose up -d
```
+Now you can pull the required Ollama models in the container:
+
+```bash
+docker compose exec ollama ollama pull nomic-embed-text
+docker compose exec ollama ollama pull llama3
+```
+
---
## Install a client library
diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml
index 9ba8746c..f3d8137e 100644
--- a/tests/docker-compose.yml
+++ b/tests/docker-compose.yml
@@ -30,17 +30,6 @@ services:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
- environment:
- - OLLAMA_HOST=0.0.0.0
- command: >
- sh -c "
- ollama serve &
- PID=$!
- sleep 5
- ollama pull nomic-embed-text
- ollama pull llama3
- wait $PID
- "
volumes:
weaviate_data:
From aceec8d7eebb2bbcc9d5c807400c0328cb036488 Mon Sep 17 00:00:00 2001
From: Ivan Despot <66276597+g-despot@users.noreply.github.com>
Date: Fri, 7 Nov 2025 12:36:03 +0100
Subject: [PATCH 15/16] Update docs
---
.../quickstart.short.query.neartext.go | 2 +-
.../short_3/quickstart.short.query.rag.go | 2 +-
.../quickstart.short.local.query.rag.go | 2 --
...t.local.import_vectors.query.nearvector.go | 2 +-
...rt.short.local.import_vectors.query.rag.go | 2 --
...t.short.import_vectors.query.nearvector.go | 2 +-
...ickstart.short.import_vectors.query.rag.go | 2 +-
.../QuickstartLocalQueryNearVectorRAG.java | 2 --
.../quickstart/QuickstartQueryNearText.java | 2 +-
.../QuickstartQueryNearTextRAG.java | 2 +-
.../quickstart/QuickstartQueryNearVector.java | 2 +-
.../QuickstartQueryNearVectorRAG.java | 2 +-
.../quickstart.short.create_collection.mdx | 4 ++--
...short.import_vectors.create_collection.mdx | 4 ++--
...ickstart.short.local.create_collection.mdx | 4 ++--
...t.short.local.import-vectors.query.rag.mdx | 2 +-
...local.import_vectors.create_collection.mdx | 4 ++--
....local.import_vectors.query.nearvector.mdx | 2 +-
...rt.short.local.import_vectors.query.rag.ts | 9 +------
.../quickstart.short.local.query.rag.ts | 9 +------
docs/weaviate/quickstart/index.md | 12 +++++-----
docs/weaviate/quickstart/local.md | 24 +++++--------------
22 files changed, 33 insertions(+), 65 deletions(-)
diff --git a/_includes/code/howto/go/docs/quickstart/short_2/quickstart.short.query.neartext.go b/_includes/code/howto/go/docs/quickstart/short_2/quickstart.short.query.neartext.go
index 8b7bc73a..0b90c6be 100644
--- a/_includes/code/howto/go/docs/quickstart/short_2/quickstart.short.query.neartext.go
+++ b/_includes/code/howto/go/docs/quickstart/short_2/quickstart.short.query.neartext.go
@@ -28,7 +28,7 @@ func main() {
panic(err)
}
- // Step 2.2 & 2.3: Perform a semantic search with NearText
+ // Step 2.2: Perform a semantic search with NearText
// highlight-start
// END NearText
diff --git a/_includes/code/howto/go/docs/quickstart/short_3/quickstart.short.query.rag.go b/_includes/code/howto/go/docs/quickstart/short_3/quickstart.short.query.rag.go
index 541a9baa..ad409c31 100644
--- a/_includes/code/howto/go/docs/quickstart/short_3/quickstart.short.query.rag.go
+++ b/_includes/code/howto/go/docs/quickstart/short_3/quickstart.short.query.rag.go
@@ -35,7 +35,7 @@ func main() {
}
// highlight-end
- // Step 2.2 & 2.3: Perform RAG with NearText results
+ // Step 2.2: Perform RAG with NearText results
// highlight-start
title := graphql.Field{Name: "title"}
description := graphql.Field{Name: "description"}
diff --git a/_includes/code/howto/go/docs/quickstart/short_local_3/quickstart.short.local.query.rag.go b/_includes/code/howto/go/docs/quickstart/short_local_3/quickstart.short.local.query.rag.go
index a9cbce86..8e3b6885 100644
--- a/_includes/code/howto/go/docs/quickstart/short_local_3/quickstart.short.local.query.rag.go
+++ b/_includes/code/howto/go/docs/quickstart/short_local_3/quickstart.short.local.query.rag.go
@@ -11,7 +11,6 @@ import (
func main() {
// Step 2.1: Connect to your local Weaviate instance
- // highlight-start
cfg := weaviate.Config{
Host: "localhost:8080",
Scheme: "http",
@@ -20,7 +19,6 @@ func main() {
if err != nil {
panic(err)
}
- // highlight-end
// Step 2.2: Perform RAG with NearText results
// highlight-start
diff --git a/_includes/code/howto/go/docs/quickstart/short_local_vectors_2/quickstart.short.local.import_vectors.query.nearvector.go b/_includes/code/howto/go/docs/quickstart/short_local_vectors_2/quickstart.short.local.import_vectors.query.nearvector.go
index 62ec416a..b37c2169 100644
--- a/_includes/code/howto/go/docs/quickstart/short_local_vectors_2/quickstart.short.local.import_vectors.query.nearvector.go
+++ b/_includes/code/howto/go/docs/quickstart/short_local_vectors_2/quickstart.short.local.import_vectors.query.nearvector.go
@@ -21,7 +21,7 @@ func main() {
panic(err)
}
- // Step 2.2 & 2.3: Perform a vector search with NearVector
+ // Step 2.2: Perform a vector search with NearVector
// highlight-start
title := graphql.Field{Name: "title"}
description := graphql.Field{Name: "description"}
diff --git a/_includes/code/howto/go/docs/quickstart/short_local_vectors_3/quickstart.short.local.import_vectors.query.rag.go b/_includes/code/howto/go/docs/quickstart/short_local_vectors_3/quickstart.short.local.import_vectors.query.rag.go
index e0d641f5..1d4d2502 100644
--- a/_includes/code/howto/go/docs/quickstart/short_local_vectors_3/quickstart.short.local.import_vectors.query.rag.go
+++ b/_includes/code/howto/go/docs/quickstart/short_local_vectors_3/quickstart.short.local.import_vectors.query.rag.go
@@ -11,7 +11,6 @@ import (
func main() {
// Step 2.1: Connect to your local Weaviate instance
- // highlight-start
cfg := weaviate.Config{
Host: "localhost:8080",
Scheme: "http",
@@ -20,7 +19,6 @@ func main() {
if err != nil {
panic(err)
}
- // highlight-end
// Step 2.2: Perform RAG with NearText results
// highlight-start
diff --git a/_includes/code/howto/go/docs/quickstart/short_vectors_2/quickstart.short.import_vectors.query.nearvector.go b/_includes/code/howto/go/docs/quickstart/short_vectors_2/quickstart.short.import_vectors.query.nearvector.go
index f5e79957..fae7a466 100644
--- a/_includes/code/howto/go/docs/quickstart/short_vectors_2/quickstart.short.import_vectors.query.nearvector.go
+++ b/_includes/code/howto/go/docs/quickstart/short_vectors_2/quickstart.short.import_vectors.query.nearvector.go
@@ -28,7 +28,7 @@ func main() {
panic(err)
}
- // Step 2.2 & 2.3: Perform a vector search with NearVector
+ // Step 2.2: Perform a vector search with NearVector
// highlight-start
// END NearText
diff --git a/_includes/code/howto/go/docs/quickstart/short_vectors_3/quickstart.short.import_vectors.query.rag.go b/_includes/code/howto/go/docs/quickstart/short_vectors_3/quickstart.short.import_vectors.query.rag.go
index 7bd3c075..43cfdd6d 100644
--- a/_includes/code/howto/go/docs/quickstart/short_vectors_3/quickstart.short.import_vectors.query.rag.go
+++ b/_includes/code/howto/go/docs/quickstart/short_vectors_3/quickstart.short.import_vectors.query.rag.go
@@ -35,7 +35,7 @@ func main() {
}
// highlight-end
- // Step 2.2 & 2.3: Perform RAG with NearText results
+ // Step 2.2: Perform RAG with NearText results
// highlight-start
title := graphql.Field{Name: "title"}
description := graphql.Field{Name: "description"}
diff --git a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearVectorRAG.java b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearVectorRAG.java
index df8e13f1..7788d4b9 100644
--- a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearVectorRAG.java
+++ b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartLocalQueryNearVectorRAG.java
@@ -13,10 +13,8 @@
public class QuickstartLocalQueryNearVectorRAG {
public static void main(String[] args) throws AuthException {
// Step 2.1: Connect to your local Weaviate instance
- // highlight-start
Config config = new Config("http", "localhost:8080");
WeaviateClient client = new WeaviateClient(config);
- // highlight-end
// Step 2.2: Perform RAG with NearVector results
// highlight-start
diff --git a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearText.java b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearText.java
index e0e366e1..1c7624ab 100644
--- a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearText.java
+++ b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearText.java
@@ -20,7 +20,7 @@ public static void main(String[] args) throws AuthException {
Config config = new Config("https", weaviateUrl.replace("https://", ""));
WeaviateClient client = WeaviateAuthClient.apiKey(config, weaviateApiKey);
- // Step 2.2 & 2.3: Perform a semantic search with NearText
+ // Step 2.2: Perform a semantic search with NearText
// highlight-start
// END NearText
diff --git a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearTextRAG.java b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearTextRAG.java
index aec5ca23..e40aea04 100644
--- a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearTextRAG.java
+++ b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearTextRAG.java
@@ -30,7 +30,7 @@ public static void main(String[] args) throws AuthException {
WeaviateClient client = WeaviateAuthClient.apiKey(config, weaviateApiKey);
// highlight-end
- // Step 2.2 & 2.3: Perform RAG with NearVector results
+ // Step 2.2: Perform RAG with NearVector results
// highlight-start
Field title = Field.builder().name("title").build();
Field description = Field.builder().name("description").build();
diff --git a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearVector.java b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearVector.java
index 98f08022..cc5ea2ba 100644
--- a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearVector.java
+++ b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearVector.java
@@ -26,7 +26,7 @@ public static void main(String[] args) throws AuthException {
Config config = new Config("https", weaviateUrl.replace("https://", ""));
WeaviateClient client = WeaviateAuthClient.apiKey(config, weaviateApiKey);
- // Step 2.2 & 2.3: Perform a vector search with NearVector
+ // Step 2.2: Perform a vector search with NearVector
// highlight-start
// END NearText
diff --git a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearVectorRAG.java b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearVectorRAG.java
index d942ee11..07b4c441 100644
--- a/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearVectorRAG.java
+++ b/_includes/code/howto/java/src/test/java/io/weaviate/docs/quickstart/QuickstartQueryNearVectorRAG.java
@@ -31,7 +31,7 @@ public static void main(String[] args) throws AuthException {
WeaviateClient client = WeaviateAuthClient.apiKey(config, weaviateApiKey);
// highlight-end
- // Step 2.2 & 2.3: Perform RAG with NearVector results
+ // Step 2.2: Perform RAG with NearVector results
// highlight-start
Field title = Field.builder().name("title").build();
Field description = Field.builder().name("description").build();
diff --git a/_includes/code/quickstart/quickstart.short.create_collection.mdx b/_includes/code/quickstart/quickstart.short.create_collection.mdx
index f53d7016..82571db9 100644
--- a/_includes/code/quickstart/quickstart.short.create_collection.mdx
+++ b/_includes/code/quickstart/quickstart.short.create_collection.mdx
@@ -28,7 +28,7 @@ import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/w
The collection also contains a configuration for the generative (RAG) integration:
-- OpenAI [generative AI integrations](/weaviate/model-providers/openai/generative) for retrieval augmented generation (RAG).
+- Anthropic [generative AI integrations](/weaviate/model-providers/anthropic/generative) for retrieval augmented generation (RAG).
diff --git a/_includes/code/quickstart/quickstart.short.local.import_vectors.create_collection.mdx b/_includes/code/quickstart/quickstart.short.local.import_vectors.create_collection.mdx
index 5fc4f775..d18ebc5a 100644
--- a/_includes/code/quickstart/quickstart.short.local.import_vectors.create_collection.mdx
+++ b/_includes/code/quickstart/quickstart.short.local.import_vectors.create_collection.mdx
@@ -28,7 +28,7 @@ import JavaCode from "!!raw-loader!/_includes/code/howto/java/src/test/java/io/w
The collection also contains a configuration for the generative (RAG) integration:
-- OpenAI [generative AI integrations](/weaviate/model-providers/openai/generative) for retrieval augmented generation (RAG).
+- Ollama [generative AI integrations](/weaviate/model-providers/ollama/generative) for retrieval augmented generation (RAG).
diff --git a/_includes/code/typescript/quickstart.short.local.import_vectors.query.rag.ts b/_includes/code/typescript/quickstart.short.local.import_vectors.query.rag.ts
index 64764fa5..6537dd7b 100644
--- a/_includes/code/typescript/quickstart.short.local.import_vectors.query.rag.ts
+++ b/_includes/code/typescript/quickstart.short.local.import_vectors.query.rag.ts
@@ -1,15 +1,8 @@
// START RAG
import weaviate, { WeaviateClient, generativeParameters } from 'weaviate-client';
-// Best practice: store your credentials in environment variables
-const anthropicApiKey = process.env.ANTHROPIC_API_KEY!;
-
// Step 2.1: Connect to your local Weaviate instance
-const client: WeaviateClient = await weaviate.connectToLocal(
- // highlight-start
- { headers: { 'X-Anthropic-Api-Key': anthropicApiKey } },
- // highlight-end
-);
+const client: WeaviateClient = await weaviate.connectToLocal();
// Step 2.2: Use this collection
const movies = client.collections.get('Movie');
diff --git a/_includes/code/typescript/quickstart.short.local.query.rag.ts b/_includes/code/typescript/quickstart.short.local.query.rag.ts
index 14523208..f8f89137 100644
--- a/_includes/code/typescript/quickstart.short.local.query.rag.ts
+++ b/_includes/code/typescript/quickstart.short.local.query.rag.ts
@@ -1,15 +1,8 @@
// START RAG
import weaviate, { WeaviateClient, generativeParameters } from 'weaviate-client';
-// Best practice: store your credentials in environment variables
-const anthropicApiKey = process.env.ANTHROPIC_API_KEY!;
-
// Step 2.1: Connect to your local Weaviate instance
-const client: WeaviateClient = await weaviate.connectToLocal(
- // highlight-start
- { headers: { 'X-Anthropic-Api-Key': anthropicApiKey } },
- // highlight-end
-);
+const client: WeaviateClient = await weaviate.connectToLocal();
// Step 2.2: Use this collection
const movies = client.collections.get('Movie');
diff --git a/docs/weaviate/quickstart/index.md b/docs/weaviate/quickstart/index.md
index 45b3f14b..033b9f81 100644
--- a/docs/weaviate/quickstart/index.md
+++ b/docs/weaviate/quickstart/index.md
@@ -55,7 +55,7 @@ There are two paths you can choose from:
This quickstart guide will show you how to:
-1. **Create a collection & import data** - Create a collection and import data into it. The data will be vectorized with the Weaviate Embeddings service. You are also free to use any other available [embedding model provider](../model-providers/index.md).
+1. **Create a collection & import data** - Create a collection and import data into it. The data will be vectorized with the Weaviate Embeddings model provider. You are also free to use any other available [embedding model provider](../model-providers/index.md).
2. **Search** - Perform a similarity (vector) search on your data using a text query.
3. **RAG** - Perform Retrieval Augmented Generation (RAG) with a generative model.
@@ -185,7 +185,7 @@ import CodeClientInstall from "/_includes/code/quickstart/clients.install.new.md
-The following example creates a collection called `Movie` with the [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) service for vectorizing data during import and for querying.
+The following example creates a collection called `Movie` with the [Weaviate Embeddings](/weaviate/model-providers/weaviate/embeddings.md) model provider (`text2vec-weaviate`) for vectorizing data during import and for querying.
import CreateCollection from "/_includes/code/quickstart/quickstart.short.create_collection.mdx";
@@ -194,7 +194,7 @@ import CreateCollection from "/_includes/code/quickstart/quickstart.short.create
-The following example creates a collection called `Movie` and imports pre-computed vectors along with the movie data. We will define the collection properties explicitly, but you can also use the [auto-schema](../config-refs/collections.mdx#auto-schema) feature to infer the data schema automatically.
+The following example creates a collection called `Movie` and imports pre-computed vectors along with the movie data.
import CreateCollectionCustomVectors from "/_includes/code/quickstart/quickstart.short.import_vectors.create_collection.mdx";
@@ -208,7 +208,7 @@ import CreateCollectionCustomVectors from "/_includes/code/quickstart/quickstart
-Semantic search finds results based on meaning. This is called `nearText` in Weaviate. The following example searches for 2 objects (_limit_) whose meaning is most similar to that of `sci-fi`.
+Semantic search finds results based on meaning. This is called `nearText` in Weaviate. The following example searches for 2 objects (_limit_) whose meaning is most similar to that of `sci-fi`.
import QueryNearText from "/_includes/code/quickstart/quickstart.short.query.neartext.mdx";
@@ -262,7 +262,7 @@ For Retrieval Augmented Generation (RAG) in this step, you will need a [Claude A
Retrieval augmented generation (RAG), also called generative search, works by prompting a large language model (LLM) with a combination of a _user query_ and _data retrieved from a database_.
-The following example combines the semantic search for the query `sci-fi` with a prompt to generate a tweet.
+The following example combines the semantic search for the query `sci-fi` with a prompt to generate a tweet using the Anthropic generative model ([`generative-anthropic`](../model-providers/anthropic/generative.md)).
import QueryRAG from "/_includes/code/quickstart/quickstart.short.query.rag.mdx";
@@ -273,7 +273,7 @@ import QueryRAG from "/_includes/code/quickstart/quickstart.short.query.rag.mdx"
Retrieval augmented generation (RAG), also called generative search, works by prompting a large language model (LLM) with a combination of a _user query_ and _data retrieved from a database_.
-The following example combines the vector similarity search with a prompt to generate a tweet.
+The following example combines the vector similarity search with a prompt to generate a tweet using the Anthropic generative model ([`generative-anthropic`](../model-providers/anthropic/generative.md)).
import QueryRAGCustomVectors from "/_includes/code/quickstart/quickstart.short.import-vectors.query.rag.mdx";
diff --git a/docs/weaviate/quickstart/local.md b/docs/weaviate/quickstart/local.md
index c6116170..4299bcaf 100644
--- a/docs/weaviate/quickstart/local.md
+++ b/docs/weaviate/quickstart/local.md
@@ -50,7 +50,7 @@ There are two paths you can choose from:
This quickstart guide will show you how to:
-1. **Create a collection & import data** - Create a collection and import data into it. The data will be vectorized with the Ollama embedding model service. You are also free to use any other available [embedding model provider](../model-providers/index.md).
+1. **Create a collection & import data** - Create a collection and import data into it. The data will be vectorized with the Ollama embedding model provider. You are also free to use any other available [embedding model provider](../model-providers/index.md).
2. **Search** - Perform a similarity (vector) search on your data using a text query.
3. **RAG** - Perform Retrieval Augmented Generation (RAG) with a generative model.
@@ -99,7 +99,6 @@ services:
- weaviate_data:/var/lib/weaviate
restart: on-failure:0
environment:
- QUERY_DEFAULTS_LIMIT: 25
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
ENABLE_MODULES: 'text2vec-ollama,generative-ollama'
@@ -114,17 +113,6 @@ services:
- "11434:11434"
volumes:
- ollama_data:/root/.ollama
- environment:
- - OLLAMA_HOST=0.0.0.0
- command: >
- sh -c "
- ollama serve &
- PID=$!
- sleep 5
- ollama pull nomic-embed-text
- ollama pull llama3
- wait $PID
- "
volumes:
weaviate_data:
@@ -137,11 +125,11 @@ Run the following command to start a Weaviate instance and the Ollama server ins
docker-compose up -d
```
-Now you can pull the required Ollama models in the container:
+Once the Ollama service starts, you can pull the required embedding model ([`nomic-embed-text`](https://ollama.com/library/nomic-embed-text)) and generative model ([`llama3.2`](https://ollama.com/library/llama3.2)) in the `ollama` container:
```bash
docker compose exec ollama ollama pull nomic-embed-text
-docker compose exec ollama ollama pull llama3
+docker compose exec ollama ollama pull llama3.2
```
---
@@ -168,7 +156,7 @@ import CreateCollection from "/_includes/code/quickstart/quickstart.short.local.
-The following example creates a collection called `Movie` and imports pre-computed vectors along with the movie data. We will define the collection properties explicitly, but you can also use the [auto-schema](../config-refs/collections.mdx#auto-schema) feature to infer the data schema automatically.
+The following example creates a collection called `Movie` and imports pre-computed vectors along with the movie data.
import CreateCollectionCustomVectors from "/_includes/code/quickstart/quickstart.short.local.import_vectors.create_collection.mdx";
@@ -232,7 +220,7 @@ Try the [Query Agent](/agents/query/index.md) with a Weaviate Cloud instance. Yo
Retrieval augmented generation (RAG), also called generative search, works by prompting a large language model (LLM) with a combination of a _user query_ and _data retrieved from a database_.
-The following example combines the semantic search for the query `sci-fi` with a prompt to generate a tweet.
+The following example combines the semantic search for the query `sci-fi` with a prompt to generate a tweet using the Ollama generative model (`generative-ollama`).
import QueryRAG from "/_includes/code/quickstart/quickstart.short.local.query.rag.mdx";
@@ -243,7 +231,7 @@ import QueryRAG from "/_includes/code/quickstart/quickstart.short.local.query.ra
Retrieval augmented generation (RAG), also called generative search, works by prompting a large language model (LLM) with a combination of a _user query_ and _data retrieved from a database_.
-The following example combines the vector similarity search with a prompt to generate a tweet.
+The following example combines the vector similarity search with a prompt to generate a tweet using the Ollama generative model (`generative-ollama`).
import QueryRAGCustomVectors from "/_includes/code/quickstart/quickstart.short.local.import-vectors.query.rag.mdx";
From 989c280ca444a4a9d738ff588089045622195799 Mon Sep 17 00:00:00 2001
From: Ivan Despot <66276597+g-despot@users.noreply.github.com>
Date: Fri, 7 Nov 2025 12:49:52 +0100
Subject: [PATCH 16/16] Update docs
---
_includes/quickstart.short.nextsteps.mdx | 47 ++++++++++++++++++++++++
docs/weaviate/quickstart/index.md | 32 +---------------
docs/weaviate/quickstart/local.md | 32 +---------------
tests/docker-compose.yml | 35 ++++++++----------
4 files changed, 67 insertions(+), 79 deletions(-)
create mode 100644 _includes/quickstart.short.nextsteps.mdx
diff --git a/_includes/quickstart.short.nextsteps.mdx b/_includes/quickstart.short.nextsteps.mdx
new file mode 100644
index 00000000..5b62c973
--- /dev/null
+++ b/_includes/quickstart.short.nextsteps.mdx
@@ -0,0 +1,47 @@
+import CardsSection from "/src/components/CardsSection";
+import styles from "/src/components/CardsSection/styles.module.scss";
+
+We recommend you check out the following resources to continue learning about Weaviate.
+
+export const nextStepsCardsData = [
+ {
+ title: "Quick tour of Weaviate",
+ description: (
+ <>
+ Continue with the{" "}
+ Quick tour tutorial â an
+ end-to-end guide that covers important topics like configuring
+ collections, searches, etc.
+ >
+ ),
+ link: "/weaviate/tutorials/quick-tour-of-weaviate",
+ icon: "fas fa-signs-post",
+ },
+ {
+ title: "Weaviate Academy",
+ description: (
+ <>
+ Check out Weaviate Academy â a
+ learning platform centered around AI-native development.
+ >
+ ),
+ link: "https://academy.weaviate.io/",
+ icon: "fa-solid fa-graduation-cap",
+ },
+ {
+ title: "How-to manuals",
+ description:
+ "Quick examples of how to configure, manage and query Weaviate using client libraries.",
+ link: "/weaviate/guides",
+ icon: "fas fa-book-open",
+ },
+ {
+ title: "Starter guides",
+ description: "Guides and tips for new users learning how to use Weaviate.",
+ link: "/weaviate/starter-guides",
+ icon: "fas fa-compass",
+ },
+];
+
+
+
diff --git a/docs/weaviate/quickstart/index.md b/docs/weaviate/quickstart/index.md
index 033b9f81..3d520f03 100644
--- a/docs/weaviate/quickstart/index.md
+++ b/docs/weaviate/quickstart/index.md
@@ -300,37 +300,9 @@ Are you ready to see how deep the rabbit hole goes? ðīðĩ #TheMatrix #WakeUp
## Next steps
-We recommend you check out the following resources to continue learning about Weaviate.
+import NextSteps from "/_includes/quickstart.short.nextsteps.mdx";
-export const nextStepsCardsData = [
- {
- title: "Quick tour of Weaviate",
- description: (
- <>
- Continue with the{" "}
- Quick tour tutorial â an
- end-to-end guide that covers important topics like configuring
- collections, searches, etc.
- >
- ),
- link: "/weaviate/tutorials/quick-tour-of-weaviate",
- icon: "fas fa-signs-post",
- },
- {
- title: "Weaviate Academy",
- description: (
- <>
- Check out Weaviate Academy â a
- learning platform centered around AI-native development.
- >
- ),
- link: "https://academy.weaviate.io/",
- icon: "fa-solid fa-graduation-cap",
- },
-];
-
-
-
+
## Questions and feedback
diff --git a/docs/weaviate/quickstart/local.md b/docs/weaviate/quickstart/local.md
index 4299bcaf..803354a1 100644
--- a/docs/weaviate/quickstart/local.md
+++ b/docs/weaviate/quickstart/local.md
@@ -258,37 +258,9 @@ Are you ready to see how deep the rabbit hole goes? ðīðĩ #TheMatrix #WakeUp
## Next steps
-We recommend you check out the following resources to continue learning about Weaviate.
+import NextSteps from "/_includes/quickstart.short.nextsteps.mdx";
-export const nextStepsCardsData = [
- {
- title: "Quick tour of Weaviate",
- description: (
- <>
- Continue with the{" "}
- Quick tour tutorial â an
- end-to-end guide that covers important topics like configuring
- collections, searches, etc.
- >
- ),
- link: "/weaviate/tutorials/quick-tour-of-weaviate",
- icon: "fas fa-signs-post",
- },
- {
- title: "Weaviate Academy",
- description: (
- <>
- Check out Weaviate Academy â a
- learning platform centered around AI-native development.
- >
- ),
- link: "https://academy.weaviate.io/",
- icon: "fa-solid fa-graduation-cap",
- },
-];
-
-
-
+
## Questions and feedback
diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml
index f3d8137e..714f2228 100644
--- a/tests/docker-compose.yml
+++ b/tests/docker-compose.yml
@@ -1,5 +1,6 @@
+---
services:
- weaviate:
+ weaviate_apikey:
command:
- --host
- 0.0.0.0
@@ -7,30 +8,26 @@ services:
- '8080'
- --scheme
- http
- image: cr.weaviate.io/semitechnologies/weaviate:1.34.0
+ image: cr.weaviate.io/semitechnologies/weaviate:1.34.0-rc.1
ports:
- - 8080:8080
- - 50051:50051
- volumes:
- - weaviate_data:/var/lib/weaviate
+ - 8099:8080
+ - 50052:50051
restart: on-failure:0
environment:
QUERY_DEFAULTS_LIMIT: 25
AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
- ENABLE_MODULES: 'text2vec-ollama,generative-ollama'
+ BACKUP_FILESYSTEM_PATH: '/var/lib/weaviate/backups'
+ ASYNC_INDEXING: 'true'
+ ENABLE_MODULES: 'text2vec-ollama,generative-ollama,backup-filesystem,offload-s3'
CLUSTER_HOSTNAME: 'node1'
- OLLAMA_API_ENDPOINT: 'http://ollama:11434'
- depends_on:
- - ollama
- ollama:
- image: ollama/ollama:0.12.9
- ports:
- - "11434:11434"
- volumes:
- - ollama_data:/root/.ollama
+ # Enables API key authentication.
+ AUTHENTICATION_APIKEY_ENABLED: 'true'
+
+ # List one or more keys, separated by commas. Each key corresponds to a specific user identity below.
+ AUTHENTICATION_APIKEY_ALLOWED_KEYS: 'secr3tk3y'
-volumes:
- weaviate_data:
- ollama_data:
\ No newline at end of file
+ # List one or more user identities, separated by commas. Each identity corresponds to a specific key above.
+ AUTHENTICATION_APIKEY_USERS: 'testuser@weaviate.io'
+...