# Qdrant

> Store embeddings in Qdrant and search them: manage collections, upsert points with payloads, filter, and run vector and recommendation searches.

App · Databases · 20 actions. Web page: https://docs.lodol.com/docs/integrations/qdrant

## Actions

### Clear payload

Remove the entire payload of the selected points, keeping their vectors. Select the points by id or by filter.

**Inputs**

- Collection (`collection`, text, required): The collection to work in.
- Point IDs (`ids`, list): The ids of the points to act on, each a whole number or a UUID. Leave this empty to select points with a Filter instead.
- Filter (`filter`, object): A Qdrant filter over the points' payloads, for example {"must": [{"key": "category", "match": {"value": "kitchen"}}]}. Every payload key a filter names must have a payload index - run 'Create payload index' on it once first.

**Outputs**

- `collection` (text)
- `operation_id` (number)
- `point_ids` (list)
- `status` (text)

**Example output**

```json
{
  "collection": "product-descriptions",
  "operation_id": 42,
  "point_ids": [
    1
  ],
  "status": "completed"
}
```

### Collection exists

Check whether a collection exists. Answers true or false rather than failing, so a workflow can branch on it before creating or writing.

**Inputs**

- Collection (`collection`, text, required): The collection name to check for.

**Outputs**

- `collection` (text)
- `exists` (true/false)

**Example output**

```json
{
  "collection": "product-descriptions",
  "exists": true
}
```

### Count points

Count the points in a collection, or just the ones matching a filter.

**Inputs**

- Collection (`collection`, text, required): The collection to work in.
- Filter (`filter`, object): A Qdrant filter over the points' payloads, for example {"must": [{"key": "category", "match": {"value": "kitchen"}}]}. Every payload key a filter names must have a payload index - run 'Create payload index' on it once first.
- Exact count (`exact`, true/false): On by default. Turn it off for a fast estimate on a very large collection. Default: `true`.

**Outputs**

- `collection` (text)
- `count` (number)
- `exact` (true/false)

**Example output**

```json
{
  "collection": "product-descriptions",
  "count": 128,
  "exact": true
}
```

### Create alias

Point an alias at a collection. Steps that name the alias follow it, so rebuilding a collection under a new name and re-pointing the alias swaps them over with no downtime. An alias that already points elsewhere is re-pointed.

**Inputs**

- Collection (`collection`, text, required): The collection to work in.
- Alias (`alias_name`, text, required): The alias name, for example 'products-live'.

**Outputs**

- `alias_name` (text)
- `collection` (text)
- `created` (true/false)

**Example output**

```json
{
  "alias_name": "products-live",
  "collection": "product-descriptions",
  "created": true
}
```

### Create collection

Create a collection to hold vectors. Vector size must match the embedding model you will store (for example 1536 for OpenAI text-embedding-3-small, 384 for all-MiniLM-L6-v2), and cannot be changed afterwards.

**Inputs**

- Collection (`collection`, text, required): Name for the new collection (for example 'product-descriptions'). Creating a collection that already exists fails - use 'Collection exists' first if you are not sure.
- Vector size (`vector_size`, number, required): How many numbers each vector has - the dimension of your embedding model. From 1 to 65536. Default: `1`.
- Distance (`distance`, text, required): How similarity between two vectors is measured. Cosine is the usual choice for text embeddings. One of: `Cosine` (Cosine - the usual choice for text embeddings), `Dot` (Dot product - for embeddings that are already normalised), `Euclid` (Euclidean - straight-line distance), `Manhattan` (Manhattan - sum of the per-axis distances). Default: `Cosine`.
- Vector name (`vector_name`, text): Leave blank for an ordinary collection. Set a name only if each point will hold several different vectors - every later step then has to name which one it means.
- Stored as (`datatype`, text): How each number is stored. float32 is full precision and the default; the smaller types trade a little accuracy for memory. One of: `float32` (float32 - full precision, the default), `float16` (float16 - half the memory, slightly less precise), `uint8` (uint8 - a quarter of the memory, for quantised vectors).
- Keep vectors on disk (`on_disk`, true/false): Store vectors on disk instead of in memory. Slower to search, but lets a small cluster hold more. Default: `false`.

**Outputs**

- `collection` (text)
- `created` (true/false)
- `distance` (text)
- `vector_name` (text)
- `vector_size` (number)

**Example output**

```json
{
  "collection": "product-descriptions",
  "created": true,
  "distance": "Cosine",
  "vector_name": null,
  "vector_size": 384
}
```

### Create payload index

Index a payload key so points can be filtered and ordered by it. Qdrant Cloud refuses filters on unindexed keys, so run this once for every key your filters use.

**Inputs**

- Collection (`collection`, text, required): The collection to work in.
- Payload key (`field_name`, text, required): The payload key to index, for example 'category'. A key inside a nested object is written with dots, like 'meta.author'.
- Value type (`field_schema`, text, required): What kind of values this payload key holds. One of: `keyword` (Keyword - exact matches on a string), `integer` (Integer - whole numbers, and ranges over them), `float` (Float - decimal numbers, and ranges over them), `bool` (Boolean - true/false), `datetime` (Datetime - timestamps, and ranges over them), `text` (Text - full-text search inside a string), `uuid` (UUID - exact matches on a UUID string), `geo` (Geo - latitude/longitude, for radius and box filters). Default: `keyword`.

**Outputs**

- `collection` (text)
- `field_name` (text)
- `field_schema` (text)
- `operation_id` (number)
- `status` (text)

**Example output**

```json
{
  "collection": "product-descriptions",
  "field_name": "category",
  "field_schema": "keyword",
  "operation_id": 42,
  "status": "completed"
}
```

### Delete alias

Remove an alias. The collection it pointed at is untouched.

**Inputs**

- Alias (`alias_name`, text, required): The alias name, for example 'products-live'.

**Outputs**

- `alias_name` (text)
- `deleted` (true/false)

**Example output**

```json
{
  "alias_name": "products-live",
  "deleted": true
}
```

### Delete collection

Delete a collection with every point in it, and every alias pointing at it. This cannot be undone.

**Inputs**

- Collection (`collection`, text, required): The collection to work in.

**Outputs**

- `collection` (text)
- `deleted` (true/false)

**Example output**

```json
{
  "collection": "product-descriptions",
  "deleted": true
}
```

### Delete payload index

Drop the index on a payload key. The payload itself is left alone, but filters on that key stop working.

**Inputs**

- Collection (`collection`, text, required): The collection to work in.
- Payload key (`field_name`, text, required): The payload key to index, for example 'category'. A key inside a nested object is written with dots, like 'meta.author'.

**Outputs**

- `collection` (text)
- `field_name` (text)
- `operation_id` (number)
- `status` (text)

**Example output**

```json
{
  "collection": "product-descriptions",
  "field_name": "category",
  "operation_id": 42,
  "status": "completed"
}
```

### Delete payload keys

Remove named keys from the payload of the selected points, keeping the rest of the payload and the vectors.

**Inputs**

- Collection (`collection`, text, required): The collection to work in.
- Payload keys (`keys`, list, required): The payload keys to remove from each point.
- Point IDs (`ids`, list): The ids of the points to act on, each a whole number or a UUID. Leave this empty to select points with a Filter instead.
- Filter (`filter`, object): A Qdrant filter over the points' payloads, for example {"must": [{"key": "category", "match": {"value": "kitchen"}}]}. Every payload key a filter names must have a payload index - run 'Create payload index' on it once first.

**Outputs**

- `collection` (text)
- `keys` (list)
- `operation_id` (number)
- `point_ids` (list)
- `status` (text)

**Example output**

```json
{
  "collection": "product-descriptions",
  "keys": [
    "in_stock"
  ],
  "operation_id": 42,
  "point_ids": [
    1
  ],
  "status": "completed"
}
```

### Delete points

Delete points from a collection, either by id or by filter. Give one or the other, not both.

**Inputs**

- Collection (`collection`, text, required): The collection to work in.
- Point IDs (`ids`, list): The ids of the points to act on, each a whole number or a UUID. Leave this empty to select points with a Filter instead.
- Filter (`filter`, object): A Qdrant filter over the points' payloads, for example {"must": [{"key": "category", "match": {"value": "kitchen"}}]}. Every payload key a filter names must have a payload index - run 'Create payload index' on it once first.

**Outputs**

- `collection` (text)
- `count` (number)
- `operation_id` (number)
- `point_ids` (list)
- `status` (text)

**Example output**

```json
{
  "collection": "product-descriptions",
  "count": 1,
  "operation_id": 42,
  "point_ids": [
    1
  ],
  "status": "completed"
}
```

### Get collection

Read one collection's status, how many points it holds, its vector configuration, and which payload keys are indexed (the keys a filter is allowed to use).

**Inputs**

- Collection (`collection`, text, required): The collection to work in.

**Outputs**

- `collection` (text)
- `config` (object)
- `indexed_fields` (list)
- `indexed_vectors_count` (number)
- `info` (object)
- `payload_schema` (object)
- `points_count` (number)
- `segments_count` (number)
- `status` (text)

