Short answer: detect change at the document and chunk levels, give every chunk a stable content-derived ID, and embed only IDs that are new or changed. For a financial research dashboard, that choice keeps index work proportional to changed PDF content instead of total corpus size.

Choice Write pattern Best fit Main catch
Full rebuild Replace every chunk and vector Small, rarely updated folders Index work grows with the entire corpus
Stable-ID upsert Upsert changed chunks; delete IDs no longer present Frequently updated research folders Requires deterministic extraction and chunking
Append and filter Insert a new document revision; filter old revisions at query time Immutable audit histories More stored vectors and stricter query filters

My default is stable-ID upsert. It spends engineering effort on the boundary that controls recurring work: deciding whether a PDF, page, and chunk are actually new. For a solo SaaS that ships weekly, rebuilding unchanged embeddings is undifferentiated work with no reader-facing return.

The runner-up is append and filter. Keep it close when revision history is itself part of the product, not merely an ingestion detail.

How should a financial research dashboard handle incremental indexing for retrieval?

Start with two identities. A sourceId identifies the logical report, while a revisionId identifies the exact bytes fetched for that report. A corrected filing can retain its logical source identity and receive a new revision identity. This prevents a filename change from looking like a new company report, and it prevents a silent replacement at the same path from looking unchanged.

Then compute chunk identity from normalized chunk content plus the logical source identity. The source component matters: two reports may contain the same boilerplate risk paragraph, but deleting one report must not delete the other report's searchable evidence. The content component matters too, because unchanged chunks should preserve their IDs when a new cover page or appendix arrives.

The rule is blunt: a chunk ID must describe what the index will retrieve, not where extraction happened to place it. Page number and ordinal position belong in metadata. If either becomes part of the ID, inserting one page near the front can invalidate every later chunk and turn an incremental job into a disguised full rebuild.

This architecture does not make PDF extraction deterministic by magic. A parser upgrade may change whitespace, reading order, table text, or hyphenation. Treat the extractor version and normalization version as inputs to a controlled migration. Don't quietly mix two chunking regimes under the same IDs; either pin the old regime or schedule an explicit rebuild whose cost is visible.

The two decisions that control index cost

The first decision is the skip boundary. Check cheap evidence before expensive evidence: compare a stored source revision with the current revision, then parse only changed documents, then hash normalized chunks, and only then request embeddings for unseen hashes. An upstream revision signal can avoid downloading unchanged bytes. A byte hash can avoid parsing a file whose metadata changed but content did not. Neither replaces the chunk comparison, because a genuinely new PDF revision may still contain mostly unchanged text.

The second decision is deletion semantics. Upserts are easy; absence is where stale answers survive. After extracting a revision, build the complete set of chunk IDs expected for that logical source. Diff it against the active set. Upsert the additions, retain the intersection, and delete the remainder only after the new set is committed. That order keeps a failed ingestion from erasing the last searchable revision.

One formula is enough for planning:

embedding work = new chunk IDs + changed chunk IDs

It isn't all chunks in changed PDFs, and it certainly isn't all chunks in the folder. The distinction becomes material when recurring reports carry forward pages of definitions, disclosures, and methodology. I would track the ratio of embedded chunks to parsed chunks for every run. A rising ratio after an extractor release is a signal to inspect normalization before accepting a permanently larger index bill.

There is no universal break-even point. I'm not sure one can be stated honestly without the folder's update rate, average PDF size, parser runtime, embedding policy, and storage retention rule. Measure those inputs in a shadow run. Guesses age badly.

A TypeScript ingestion core with stable chunk identities

Keep vendor calls behind narrow interfaces. The useful unit is not an SDK object; it is a small state transition that can be replayed in tests. This example assumes extract returns deterministic text for the pinned extractor version and split returns normalized text under a pinned policy.

import { createHash } from "node:crypto"; type Chunk = { id: string; sourceId: string; revisionId: string; text: string; page: number; }; type SourceState = { revisionId: string; activeChunkIds: Set<string>; }; interface StateStore { get(sourceId: string): Promise<SourceState | undefined>; commit(sourceId: string, state: SourceState): Promise<void>; } interface VectorIndex { upsert(chunks: Chunk[]): Promise<void>; remove(ids: string[]): Promise<void>; } type ExtractedChunk = { text: string; page: number }; const digest = (value: string): string => createHash("sha256").update(value, "utf8").digest("hex"); const normalize = (text: string): string => text.normalize("NFKC").replace(/\s+/g, " ").trim(); export async function indexPdf( sourceId: string, pdfBytes: Uint8Array, extract: (bytes: Uint8Array) => Promise<ExtractedChunk[]>, stateStore: StateStore, vectorIndex: VectorIndex, ): Promise<{ embedded: number; deleted: number }> { const revisionId = digest(Buffer.from(pdfBytes).toString("base64")); const previous = await stateStore.get(sourceId); if (previous?.revisionId === revisionId) { return { embedded: 0, deleted: 0 }; } const extracted = await extract(pdfBytes); const chunks = extracted.map(({ text, page }) => { const normalizedText = normalize(text); return { id: digest(`${sourceId}\u0000${normalizedText}`), sourceId, revisionId, text: normalizedText, page, }; }); const nextIds = new Set(chunks.map((chunk) => chunk.id)); const changed = chunks.filter( (chunk) => !previous?.activeChunkIds.has(chunk.id), ); const removed = [...(previous?.activeChunkIds ?? [])].filter( (id) => !nextIds.has(id), ); await vectorIndex.upsert(changed); await stateStore.commit(sourceId, { revisionId, activeChunkIds: nextIds, }); await vectorIndex.remove(removed); return { embedded: changed.length, deleted: removed.length }; } 

The code deliberately leaves page numbers out of id. It also makes the complete next set explicit, which gives deletion a testable input. In production, the state commit and index mutations need an idempotency strategy suited to the chosen stores; retrying a job must converge on the same active IDs rather than minting duplicates.

There is one wrinkle. Identical normalized text repeated twice inside one report produces one ID in this compact example. If both occurrences must be independently citable, add a stable local occurrence discriminator derived within the repeated-content group, not the global chunk ordinal. That requirement depends on the dashboard's citation UX, so decide it before locking the schema.

Prove freshness before tuning retrieval quality

Incremental indexing creates a second correctness problem beside relevance: the dashboard can retrieve a plausible passage from the wrong revision. Test freshness as a property of the index, not as a side effect of a successful ingestion request.

Build a fixture sequence for one logical report: initial upload, metadata-only rename, one-paragraph correction, inserted cover page, removed appendix, and byte-identical re-upload. Assert the active chunk set after every step. The byte-identical case should parse and embed nothing when the source check is available; the one-paragraph correction should preserve unaffected content IDs; the removed appendix should leave no active retrievable chunks from that appendix. These are invariants, not benchmark claims.

Observe each stage with counts rather than a single job succeeded flag: sources inspected, bytes fetched, PDFs parsed, chunks produced, chunk IDs retained, vectors written, IDs deleted, and revisions activated. Also record the extractor and normalization versions. If retrieval shows an old paragraph, those fields let one person distinguish a query-filter mistake from a stale active set without spelunking through every service.

Ship the ingestion path behind a shadow comparison first. Run the incremental planner against a representative folder, but do not switch the read path; compare its proposed active IDs with a clean rebuild. A set difference is actionable. A vague relevance score is not. Once the sets agree across meaningful mutations, replay a small suite of questions whose expected citations name source and revision, then promote the new read path.

Keep failure recovery boring. A retry uses the same source ID, revision ID, chunk IDs, and activation intent. Empty extraction should not be interpreted as proof that every old chunk vanished; quarantine that revision for inspection instead of activating an empty set. This is an input-validation boundary, not a claim about any particular parser or service.

When the runner-up is the better design

Stable-ID upsert is not suitable when the dashboard must reproduce exactly what an analyst could retrieve at an earlier point in time. In that case, append each immutable revision and require an asOf or revision filter on every query. Storage and filter discipline become the trade, but historical reproducibility is explicit.

Stick with full rebuilds when the corpus is genuinely small, updates are rare, and a clean rebuild finishes comfortably inside the publishing window. The simpler operation may be worth more than optimized writes. It is also the safer temporary choice during a deliberate extractor or chunking migration, because content-derived IDs will correctly change when normalization semantics change.

Stable-ID upsert wins in the middle: recurring PDF updates, substantial unchanged content, and no requirement to serve historical index states. Choose it for bounded recurring work, not because incremental architecture sounds sophisticated. The revenue-per-hour test is whether the saved embedding and indexing work exceeds the operational cost of manifests, versioned normalization, deletion checks, and replay tests. Your mileage may vary.

No vendor changes that decision rule.

References