Example Knowledge assistants

A chunk size change alters what the assistant reads. See where the answer's trail first moved.

A small retrieval pipeline answers questions about an example shop's returns and refunds. It loads the policy documents, splits them into chunks, embeds and retrieves them, and quotes an answer. Nothing calls a hosted model.

Invented example data, recorded when the demo was built. The demo records and compares; it controls nothing. The screenshots are from a build of the same demo: each build gives its runs new fingerprints and times, so those differ from the live demo's, and what the screenshots show is the same.

The pipeline

Five steps, from documents to a quoted answer.

  • load_docs loads the example shop's policy documents.
  • split splits them into chunks of a set size.
  • embed turns each chunk into counts, without a model.
  • retrieve ranks chunks against the question.
  • answer gives the answer, with the tool extractive.

What the demo plants

The runs, and what was changed in each.

RunWhat was changed
p1-02-baseline-set2Nothing: the baseline, chunk_size 1024.
p1-08-candidate-set2split's chunk_size, 1024 to 512.

What onetrace shows

Each change, located in the record.

The chunk size: first difference at split

split is the first difference, and the page names its setting: chunk_size, 1024 to 512. Each policy document is now cut into two chunks where it was one, so the steps after it read different text.

The live demo's comparison of p1-02-baseline-set2 and p1-08-candidate-set2. First difference at split; load_docs is Same, and embed, retrieve and answer are marked Changed after it.
Comparison page: first difference at split.
Settings that changed: split, chunk_size, 1024 to 512. Below, the text diff of chunks.json, where each document becomes two chunks.
Settings that changed: chunk_size, 1024 to 512.

What it doesn't say

A located change, not a reason.

The comparison shows the setting and the text that moved. It doesn't say whether the new answer is better, or which chunk size is right. See what each verdict means and what onetrace does not claim.

Try it yourself: this pipeline in the live demo, or on your machine with pip install onetrace-console and onetrace-console demo --open.