Qdrant memory

From bidewio/better-openclaw · View interactive version

Qdrant memory is an AI agent skill from the GitHub repository bidewio/better-openclaw. Store, search, and manage vector embeddings for semantic memory and similarity search via the Qdrant instance at {{QDRANT_HOST}}:{{QDRANT_PORT}}.

How to use this skill

Skill file

Qdrant Memory Skill

Qdrant vector database is available at http://{{QDRANT_HOST}}:{{QDRANT_PORT}} within the Docker network.

Creating a Collection

Before storing vectors, create a collection with the desired vector dimensions:

curl -X PUT "http://{{QDRANT_HOST}}:{{QDRANT_PORT}}/collections/openclaw_memory" \
  -H "Content-Type: application/json" \
  -d '{
    "vectors": {
      "size": 1536,
      "distance": "Cosine"
    },
    "optimizers_config": {
      "default_segment_number": 2
    }
  }'

Upserting Points

Store vectors with associated metadata payloads:

curl -X PUT "http://{{QDRANT_HOST}}:{{QDRANT_PORT}}/collections/openclaw_memory/points" \
  -H "Content-Type: application/json" \
  -d '{
    "points": [
      {
        "id": 1,
        "vector": [0.05, 0.61, 0.76, ...],
        "payload": {
          "source": "document.pdf",
          "text": "The quick brown fox jumps over the lazy dog.",
          "created_at": "2025-01-15T10:30:00Z",
          "tags": ["example", "test"]
        }
      }
    ]
  }'

Searching for Similar Vectors

Perform semantic similarity search with optional payload filters:

curl -X POST "http://{{QDRANT_HOST}}:{{QDRANT_PORT}}/collections/openclaw_memory/points/search" \
  -H "Content-Type: application/json" \
  -d '{
    "vector": [0.2, 0.1, 0.9, ...],
    "limit": 5,
    "with_payload": true,
    "filter": {
      "must": [
        { "key": "tags", "match": { "value": "example" } }
      ]
    }
  }'

Scrolling Through Points

Retrieve points in bulk with pagination:

curl -X POST "http://{{QDRANT_HOST}}:{{QDRANT_PORT}}/collections/openclaw_memory/points/scroll" \
  -H "Content-Type: application/json" \
  -d '{
    "limit": 100,
    "with_payload": true,
    "with_vector": false
  }'

Deleting Points

Remove specific points by ID or filter:

curl -X POST "http://{{QDRANT_HOST}}:{{QDRANT_PORT}}/collections/openclaw_memory/points/delete" \
  -H "Content-Type: application/json" \
  -d '{
    "filter": {
      "must": [
        { "key": "source", "match": { "value": "old_document.pdf" } }
      ]
    }
  }'

Listing Collections

curl "http://{{QDRANT_HOST}}:{{QDRANT_PORT}}/collections"

Collection Patterns

Tips for AI Agents

```bash

curl -X PUT "http://{{QDRANT_HOST}}:{{QDRANT_PORT}}/collections/openclaw_memory/index" \

-H "Content-Type: application/json" \

-d '{ "field_name": "tags", "field_schema": "keyword" }'

```

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.