返回资讯中心
外部精选
软件工程
#开发者实时流

Snowflake AI_PARSE_DOCUMENT 新增 AGENTIC 模式,每页成本为 OCR 的 12 倍

来源标题:Snowflake's AI_PARSE_DOCUMENT got an agentic mode

Snowflake 的 AI_PARSE_DOCUMENT 现已提供 AGENTIC 模式,可对文档中的图表、示意图、表格和信息图进行分类并生成摘要,与提取文本一并返回。实测成本为每 1000 页 8.18 credits,而 OCR 仅需 0.68,前者是后者的 12 倍。该模式于 2026 年 10 月 28 日发布公共预览,实测中只有幻灯片演示文稿值得这一差价,PDF 文档没有值得描述的内容。

Hacker News 最新sfrt2026/11/4 · 13 天前22 分钟阅读

以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。

12x the price of OCR per page, and it earned that on one file type

TL/DR: Snowflake's AI_PARSE_DOCUMENT now has an AGENTIC mode. It classifies the charts, diagrams, tables and infographics inside a document, writes a summary of each, and hands that back alongside extracted text. I ran it over my SharePoint library that feeds one of my Cortex Search services. Measured cost: 8.18 credits per 1,000 pages (OCR at 0.68). Slide decks were the only place it earned the difference, my PDFs had nothing worth describing 😅

I learned two things not mentioned in the docs: image summaries live outside the page content, and mode has to be a literal. Putting a CASE expression there returns NULL with no error at all.

The new mode was released (to public preview) on October 28th, 2026. Would it help me with any of the document pipelines already running?

I load many docs from SharePoint into ❄️, parse them there and feed a search service with the content. So that's my obvious playground to test that new mode...

I use a dlt pipeline to load the docs into Azure Blob Storage. For the docs themselves I wouldn't really need dlt, but I also load the SharePoint permissions along with the documents (using Azure Graph + SharePoint REST APIs) for obvious reasons (not every user should read every doc). So I bundled those two components into one pipeline running on dltHub.

0:00

/0:06

1×

What the stage held:

Every one of those files was previously parsed with {'mode': 'OCR', 'page_split': true}.

Three modes are available: LAYOUT (text with structure, tables and headers), OCR (plain fast extraction) and AGENTIC. Using the agentic mode, Snowflake looks at the visual elements in a file (charts, diagrams, screenshots, forms, images), classifies them, decides which processing each of them needs, and returns semantic summaries plus structured data: chart series and their values, table headers and cells, diagram components and how they relate, all next to the usual text and layout.

Billing is quoted per page with no mention of a separate agentic rate. Which meant I had to measure it myself...

I randomly picket three PPTX and three PDFs between 1.5 and 10 MB, each parsed twice (OCR and AGENTIC). Then I compared pages, characters and image counts.

Pages came back equal and characters landed within roughly 10% of each other, so agentic doesn't extract more text. However, the reading order is changed: On a two-column slide, OCR interleaves the columns line by line, whereas agentic gives back clean markdown with headings and | table | rows.

For all six files the images column came back NULL. I initially suspected the sample probably had no visuals in it. That was wrong, though...

Turn page_split on and the images aren't at the top level of the response anymore. Instead, every page object carries its own images array:

{"metadata": {...}, "pages": [ {"index": 0, "content": "# Title\n\nimg-0.jpeg", "dimensions": {...}, "images": [{"id": "img-0.jpeg", "top_left_x": ..., "results": {...}}]} ]}

Two notes on how to use this:

The second sample: 8 random PPTX plus 8 random PDFs, first 8 pages of each (page_filter: [{'start': 0, 'end': 8}]). I flattened every image and grouped by image_type:

The chart output is most interesting here. One of them returned this: "most frequent topic across all periods, peaking at 4,754 in the fourth period; all categories except one show a continuous upward trend [...]". A roadmap diagram came back with every initiative label and its status. None of that appeared in the OCR text of the same slides.

However, image descriptions are mostly noise 😅 The first four types in the above list (logos and stock photos) would just dump junk into a search index. The filter I ended up with keeps chart, diagram, table and infographic, and throws away other and photo_with_text. But that decision presumably is very dependent on the use case.

Since 18,000 of the files are PDFs, those would be the major cost drivers. Another experimental run: 12 random PDFs sized 1 to 20 MB, first 8 pages, agentic only.

Invoices, statements and contracts make up most of my PDF library. Nothing from the sample would have survived the previously mentioned filter. Now, twelve files can easily miss a rare type, and a few chart-heavy reports probably exist somewhere in there (I didn't look at each PDF and its content, obviously), but that i.m.h.o. doesn't justify paying a significantly higher price across every PDF.

Credits and a metrics array with the page count sit in SNOWFLAKE.ACCOUNT_USAGE.CORTEX_AI_FUNCTIONS_USAGE_HISTORY, one row per query and model:

Every agentic query landed on a flat 8.18 credits per 1,000 pages, no matter how many images a page carried. A page of plain text bills the same as a page full of charts. That's roughly 12 times what OCR costs.

Projected onto my SharePoint catalog: 115 public PPTX covering 1,559 pages (the exact page count came straight from the already existing pages table), so about 12.8 credits under agentic - compared to roughly 1.1 for OCR. When I apply the same math on the PDFs, it's a few hundred credits above OCR... for a result that (presumably!) adds value only on rare occasion.

What I settled on: AGENTIC for PPTX files, OCR for everything else. And image summaries only for the four useful types appended to the page text. The (non-ASPX) parse step of my task turned into:

cte_content as ( select p.blob_file_path, p.blob_last_modified , ai_parse_document( to_file('@raw.sharepoint.s_documents', p.blob_file_path), {'mode': 'AGENTIC', 'page_split': true} ) as parsed_pages from cte_to_process p where p.file_extension ilike '.pptx' union all select p.blob_file_path, p.blob_last_modified , ai_parse_document( to_file('@raw.sharepoint.s_documents', p.blob_file_path), {'mode': 'OCR', 'page_split': true} ) as parsed_pages from cte_to_process p where p.file_extension not ilike '.pptx' ), cte_pages as ( select c.blob_file_path, c.blob_last_modified , f.value:index::integer as page_index , f.value:content::varchar as page_text , f.value:images as page_images from cte_content c , lateral flatten(input => c.parsed_pages:pages) f ), cte_image_text as ( select pg.blob_file_path, pg.page_index , listagg( array_to_string(array_construct_compact( concat('[', im.value:results:image_type::varchar, ']') , im.value:results:summary::varchar , im.value:results:details:chart_type::varchar , nullif(array_to_string(coalesce( im.value:results:details:key_values , im.value:results:key_values), '; '), '') , nullif(array_to_string(transform( im.value:results:details:components , c -> c:label::varchar), ', '), '') , nullif(array_to_string( im.value:results:details:columns, ', '), '') ), ' ') , '\n') as image_text from cte_pages pg , lateral flatten(input => pg.page_images) im where im.value:results:image_type::varchar in ('chart', 'diagram', 'table', 'infographic') group by pg.blob_file_path, pg.page_index ) select ... , nullif(array_to_string(array_construct_compact( pg.page_text, it.image_text), '\n\n'), '') as page_content from cte_pages pg join _public_docs pd on pd.blob_file_path = pg.blob_file_path left join cte_image_text it on it.blob_file_path = pg.blob_file_path and it.page_index = pg.page_index

A few side notes on this:

In the index, a page containing a chart now looks like this:

<normal slide text>

[chart] A grouped bar chart showing the frequency of five psychological topics ... bar "suicidal thoughts" is the most frequent topic across all periods, peaking at 4,754 ...

The run that succeeded and did nothing at all

The first manual run took 488 seconds, then SUCCEEDED. All 115 decks sat in the metadata table marked as processed. t_documents and t_document_chunks held zero PPTX rows, though 😅

Looking into ACCOUNT_USAGE.QUERY_HISTORY on the task's query tag: the insert burned 447 seconds and inserted 0 rows, while the later metadata merge inserted 115 rows. Seven minutes of parsing, nothing to show for it, no error anywhere.

My intention here was to pick the mode per row with a CASE because it looked tidy. But the function wants a constant. Hence the two-branch union all above.

The same statements again took slightly over 20 minutes this time, against 8 for the empty run. Straight off the tables:

Roughly a quarter of the pages carry visual content worth indexing (plus the corrected read order mentioned earlier), the chunks grew about 10%. The task's final step refreshed the Cortex Search service. From now on only new or modified PPTX pay the higher rate, so in steady state the gap to OCR stays small 😎

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →