Skip to content

Indexing pipeline + incremental maintenance #6

Closed

Description

@thorwhalen

Refs #1.

ir.index.build(source):

  1. load ledger; for each (id, raw) in scope compute version = change_signal; skip if unchanged (content-hash CRUD per ir_02 / ScaleMCP).
  2. else decompose -> surfaces; embed (cached); upsert records into store; update ledger.
  3. deletions: artifacts in ledger but not in scope -> drop their records (full-refresh mode).

Light pipeline (no artifact-graph at these sizes; note the ef.artifact_graph upgrade path). Reuse ef.content_hash. Idempotent; re-run is a near-no-op.

Activity

  1. thorwhalen commented on Jun 5, 2026

    @thorwhalen
    MemberAuthor

    Decisions (done in PR #14):

    • Light content-hash CRUD, not ef.artifact_graph: at these corpus sizes the graph is overkill; each artifact's ef.content_hash is compared to the ledger and only new/changed/re-modeled artifacts are decomposed + embedded. Idempotent; re-run is a near-no-op. The artifact-graph remains the documented upgrade for corpora large enough that recomputation dominates.
    • Model change handled incrementally: the ledger stores embedder_id per artifact; a mismatch marks the artifact changed (delete-then-write its records). No global clear needed.
    • Full-refresh prune: artifacts in the ledger but absent from the source are dropped (records + ledger entry).
    • Chunking fix: the first paragraph-strategy chunker emitted one surface per paragraph → md-reports exploded to 66,750 records. Replaced with a paragraph-packing chunker (greedily fill ~chunk_size, hard-split oversized paragraphs) → 16,836. Regression-tested.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions