> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vectoraidb.actian.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure dot product

> Create a collection that measures alignment and magnitude efficiently.

Dot product measures both alignment and magnitude. For pre-normalized embeddings, it produces the same results as cosine similarity with better computational performance. Check your embedding model's documentation to confirm whether its output vectors are normalized before choosing this metric.

The following example creates a collection named `normalized_embeddings` configured to use dot product as its distance metric.

<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 dot product
      client.collections.create(
          "normalized_embeddings",  # Collection name
          vectors_config=VectorParams(size=128, distance=Distance.Dot)  # Dot product 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 dot product
      await client.collections.create('normalized_embeddings', {
          dimension: 128,
          distanceMetric: 'DOT'
      });
  }

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

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