Skip to content

perf(faiss): batch Vector CSV embeddings - #2759

Open
greglum wants to merge 1 commit into
SEMOSS:devfrom
greglum:feature/faiss-batch-vector-csv-embeddings
Open

perf(faiss): batch Vector CSV embeddings#2759
greglum wants to merge 1 commit into
SEMOSS:devfrom
greglum:feature/faiss-batch-vector-csv-embeddings

Conversation

@greglum

@greglum greglum commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • embed every ordinary Vector CSV in one model call instead of one call per Source
  • validate embedding row counts and dimensions before persisting per-Source artifacts
  • slice the batched response back into the existing stable dataset and vector files
  • retain the per-Source keyword-search fallback and one master-index rebuild per ingestion group

Why

A Vector CSV can contain many Sources. The prior implementation invoked the embedding engine once for every Source, which adds avoidable model overhead during grouped corpus ingestion. This keeps the existing artifact and removal contracts while changing only the embedding unit of work.

Behavior change

The previous code popped keywordSearch from the caller's parameter dict inside the per-Source loop, so keyword extraction only ever applied to the first Source of the first document and the caller's dict was mutated. This PR reads the flag once per document from a copy, so extraction now runs for every configured Source and the caller's dict is left intact. This is an intentional fix, covered by test_keyword_search_remains_a_per_source_fallback.

Verification

  • focused FAISS batch tests: 5 passed
  • Black formatting check passed
  • Ruff passed for the new test and changed code; the file retains six pre-existing diagnostics outside this change

The older FAISS integration tests require a configured local model or a running Tomcat instance and fail during their environment setup before exercising this path.

Related work

@snyk-io

snyk-io Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@greglum
greglum marked this pull request as ready for review July 17, 2026 01:31
@greglum
greglum requested a review from a team as a code owner July 17, 2026 01:31
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