Skip to content

refactor(vector-storage): fix vector counting logic and improve error…#123

Open
sqhyz55 wants to merge 2 commits intoxorbitsai:mainfrom
sqhyz55:fix/vector-counting-logic
Open

refactor(vector-storage): fix vector counting logic and improve error…#123
sqhyz55 wants to merge 2 commits intoxorbitsai:mainfrom
sqhyz55:fix/vector-counting-logic

Conversation

@sqhyz55
Copy link
Collaborator

@sqhyz55 sqhyz55 commented Mar 10, 2026

… handling

  • Add _group_embeddings_by_model() to group embeddings by model for batch processing
  • Add _validate_and_prepare_table() to ensure table exists with compatible schema, drop and recreate on dimension mismatch or incompatible vector field type
  • Add _process_batch() with merge_insert-first strategy and fallback to add(); distinguish non-recoverable errors (schema/type/dimension) from recoverable ones
  • Add _process_model_embeddings() to process per-model batches and aggregate upsert counts correctly
  • Refactor write_vectors_to_db() to use per-model flow and return accurate upsert_count / index_status
  • Improve error handling and logging throughout

… handling

- Add _group_embeddings_by_model() to group embeddings by model for batch processing
- Add _validate_and_prepare_table() to ensure table exists with compatible schema,
  drop and recreate on dimension mismatch or incompatible vector field type
- Add _process_batch() with merge_insert-first strategy and fallback to add();
  distinguish non-recoverable errors (schema/type/dimension) from recoverable ones
- Add _process_model_embeddings() to process per-model batches and aggregate
  upsert counts correctly
- Refactor write_vectors_to_db() to use per-model flow and return accurate
  upsert_count / index_status
- Improve error handling and logging throughout
@sqhyz55 sqhyz55 marked this pull request as draft March 11, 2026 06:06
- Use IndexOperation enum for embedding write index_status mapping
- Improve _validate_and_prepare_table and _process_batch docstrings
- Add tests for grouping embeddings, table validation and spill retry
- Extend IndexOperation tests to cover READY status

Made-with: Cursor
@sqhyz55 sqhyz55 marked this pull request as ready for review March 12, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant