<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Extraction v2 on BonsAI Documentation</title>
    <link>/docs/extraction-v2/</link>
    <description>Recent content in Extraction v2 on BonsAI Documentation</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <atom:link href="/docs/extraction-v2/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Overview</title>
      <link>/docs/extraction-v2/overview/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/docs/extraction-v2/overview/</guid>
      <description>&lt;h1 id=&#34;extraction-v2-overview&#34;&gt;&#xA;  Extraction v2 Overview&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#extraction-v2-overview&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h1&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Classification: Internal-Only&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;Extraction v2 is a Rust extraction pipeline that runs &lt;strong&gt;beside&lt;/strong&gt; the current&#xA;hinoki pipeline, not instead of it. A router worker sits in front of 100% of&#xA;extractions and assigns each one to an arm; the v1 arm is the pipeline that&#xA;runs today, unchanged. Only &lt;strong&gt;AP bill&lt;/strong&gt; is in scope.&lt;/p&gt;&#xA;&lt;p&gt;The PoC (&lt;a href=&#34;https://linear.app/tofu-ai/issue/ENG-7054&#34;&gt;ENG-7054&lt;/a&gt;,&#xA;&lt;a href=&#34;https://linear.app/tofu-ai/issue/ENG-7095&#34;&gt;ENG-7095&lt;/a&gt;,&#xA;&lt;a href=&#34;https://linear.app/tofu-ai/issue/ENG-7100&#34;&gt;ENG-7100&lt;/a&gt;,&#xA;&lt;a href=&#34;https://linear.app/tofu-ai/issue/ENG-7101&#34;&gt;ENG-7101&lt;/a&gt;) established the approach&#xA;offline. Nothing from it reached the monorepo except two client libraries —&#xA;one for Extend, one for the Bedrock models. &lt;strong&gt;This is a greenfield build&#xA;informed by the PoC findings, not a port of PoC code.&lt;/strong&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Stages</title>
      <link>/docs/extraction-v2/stages/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/docs/extraction-v2/stages/</guid>
      <description>&lt;h1 id=&#34;stages&#34;&gt;&#xA;  Stages&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#stages&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h1&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Classification: Internal-Only&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;What each stage does, what it may assume, what it costs, and how it behaves&#xA;when something goes wrong. The flow and the cost split are in&#xA;&lt;a href=&#34;/docs/extraction-v2/overview&#34;&gt;Overview&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Types, signatures and schemas live in the implementation and in the Linear&#xA;issues that track it. This page describes behaviour, which changes far less&#xA;often than either.&lt;/p&gt;&#xA;&lt;h2 id=&#34;how-a-stage-works&#34;&gt;&#xA;  How a stage works&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#how-a-stage-works&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;A stage is one async step over inputs it is handed. Three rules hold for all of&#xA;them:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Routing &amp; A/B</title>
      <link>/docs/extraction-v2/routing-and-ab/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/docs/extraction-v2/routing-and-ab/</guid>
      <description>&lt;h1 id=&#34;routing--ab-assignment&#34;&gt;&#xA;  Routing &amp;amp; A/B Assignment&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#routing--ab-assignment&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h1&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Classification: Internal-Only&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;How an extraction gets assigned to an arm, why the assignment is per extraction&#xA;rather than per entity, and what makes the resulting comparison readable.&lt;/p&gt;&#xA;&lt;p&gt;The pipeline itself is in &lt;a href=&#34;/docs/extraction-v2/overview&#34;&gt;Overview&lt;/a&gt;; what each&#xA;stage does is in &lt;a href=&#34;/docs/extraction-v2/stages&#34;&gt;Stages&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;h2 id=&#34;topology&#34;&gt;&#xA;  Topology&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#topology&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;                      ┌──────────────────────────┐&#xA;   bonsapi ──────────▶│        route queue       │&#xA;                      └──────────────────────────┘&#xA;                                   │&#xA;                             router worker&#xA;                                   │&#xA;                 ┌─────────────────┴─────────────────┐&#xA;                 ▼                                   ▼&#xA;            v1 arm queue                        v2 arm queue&#xA;      (unchanged — bonsai-invoice          (the Rust extraction&#xA;       and hinoki)                          worker)&#xA;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Three queues. The route queue is new; the v1 arm keeps the queue and consumer&#xA;that exist today, unchanged.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Measurement</title>
      <link>/docs/extraction-v2/measurement/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      <guid>/docs/extraction-v2/measurement/</guid>
      <description>&lt;h1 id=&#34;measurement-definitions&#34;&gt;&#xA;  Measurement Definitions&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#measurement-definitions&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h1&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Classification: Restricted (describes database views, columns and measurement methodology).&lt;/p&gt;&#xA;&lt;p&gt;&lt;code&gt;INTERNAL - DO NOT FORWARD&lt;/code&gt;&lt;/p&gt;&lt;/blockquote&gt;&#xA;&lt;p&gt;One definition of accuracy, in one place, used by the accuracy harness and the&#xA;A/B readout alike. Two definitions produce two numbers for the same thing, and&#xA;then the argument is about the metric instead of about the pipeline.&lt;/p&gt;&#xA;&lt;h2 id=&#34;accuracy&#34;&gt;&#xA;  Accuracy&#xA;  &lt;a class=&#34;anchor&#34; href=&#34;#accuracy&#34;&gt;#&lt;/a&gt;&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;&lt;strong&gt;Field accuracy compares what the extractor produced against what the customer&#xA;verified.&lt;/strong&gt; The per-type data tables (&lt;code&gt;invoice_data&lt;/code&gt; for AP bill) are&#xA;append-only, one row per change, ordered by &lt;code&gt;created_at&lt;/code&gt;, each row carrying&#xA;&lt;code&gt;is_ai_extracted&lt;/code&gt; and an &lt;code&gt;action_type&lt;/code&gt;. Two rows matter:&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
