Skip to content

Bug: Dimension mismatch (1536 vs 1024) when using OpenAI text-embedding-3-small #14

@omarm3118

Description

@omarm3118

A SqliteError occurs when uploading a document if the embedding model is set to OpenAI's text-embedding-3-small. The model returns 1536 dimensions, but the SQLite schema expects 1024.

Error Message

Error adding document from file: SqliteError: Dimension mismatch for inserted vector for the "embedding" column. Expected 1024 dimensions but received 1536.

Steps to Reproduce

  1. Configure knownote to use OpenAI text-embedding-3-small.
  2. Upload a document file.
  3. The process fails during the database insertion step.

Technical Details

  • Model: text-embedding-3-small (outputs 1536 dims by default).
  • Database Schema: Hardcoded to 1024 dimensions.
  • Proposed Fix: Use the dimensions: 1024 parameter in the OpenAI API call or update the SQLite table initialization to 1536.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions