{
  "name": "vector-upsert",
  "title": "Upsert a vector to a vector DB",
  "category": "AI",
  "tags": [
    "ai",
    "curl-jq"
  ],
  "version": "1.0.2",
  "date": "2026-09-12",
  "notes": "Move to badouralix/curl-jq:ubuntu. The Alpine build this pinned carries two jq advisories on the path this item takes, and its publisher has not rebuilt it since 1 July. The ubuntu tag has neither, and fixable CRITICAL/HIGH drops from 4 to 2. It is Ubuntu 24.04 rather than Alpine, so sh is dash rather than busybox ash, curl goes back from 8.21.0 to 8.5.0 and jq from 1.8.1 to 1.7.1. Still runs as root.",
  "latest": true,
  "installable": true,
  "url": "https://catalog.dagweave.com/api/v1/items/vector-upsert/1.0.2.json",
  "templateUrl": "https://catalog.dagweave.com/api/v1/items/vector-upsert/1.0.2/template.yaml",
  "entrypoint": "upsert",
  "parameters": [
    {
      "name": "endpoint",
      "title": "Endpoint",
      "description": "Full Qdrant collection points URL.",
      "type": "string",
      "required": true,
      "example": "https://my-cluster.qdrant.io:6333/collections/docs/points"
    },
    {
      "name": "id",
      "title": "Point id",
      "description": "Point id (string or UUID).",
      "type": "string",
      "required": true,
      "example": "doc-123"
    },
    {
      "name": "vector-json",
      "title": "Vector (JSON array)",
      "description": "JSON array of floats, the embedding vector.",
      "type": "string",
      "required": true,
      "example": "[0.12, -0.03, 0.98]"
    },
    {
      "name": "api-key-secret-key",
      "title": "API key secret key",
      "description": "Key within the Secret that holds the API key.",
      "type": "string",
      "required": false,
      "default": "api-key"
    },
    {
      "name": "api-key-secret-name",
      "title": "API key secret name",
      "description": "Name of the Kubernetes Secret holding the Qdrant API key.",
      "type": "string",
      "required": false,
      "default": "vector-db-api-key"
    },
    {
      "name": "metadata-json",
      "title": "Metadata (JSON object)",
      "description": "JSON object of point metadata (Qdrant payload).",
      "type": "string",
      "required": false,
      "default": "{}",
      "example": "{\"source\":\"docs\",\"page\":3}"
    }
  ],
  "images": [
    {
      "ref": "badouralix/curl-jq@sha256:38362e9b8ef4bd09a88c0db07941e61e0bf0f7240e9f36a3ff2c31ad75546be2",
      "repository": "badouralix/curl-jq",
      "digest": "sha256:38362e9b8ef4bd09a88c0db07941e61e0bf0f7240e9f36a3ff2c31ad75546be2"
    }
  ],
  "install": {
    "kubectl": "kubectl apply -n argo -f https://catalog.dagweave.com/api/v1/items/vector-upsert/1.0.2/template.yaml",
    "argo": "argo template create -n argo https://catalog.dagweave.com/api/v1/items/vector-upsert/1.0.2/template.yaml"
  },
  "template": "apiVersion: argoproj.io/v1alpha1\nkind: WorkflowTemplate\nmetadata:\n  name: vector-upsert\n  labels:\n    dagweave.io/catalog-item: vector-upsert\n  annotations:\n    # The catalog semver this manifest was authored at. The dagweave app records\n    # (catalog-item-id, semver) -\u003e content-hash -\u003e base-vN when it mints the tenant\n    # cluster name via ResolveOrMint. Keep in sync with metadata.yaml `version`.\n    dagweave.io/catalog-version: \"1.0.2\"\n    dagweave.io/catalog-category: \"AI\"\nspec:\n  entrypoint: upsert\n  templates:\n    - name: upsert\n      inputs:\n        parameters:\n          # Full Qdrant collection points URL, e.g.\n          # https://\u003chost\u003e:6333/collections/\u003ccollection\u003e/points.\n          - name: endpoint\n          # Point id (string or UUID).\n          - name: id\n          # JSON array of floats — the embedding vector.\n          - name: vector-json\n          # JSON object of point metadata (Qdrant payload). Defaults to empty object.\n          - name: metadata-json\n            default: \"{}\"\n          # Name/key of a Kubernetes Secret holding the Qdrant API key (sent as the\n          # `api-key` header).\n          - name: api-key-secret-name\n            default: vector-db-api-key\n          - name: api-key-secret-key\n            default: api-key\n      container:\n        # Pinned by digest per the catalog convention: an image rebuild can never\n        # silently change the behaviour of an already-released item version.\n        # badouralix/curl-jq:ubuntu — provides sh, curl and jq.\n        image: badouralix/curl-jq@sha256:38362e9b8ef4bd09a88c0db07941e61e0bf0f7240e9f36a3ff2c31ad75546be2\n        command: [sh, -c]\n        # Values are passed as env vars (below), never interpolated into the shell.\n        # jq assembles the Qdrant upsert body {points:[{id, vector, payload}]} with\n        # --arg / --argjson so the vector and metadata JSON are embedded verbatim and\n        # the id is escaped correctly. Qdrant authenticates via the `api-key` header.\n        args:\n          - |\n            set -eu\n            BODY=$(jq -cn \\\n              --arg id \"${POINT_ID}\" \\\n              --argjson vec \"${VECTOR}\" \\\n              --argjson payload \"${METADATA}\" \\\n              '{points: [{id: $id, vector: $vec, payload: $payload}]}')\n            curl -sSf -X PUT \"${ENDPOINT}\" \\\n              -H \"Content-Type: application/json\" \\\n              -H \"api-key: ${API_KEY}\" \\\n              --data-raw \"${BODY}\"\n        env:\n          - name: ENDPOINT\n            value: \"{{inputs.parameters.endpoint}}\"\n          - name: POINT_ID\n            value: \"{{inputs.parameters.id}}\"\n          - name: VECTOR\n            value: \"{{inputs.parameters.vector-json}}\"\n          - name: METADATA\n            value: \"{{inputs.parameters.metadata-json}}\"\n          - name: API_KEY\n            valueFrom:\n              secretKeyRef:\n                name: \"{{inputs.parameters.api-key-secret-name}}\"\n                key: \"{{inputs.parameters.api-key-secret-key}}\"\n",
  "templateSha256": "c866b2f6c0ac7047bc8d95f5c84fac0cceda7ca0653c2960fe39b580c4c7fe31",
  "source": "https://github.com/dagweave/catalog/tree/67458f74dbbf913b03177f3cefc69424be85eb1d/catalog/vector-upsert",
  "catalogSha": "67458f74dbbf913b03177f3cefc69424be85eb1d"
}
