Skip to main content

Migration Guide for Embeddings

To maintain backward compatibility with existing integrations:

  1. Explicitly specify v1 version in your requests:

    {
    "version": "context.api/v1",
    "objectKeys": ["path/to/document.pdf"],
    "actions": ["text-embeddings"]
    }
  2. Update code to handle flat format when migrating to v2:

    // v1 code
    const embedding = response.textEmbeddings.result[0]; // Get first array

    // v2 code
    const embedding = response.textEmbeddings.result; // Direct access
  3. Test thoroughly before switching to v2 to ensure compatibility with your embedding storage and similarity search systems.

For detailed information on migrating your Context API integration from v1 to v2, see Migration Guide: v1 to v2