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
- Configure
knownote to use OpenAI text-embedding-3-small.
- Upload a document file.
- 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.