Fix embedding vector dimension mismatch (768 → 2560) #156
Labels
No labels
domain:backend
domain:devops
domain:frontend
status:approved
status:in-progress
status:needs-fix
status:qa
type:bug
type:devops
type:feature
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
forgejo_admin/pal-e-api#156
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Lineage
plan-pal-e-docs→ Phase 5 (Activate Semantic Search) → Phase 5a (Dimension Fix)Repo
forgejo_admin/pal-e-docsUser Story
As the embedding worker
I want the vector column to match the model's output dimensions
So that embeddings can be stored and semantic search can function
Context
qwen3-embedding:4bproduces 2560-dim vectors (ollama showconfirmsembedding length: 2560). Theblocks.embeddingcolumn isvector(768)from when the model was first tested. The embedding worker is deployed (PR #155) but all blocks are erroring with:expected 768 dimensions, not 2560.No embeddings have ever been stored (column was all NULL before activation), so this is a safe ALTER — no data loss.
File Targets
Files the agent should modify:
ALTER TABLE blocks ALTER COLUMN embedding TYPE vector(2560)src/pal_e_docs/models.py— update anyvector(768)type hints or column definitions tovector(2560)768dimensions — update to2560Files the agent should search for
768:src/pal_e_docs/embedding_worker.py— check if dimension is hardcoded anywheresrc/pal_e_docs/routes/notes.py— check search endpointsrc/pal_e_docs/services/search.py— check RRF searchtests/— any test fixtures with 768-dim vectorsFiles the agent should NOT touch:
k8s/embedding-worker.yaml— just merged, working fine.woodpecker.yaml— just fixedAcceptance Criteria
blocks.embeddingfromvector(768)tovector(2560)UPDATE blocks SET embedding_status = 'pending' WHERE embedding_status = 'error'to reset errored blocksTest Expectations
pytest tests/ -v768remains in source filesConstraints
alembic/embedding_modelinconfig.pyis correct (qwen3-embedding:4b) — don't change itChecklist
Related
pal-e-docs— project this affects