**Example output**

```json
{
  "collection": "product-descriptions",
  "config": {
    "params": {
      "vectors": {
        "distance": "Cosine",
        "size": 384
      }
    }
  },
  "indexed_fields": [
    "category"
  ],
  "indexed_vectors_count": 128,
  "info": {
    "status": "green"
  },
  "payload_schema": {
    "category": {
      "data_type": "keyword",
      "points": 128
    }
  },
  "points_count": 128,
  "segments_count": 2,
  "status": "green"
}
```

### Get points

Fetch points by id. Ids the collection does not hold come back under 'missing_ids' rather than failing the step.

**Inputs**

- Collection (`collection`, text, required): The collection to work in.
- Point IDs (`ids`, list, required): The ids of the points to act on. Each id is a whole number or a UUID - Qdrant accepts nothing else.
- Include payload (`with_payload`, true/false): Return each point's stored payload alongside it. Default: `true`.
- Include vectors (`with_vector`, true/false): Return each point's vector as well. Off by default: vectors are large and a workflow rarely reads them back. Default: `false`.

**Outputs**

- `collection` (text)
- `count` (number)
- `ids` (list)
- `missing_ids` (list)
- `points` (list)

**Example output**

```json
{
  "collection": "product-descriptions",
  "count": 1,
  "ids": [
    1
  ],
  "missing_ids": [],
  "points": [
    {
      "id": 1,
      "payload": {
        "category": "kitchen"
      },
      "vector": null
    }
  ]
}
```

### List aliases

List the aliases pointing at one collection.

**Inputs**

- Collection (`collection`, text, required): The collection to work in.

**Outputs**

- `alias_names` (list)
- `aliases` (list)
- `collection` (text)
- `count` (number)

**Example output**

```json
{
  "alias_names": [
    "products-live"
  ],
  "aliases": [
    {
      "alias_name": "products-live",
      "collection_name": "product-descriptions"
    }
  ],
  "collection": "product-descriptions",
  "count": 1
}
```

### List collections

List every collection on the Qdrant cluster. Qdrant reports only their names here; use 'Get collection' for the size and configuration of one.

**Inputs**: None.

**Outputs**

- `collections` (list)
- `count` (number)
- `names` (list)

**Example output**

```json
{
  "collections": [
    {
      "name": "product-descriptions"
    },
    {
      "name": "faqs"
    }
  ],
  "count": 2,
  "names": [
    "faqs",
    "product-descriptions"
  ]
}
```

### Query points

Search a collection: for the points nearest a vector, nearest a point already stored, or most like a set of examples. Fill in one of the three - leaving all three blank returns points matching the filter in the collection's own order.

**Inputs**

- Collection (`collection`, text, required): The collection to work in.
- Search vector (`query_vector`, list): The vector to find neighbours of - usually the embedding of the text being searched for. As wide as the collection was created.
- Search near point (`query_point_id`, text): Instead of a vector: the id of a point already in the collection, to find the points most like it.
- More like these (`recommend_positive`, list): Instead of a vector: point ids (or vectors) the results should resemble.
- Less like these (`recommend_negative`, list): Point ids (or vectors) the results should avoid resembling. Only used with 'More like these'.
- Recommendation style (`recommend_strategy`, text): How the examples are combined. Only used with 'More like these'. One of: `average_vector` (Average vector - the classic recommendation), `best_score` (Best score - favours points close to any one example), `sum_scores` (Sum of scores - favours points close to several examples).
- Vector name (`using`, text): Only for a collection created with named vectors: which vector to search.
- Filter (`filter`, object): A Qdrant filter over the points' payloads, for example {"must": [{"key": "category", "match": {"value": "kitchen"}}]}. Every payload key a filter names must have a payload index - run 'Create payload index' on it once first.
- How many results (`limit`, number): How many matches to return. From 1 to 10000. Default: `10`.
- Minimum score (`score_threshold`, number): Optional. Drop matches scoring below this. What counts as a good score depends on the collection's distance metric.
- Include payload (`with_payload`, true/false): Return each point's stored payload alongside it. Default: `true`.
- Include vectors (`with_vector`, true/false): Return each point's vector as well. Off by default: vectors are large and a workflow rarely reads them back. Default: `false`.

**Outputs**

- `collection` (text)
- `count` (number)
- `ids` (list)
- `points` (list)
- `top_point` (object)
- `top_score` (number)

**Example output**

```json
{
  "collection": "product-descriptions",
  "count": 1,
  "ids": [
    1
  ],
  "points": [
    {
      "id": 1,
      "payload": {
        "category": "kitchen"
      },
      "score": 0.87,
      "version": 3
    }
  ],
  "top_point": {
    "id": 1,
    "score": 0.87
  },
  "top_score": 0.87
}
```

### Scroll points

Page through a collection's points without searching. Feed 'next_page_offset' from one run into 'Start after' on the next to get the following page.

**Inputs**

- Collection (`collection`, text, required): The collection to work in.
- How many (`limit`, number): How many points to return in this page. From 1 to 10000. Default: `50`.
- Start after (`offset`, text): The 'next_page_offset' from the previous run. Leave blank for the first page.
- Filter (`filter`, object): A Qdrant filter over the points' payloads, for example {"must": [{"key": "category", "match": {"value": "kitchen"}}]}. Every payload key a filter names must have a payload index - run 'Create payload index' on it once first.
- Include payload (`with_payload`, true/false): Return each point's stored payload alongside it. Default: `true`.
- Include vectors (`with_vector`, true/false): Return each point's vector as well. Off by default: vectors are large and a workflow rarely reads them back. Default: `false`.
- Order by payload key (`order_by_key`, text): Optional. Return the points in the order of this payload key. The key needs a payload index.
- Order (`order_by_direction`, text): Which way round to order. Only used with a key. One of: `asc` (Ascending - smallest first), `desc` (Descending - largest first).

**Outputs**

- `collection` (text)
- `count` (number)
- `has_more` (true/false)
- `ids` (list)
- `next_page_offset`
- `points` (list)

**Example output**

```json
{
  "collection": "product-descriptions",
  "count": 1,
  "has_more": true,
  "ids": [
    1
  ],
  "next_page_offset": 2,
  "points": [
    {
      "id": 1,
      "payload": {
        "category": "kitchen"
      }
    }
  ]
}
```

### Set payload

Merge keys into the payload of the selected points. Keys you do not name are left as they are. Select the points by id or by filter, not both.

**Inputs**

- Collection (`collection`, text, required): The collection to work in.
- Payload (`payload`, object, required): The keys and values to set, for example category: 'kitchen', in_stock: true.
- Point IDs (`ids`, list): The ids of the points to act on, each a whole number or a UUID. Leave this empty to select points with a Filter instead.
- Filter (`filter`, object): A Qdrant filter over the points' payloads, for example {"must": [{"key": "category", "match": {"value": "kitchen"}}]}. Every payload key a filter names must have a payload index - run 'Create payload index' on it once first.
- Nest under key (`key`, text): Optional. Set these values inside an existing payload key instead of at the top level.

**Outputs**

- `collection` (text)
- `keys` (list)
- `operation_id` (number)
- `point_ids` (list)
- `status` (text)

**Example output**

```json
{
  "collection": "product-descriptions",
  "keys": [
    "category"
  ],
  "operation_id": 42,
  "point_ids": [
    1
  ],
  "status": "completed"
}
```

### Update vectors

Replace the vectors of points that already exist, leaving their payloads untouched. Unlike 'Upsert points' this never creates a point.

**Inputs**

- Collection (`collection`, text, required): The collection to work in.
- Points (`points`, list, required): The points to re-embed, each {"id": ..., "vector": [...]}. Payloads are left as they are.

**Outputs**

- `collection` (text)
- `count` (number)
- `operation_id` (number)
- `point_ids` (list)
- `status` (text)

**Example output**

```json
{
  "collection": "product-descriptions",
  "count": 1,
  "operation_id": 42,
  "point_ids": [
    1
  ],
  "status": "completed"
}
```

### Upsert points

Add points to a collection, or overwrite points that are already there. Each point is an id (a whole number or a UUID), a vector, and an optional payload of anything you want to store or filter on.

**Inputs**

- Collection (`collection`, text, required): The collection to work in.
- Points (`points`, list, required): The points to write, each {"id": ..., "vector": [...], "payload": {...}}. The vector is a list of numbers, as wide as the collection was created; for a collection with named vectors, send an object like {"embedding": [...]} instead.
- When a point already exists (`update_mode`, text): Leave blank to overwrite existing points, which is Qdrant's default. Needs Qdrant 1.19 or newer. One of: `upsert` (Upsert - insert new points and overwrite existing ones), `insert_only` (Insert only - leave a point that already exists alone), `update_only` (Update only - change existing points, insert nothing).

**Outputs**

- `collection` (text)
- `count` (number)
- `operation_id` (number)
- `point_ids` (list)
- `status` (text)

**Example output**

```json
{
  "collection": "product-descriptions",
  "count": 1,
  "operation_id": 42,
  "point_ids": [
    1
  ],
  "status": "completed"
}
```
