📦Weaviate

Weaviate

In case of weaviate you would have to install weaviate with docker-compose and then use that component in the GenAI Stack.

Compulsory Arguments:

  • class_name => The name of the index under which documents are stored

  • fields:

    • url => Url of the weaviate node

    • text_key => The column against which to do the vector embedding search

    • auth_config: (Optional)

      • api_key => api_key of the weaviate cluster if you are using weaviate cloud .

Prerequisites:

Here the docker-compose configurations:

  • This is a sample docker-compose file

version: '3.4'
services:
  weaviate:
    image: semitechnologies/weaviate:1.20.5
    restart: on-failure:0
    ports:
     - "8080:8080"
    environment:
      QUERY_DEFAULTS_LIMIT: 20
      AUTHENTICATION_ANONYMOUS_ACCESS_ENABLED: 'true'
      PERSISTENCE_DATA_PATH: '/var/lib/weaviate'
      DEFAULT_VECTORIZER_MODULE: text2vec-transformers
      ENABLE_MODULES: text2vec-transformers
      TRANSFORMERS_INFERENCE_API: http://t2v-transformers:8080
      CLUSTER_HOSTNAME: 'node1'
    volumes:
      - weaviate_data:/var/lib/weaviate
  t2v-transformers:
    image: semitechnologies/transformers-inference:sentence-transformers-multi-qa-MiniLM-L6-cos-v1
    environment:
      ENABLE_CUDA: 0
volumes:
  weaviate_data:

This docker compose file uses sentence transformers for embedding for more embeddings and other options refer this doc.

GenAI Stack Configurations for Weaviate:

=> Sample vectordb configuration for weaviate

"vectordb": {
    "name": "weaviate",
    "class_name": "LegalDocs",
    "fields": {
        "url": "http://localhost:9999/",
        "text_key": "clause_text"
    }
}

Note: Weaviate expects class_name in PascalCase otherwise it might lead to weird index not found errors.

Last updated