> ## Documentation Index
> Fetch the complete documentation index at: https://actianvectorai-docs-feedback-implementation.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure Euclidean distance

> Create a collection that measures straight-line distance between vectors.

Euclidean distance measures straight-line distance between points. It is well suited for image embeddings and spatial data where the absolute distance between vectors represents meaningful differences.

<Note>
  Before you begin, make sure you have a running VectorAI DB instance. The SDK references this metric as `Distance.Euclid`.
</Note>

This example creates a collection named `image_embeddings` configured to use Euclidean distance.

<CodeGroup>
  ```python Python theme={null}
  from actian_vectorai import VectorAIClient, VectorParams, Distance

  # Connect to VectorAI DB server
  with VectorAIClient("localhost:6574") as client:
      # Create collection with Euclidean distance
      client.collections.create(
          "image_embeddings",  # Collection name
          vectors_config=VectorParams(size=128, distance=Distance.Euclid)  # Euclidean metric
      )
  ```

  ```javascript JavaScript theme={null}
  import { VectorAIClient } from '@actian/vectorai-client';

  async function main() {
      // Connect to VectorAI DB server
      const client = new VectorAIClient('localhost:6574');

      // Create collection with Euclidean distance
      await client.collections.create('image_embeddings', {
          dimension: 128,
          distanceMetric: 'EUCLIDEAN'
      });
  }

  main().catch(console.error);
  ```
</CodeGroup>

To confirm the collection was created successfully, call `client.collections.get_info("image_embeddings")` and check that the `status` field returns `Ready`.
