Skip to content

fix/import bank bounded batches - #5661

Merged
nicoloboschi merged 2 commits into
mainfrom
fix/import-bank-bounded-batches
Oct 16, 2026
Merged

nicoloboschi merged 2 commits into
mainfrom
fix/import-bank-bounded-batches

Conversation

@nicoloboschi

Copy link
Copy Markdown
Collaborator

…d batches (#5418)

import-bank wrote every observation in one insert inside one transaction; on a
large bank with 3072-dim embeddings that bind message passed PostgreSQL's 1 GB
protocol limit and the connection was reset, leaving the target with facts and
no observations.

- Observations are embedded and inserted _OBSERVATION_BATCH_SIZE (500) at a
  time, one transaction per batch; the Postgres store now accumulates
  outcome.imported across calls instead of overwriting it.
- Document batches also close at _FACT_BATCH_SIZE (2000) facts, so fifty
  fact-heavy documents can no longer outgrow the same limit. A single
  document still rides whole (its facts share one transaction).

Closes #5418
…g comments

- test_import_observations_in_bounded_batches counts via list_memory_units
  instead of a raw SELECT on memory_units.
- _EMBED_BATCH_SIZE comment no longer says observations arrive as one list.
- Note that a mid-import failure leaves earlier observation batches, and that
  the import-bank retry starts over.
@nicoloboschi
nicoloboschi merged commit e661e0d into main Oct 16, 2026
117 checks passed
@nicoloboschi
nicoloboschi deleted the fix/import-bank-bounded-batches branch October 16, 2026 11:04
@nicoloboschi nicoloboschi mentioned this pull request Nov 3, 2026
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