Skip to content

Optimize ingestion load testing and add multi-document chat querying#7

Merged
Aryan1718 merged 5 commits into
Aryan1718:developfrom
varun3011:main
Jun 16, 2026
Merged

Optimize ingestion load testing and add multi-document chat querying#7
Aryan1718 merged 5 commits into
Aryan1718:developfrom
varun3011:main

Conversation

@varun3011

@varun3011 varun3011 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Adds a follow-up optimization pass for ingestion load testing, workspace cleanup, and multi-document chat querying.

Ingestion and Load Testing

  • Set default ingestion worker balance to 4 extract workers and 4 index workers.
  • Add parallel signed-URL uploads to the ingestion load-test script with configurable upload concurrency.
  • Optimize index worker DB writes by inserting embedding rows in one batch per document.
  • Keep embedding token usage unchanged while reducing DB round-trips.
  • Optimize ingestion-run status refresh by combining run lookup and status counting into one query.
  • Add DB pool configuration to reduce Supabase connection pressure during worker load.
  • Replace schema helper inspection with information_schema queries to avoid extra DB connections.
  • Add a Delete all documents control in the Upload / Ingestion workspace page for faster test cleanup.

Multi-Document Chat Querying

  • Add multi-document selection in the document sidebar.
  • Add chat query modes:
    • Selected documents
    • All ready documents
  • Enforce current query caps in the UI:
    • 10 documents max
    • 100 total pages max
  • Send document_ids to the streaming query API.
  • Keep existing document_id compatibility by using the first selected document as the primary document.
  • Persist and restore selected document sets in saved chat sessions.
  • Add chat_sessions.document_ids schema support.
  • Improve multi-document retrieval by selecting balanced candidates per document before final ranking.
  • Increase server DB pool defaults for streaming query reliability while keeping worker DB pools conservative.

Validation

  • Verified Docker runtime with 4 extract workers and 4 index workers.
  • Ran 20-document valid ingestion load tests.
  • Best observed 20-document run:
    • Avg extraction: ~1.1s
    • Avg indexing: ~3.8s
    • Avg total ingestion: ~12s
    • Batch wall time: ~50s
  • Manually tested querying across 3 uploaded/indexed PDFs.
  • Confirmed selected-document mode works.
  • Confirmed streaming answers and citations work.
  • Confirmed DB pool timeout error is fixed.
  • Worker regression tests passed: 2 passed.
  • Focused server tests passed: 10 passed.
  • Multi-document query/retrieval tests passed: 5 passed.
  • Client build passed: npm run build.

Notes

  • Generated local load-test artifacts were not committed.
  • Supabase environments need scripts/schema.supabase.sql applied so new schema fields are available.

@varun3011 varun3011 changed the title Optimize ingestion load performance and cleanup controls Optimize ingestion load testing and add multi-document chat querying Jun 13, 2026
@Aryan1718 Aryan1718 merged commit 0c71648 into Aryan1718:develop Jun 16, 2026
2 checks passed
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.

2 participants