Blueprints

Extract data from a CSV file, load it in batch to Weaviate and query it with GraphQL

About this blueprint

AI API Ingest

This flow shows how to extract data from a CSV file using the HTTP API, load it to a Weaviate cluster and query it with GraphQL.

This flow assumes that you have a Weaviate cluster running, and that you created an API key. Make sure to replace the url and apiKey values in the tasks with your Weaviate credentials. It's recommended to use Secrets to store your API key.

Once you've configured the Weaviate secret, you can reproduce this flow without any changes. It will load the data from the Kaggle Jeopardy dataset to Weaviate, and then query it with GraphQL.

yaml
id: weaviate_csv
namespace: company.team

variables:
  host: https://demo-ito81rf6.weaviate.network
  secret: YOUR_WEAVIATE_API_KEY # in production, use a Secret instead e.g. "{{ secret('WEAVIATE_API_KEY') }}"

tasks:
  - id: csv
    type: io.kestra.plugin.core.http.Download
    uri: https://huggingface.co/datasets/kestra/datasets/raw/main/csv/trivia_questions.csv

  - id: csv_to_ion
    type: io.kestra.plugin.serdes.csv.CsvToIon
    from: "{{ outputs.csv.uri }}"

  - id: batch_load
    type: io.kestra.plugin.weaviate.BatchCreate
    url: "{{ vars.host }}"
    apiKey: "{{ vars.secret }}"
    className: QuestionsCsv
    objects: "{{ outputs.csv_to_ion.uri }}"

  - id: query
    type: io.kestra.plugin.weaviate.Query
    url: "{{ vars.host }}"
    apiKey: "{{ vars.secret }}"
    query: | 
      {
        Get {
          QuestionsCsv(limit: 10) {
            answer
            category
            question
          }
        }
      }

Download

Csv To Ion

Batch Create

Query

More Related Blueprints

New to Kestra?

Use blueprints to kickstart your first workflows.

Get started with Kestra