Notebooks
W
Weaviate
Multi Tenant Academy Course

Multi Tenant Academy Course

vector-searchvector-databaseretrieval-augmented-generationllm-frameworksweaviate-featuresfunction-callingweaviate-recipesPythongenerative-aimulti-tenancy

Open In Colab

Multi-tenant operations

This notebook walks through the Weaviate Academy Multi-tenancy course.

Edit the docker-compose configuration

  1. Create a .env file in the directory where you run docker compose up -d.
  2. Add your AWS credentials to the .env file.
  3. Add variables for the credentials to docker-compose.yml
.env file
AWS_ACCESS_KEY=ENTER-YOUR-AWS-KEY-HERE
AWS_ACCESS_SECRET_KEY=ENTER-YOUR-AWS-SECRET-KEY-HERE
AWS_REGION=YOUR-AWS-REGION-CODE-HERE

To confirm the variable substitution, run docker compose config.

Start your Weaviate instance, docker compose up -d.

docker-config.yml
---
name: "multi_tenant_demo_instance"
services:
  weaviate_anon:
    command:
    - --host
    - 0.0.0.0
    - --port
    - '8080'
    - --scheme
    - http
    image: cr.weaviate.io/semitechnologies/weaviate:1.26.3 # Update if needed
    ports:
    - 8080:8080
    - 50051:50051
    restart: on-failure:0
    environment:
      QUERY_DEFAULTS_LIMIT: 25
      AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
      PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
      DEFAULT_VECTORIZER_MODULE: 'none'
      ENABLE_API_BASED_MODULES: 'true'
      ASYNC_INDEXING: 'true'
      ENABLE_MODULES: 'backup-filesystem,offload-s3'
      AWS_REGION: ${AWS_REGION}
      AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY}
      AWS_SECRET_ACCESS_KEY: ${AWS_ACCESS_SECRET_KEY}
      OFFLOAD_S3_BUCKET: 'PUT_YOUR_S3_BUCKET_NAME_HERE'
      OFFLOAD_S3_BUCKET_AUTO_CREATE: 'true'
      BACKUP_FILESYSTEM_PATH: '/var/lib/weaviate/backups'
      CLUSTER_HOSTNAME: 'node1'
...

Install the Weaviate Python v4 client

[ ]

Create a client object

[ ]

Create a collection

[140]

Confirm that the collection exists

[ ]

Get collection object

[143]

Create a tenant

[142]

Add data to one tenant

[144]

Batch import data to a single tenant

[145]

Check the number of objects

[ ]

Automatically create a tenant

[127]

Run a query

[ ]

Run a hybrid query

[ ]

Check tenant status

[ ]

Deactivate a tenant

[ ]

Remove a tenant

[ ]

Move a tenant to S3

[ ]