Document: Embeddings Retry Generate v1

Document embeddings generation may fail due to various reasons such as OpenAI API rate limits, invalid API keys, document parsing errors, special characters, corrupted or locked PDFs, and excessively large documents. If the issue is related to the API key, it needs to be corrected; before retrying, ensure that the document is accessible and can be parsed correctly.

You need to regenerate document embeddings in a memory before you can use them. The retry document API endpoint allows you to retry generating document embeddings in a memory on Langbase with API. This endpoint requires a User or Org API key.


Generate a User/Org API key

You will need to generate an API key to authenticate your requests. For more information, visit the User/Org API key documentation.


GET/v1/memory/{memoryName}/documents/{documentName}/embeddings/retry

Retry generating document embeddings in a memory

Retry generate document embeddings in a memory by sending a GET request to this endpoint.

Headers

  • Name
    Content-Type
    Type
    string
    Required
    Required
    Description

    Request content type. Needs to be application/json.

  • Name
    Authorization
    Type
    string
    Required
    Required
    Description

    Replace <YOUR_API_KEY> with your user/org API key.

Path Parameters

  • Name
    memoryName
    Type
    string
    Required
    Required
    Description

    The name of memory to which the document belongs.

    Replace {memoryName} with the name of the memory.

  • Name
    documentName
    Type
    string
    Required
    Required
    Description

    The name of the document.

    Replace {documentName} with the name of the document.

GET
/v1/memory/{memoryName}/documents/{documentName}/embeddings/retry
import {Langbase} from 'langbase';

const langbase = new Langbase({
  apiKey: '<YOUR_API_KEY>', // Replace with your API key
});

await langbase.memory.documents.embedding.retry({
  memoryName: 'knowledge-base',
  documentName: 'technical-doc.pdf'
});

Response

  • Name
    Response
    Type
    object
    Description

    The response object returned by the API endpoint.

    Response

    interface Response {
      success: boolean;
    }
    
    • Name
      success
      Type
      boolean
      Description

      Indicates whether the embedding retry was successfully initiated.

API Response

{
  "success": true
}