Documents Automation
Use Documents Automation, after Connectors in the sidebar, to work with Folders & automation, Documents, Templates, Datasets / SQL and Monitoring in the left navigation. Above the file list, the status filter (All, Done, In progress / review, Failed, Not processed) shows files by the same colours as their status dots. Field-extraction Review has no navigation entry: it opens from Save and continue to extraction, Review result in Monitoring, and the review links under a result. Choose Hide navigation to give the document viewer more room; Show navigation brings the sections and document tree back. Folder discovery, original previews, managed uploads, versioned templates, extraction, human review and recurring scans are available. Actual accuracy depends on your documents and templates; test representative examples before production use.
Run a fixed template and publish one approved result
- In Brief, choose your saved template. In Scan, check the displayed template name and version. Scan document runs that immutable version as a background extraction job; it does not regenerate the schema. If the brief, labels or schema differ, save a template version first or select the saved version again. Design / refine the template instead explicitly returns to draft authoring.
- Leave Read the original again unchecked to reuse a matching, unexpired parse. Choose it when you need fresh OCR. Changed reader settings or expired artifacts require another parse regardless. Running an extraction still uses the configured AI provider and can incur API costs.
- Compare the candidate with the original. Review, correct and publish this result opens Review. For an incorrect field value, enter the canonical value and a review reason. If its source reference is missing or wrong, expand Correct source reference and supply the page and a unique exact quote from the parsed text. Ambiguous quotes are rejected; no source values are guessed.
- Approve the reviewed result. One approved result remains current per document. A new partial or unapproved scan does not replace it. Approve another validated version explicitly to replace it. Old scans stay in History. Missing pages, failed batches and old partial scans without coverage proof still require a rerun; field corrections cannot certify unseen pages.
- Configure Templates → select template → Database / SQL output. Enable a saved database destination, select the direct PostgreSQL staging connection and its read connection, and map each output table. The section shows columns and types. Save the template version and use it for subsequent extractions. Saving a template does not create tables or publish data.
- After approving an extraction, choose Queue publication in Review. The extraction's saved template provides the destination defaults; check them before submitting. Publication creates compatible tables and writes this document's reviewed rows transactionally. Open … in Datasets / SQL queries the published rows without another AI call. Existing incompatible table contracts require an explicit migration or another destination table.
For blood-test templates, configure the repeating lab_test table with the fields you need. Date and decimal fields have a Source date / number format selector; select the source's actual format instead of expecting the parser to guess. Preserve qualified results such as <0.5 as text and use explicit numeric/operator projections where needed. Optional missing remarks should remain nullable.
A scan reporting partial has finished with unresolved problems; it is not an approved result. Expand Issues to resolve before approval for the recorded reasons. Older Scan experiments may require a new saved-template extraction to enter the correction/publication workflow.
Folders & automation
Everything about folders lives in Documents Automation → Folders & automation, separately for each project. The left panel's header has the same collapse icon as the main menu; collapsed, it shows only the section icons.
System folders are AgentData's own folders: files are stored encrypted inside AgentData. Every project has one root system folder (tagged root). It is created automatically, can be renamed, and can't be deleted. Create more system folders inside it with its Folder button.
External folders stay in your own storage: an on-prem connector folder, Amazon S3, a SharePoint document library or a Google Drive folder. Add the connection once in Connectors, then choose Connect external folder in the page header and browse to the folder. Create new connection offers only these storage types. SharePoint and Google Drive are read-only for AgentData.
Each folder is one line: name (✎ renames it), Images and Tabular switches, the number of files, the last scan time, Folder (add a sub-folder, on folders that support it) and, on sub-folders, a red icon that deletes the sub-folder permanently after showing how many files it holds. Open a folder (▸) for two collapsible parts:
- Settings, saved as soon as you change them (a green ✓ confirms):
- Template — the extraction template for images (optional; automatic scanning of PDFs and images needs one) and, for tabular files, Any — detect by header or one template whose files are the only ones staged.
- Scanning — Manual (default), Automatic every N minutes (5 or more), or Scheduled every N hours.
- Retention — None (default) or after N days (30 by default) move files to Trash, or to another folder that can receive files.
- Files — name, template, type (Excel, CSV, PDF, Image), category (Tabular, Images), Uploaded (when AgentData first discovered the file) and Changed (when it first saw the current version). ✕ removes a file: move it to Trash (default), move it to another folder, or delete it permanently (administrators).
Images sends PDFs and images to extraction; Tabular stages Excel/CSV files (see Staging ingest) and needs approved staging for the tenant.
Drag and drop moves. Drag a folder line or a file row onto another folder to move it there; a moved folder keeps its sub-folders and settings and is removed from its old place (you confirm first). Hold Alt (Option ⌥ on Mac) while dropping to copy instead. Only folders that AgentData may write into accept a drop, and files are moved only out of folders it may delete from — otherwise they are copied. Connectors → Test shows what each connection allows (Read / Write / Delete): SharePoint needs Sites.ReadWrite.All and Google Drive the drive scope to allow writing and deleting.
Refresh (next to the page title) rescans the folders; the time of the last refresh is shown beside it. An open page also reloads itself every minute.
Editors connect folders, upload and move files. Administrators manage Tabular staging, delete permanently and manage Trash.
Scan a file: spreadsheets, PDFs, images and HTML
Open a file in Documents and click Scan in the page header. The Scan panel opens beside the file (spreadsheet table or document pages); View shows or hides the file, ‹ › on the divider give one side the full width. Scan works in two steps:
- Identify — AgentData finds the file's template and lists what would go wrong, without loading anything. Matching is done by code: the same columns as a template (case, spacing and order ignored), close names (abbreviations, word order, small typos — for example Qty and Quantity), or a similar template with columns missing or added. Issues are counted over every row: required columns missing, required values empty, values of the wrong type, repeated keys.
- Extract rows — loads the rows into the template's own table in the staging database.
The panel opens on the tab that fits the file, marked green: New template (nothing matches — map the columns and save), Similar template (compare the file with the closest template; ✨ Suggest with AI pairs the columns code couldn't, using column names only) or Matches template (counts, issues, Extract rows).
The template box next to Scan lists your templates with how many files use each. Type a new name and press the green ✓ to save it as a draft for this file; Accept as … v1 approves it (versions count approvals only). Names no file uses are listed last and can be removed. Saved in shows the template's table (<prefix>_<template name>; prefixes are set in Datasets / SQL) and, with System, also keeps a copy of the original file in AgentData. The template is kept as both JSON and YAML (download either).
PDF, image and HTML files are read first, by the reader your administrator chose for that kind of file (see Choose the readers). While a document is being read the panel shows Reading the document…; then its tables go through the same steps as a spreadsheet — each table is one sheet, a table continued on the next page is joined, and labels you drew on the document choose the table. Reading needs document processing to be enabled for your organization (Settings & Monitoring → Documents Automation).
A document is read once per file version. Opening it again, scanning its folder, another user opening it, or the end of the retention period does not read it again — and costs nothing. It is read again when the file changes, or when you change its Notes for the scanner (Save and read again) or its labels. The panel shows who read it: reader, model, time and cost.
Fields: single values on a document
Besides its table, a document often prints single values — patient name, ID, test date, lab. Open Fields in the Scan panel and click Add field: give it a name, the label printed next to it on the document (for example Date: or תאריך) and a type (text, number or date). The value is the text after the label on the same line, or on the next line when the label stands alone; Found here shows what was found on this document as you type. Approve the template, then Extract rows: each field becomes a column of every row (the field's value repeated), so each row carries its document's date or patient. Fields are found by code — nothing is sent to AI — and they do not affect which template a document matches. A field cannot share a name with a column of the table.
Folders: click a folder's name to see everything in it — status, type, uploaded / updated / scanned times — and Scan it: every file in the folder is identified, one after another. Above the list, All / Done / In progress / review / Failed / Not processed show files by status.
A folder's Scanning is Manual (nothing is read until someone scans) or Automatic: each new or changed file — spreadsheet, PDF or image — is processed once. It is read, matched to the templates, and its rows load when Load data automatically allows: Never — wait for approval, When it matches a template (default) or When it matches or is similar to a template. Anything else shows Waiting for template approval — open the file and Scan. The coloured dot left of each file and folder shows its state: green done, teal matched automatically, amber in progress or waiting for review, red failed, grey not scanned yet.
Data: your document tables in staging
Documents → Data shows, in one collapsible table, a row per Scan template: its table, rows (final / landed, and errors), the documents they came from and the last load. Each template has a final table and a landing table (every row as read, errors included); rows reach them when they are loaded. A row flags what needs attention: Columns to add (a newer template version added columns — Add columns; columns are never removed), Empty or Not created yet.
- Documents (the count) opens the rows each document contributed; administrators can Remove rows of one document, for example before extracting it again.
- ⇩ Final / Landing / Errors downloads the table as CSV. Columns the template marks as personal data are masked as
***, including a key or an error text that repeats such a value; administrators can tick Include personal data above the table. - Truncate deletes every row of the template's tables (the tables stay); Remove drops the tables themselves — the template stays and its next load creates them again. Both ask you to type the table's name. Remove is available on your own staging database only.
- Tables no template owns (for example a deleted template's) can be dropped the same way.
Your own staging database and CLI access
On the platform's shared staging database you see and manage only your organization's rows, and no one can open it directly. An administrator can click Create my own database: AgentData creates a database for your organization alone (no other organization can connect to it) and moves your staged rows and document tables into it.
With your own database, Connect from a CLI or SQL client shows its connection URL (Show / Copy) and a ready psql command. Use it from any terminal or tool; your document tables are in the schema shown on the page, for example SELECT * FROM ing_p0.<table>. The URL has full access, so keep it like a password; Connection details lets you change the password. Work in VS Code downloads a workspace file: open it in VS Code, which offers to install the SQLTools extension and its database driver, then connect to AgentData staging with the password from Connection details (the password is never in the file). DBeaver and DataGrip work with the same details.
SQL gives administrators full access to their own staging database in the browser — read, change and create tables — one statement at a time, with a time limit and up to 1,000 rows shown. Downloads, row removals, truncated and removed tables, creating your own database and every SQL statement in the editor are recorded in the administrators' audit log.
Upload files
Click Upload file in the page header, pick the file (PDF, PNG, JPEG, Excel or CSV) and the folder it goes into. The selected folder is suggested. System folders store the file in AgentData; S3 folders receive it in their storage. The folder's settings decide what happens next: with Tabular on, a spreadsheet is staged right away. Files stay until the folder's retention or a user moves them to Trash. Uploading never writes into a folder on your computer.
Trash
Removed files go to the tenant's Trash (Settings & Monitoring → Documents Automation → Trash, administrators only). Each file shows its project, folder and path, who removed it, when, and why (removed by a user or by folder retention). Restore puts a file back exactly where it was; Delete permanently removes it for good. At the top, set how many days removed files are kept (180 by default); older files are deleted automatically. A file can be restored only where AgentData may write; Connectors → Test shows each connection's permissions.
Browse, parse and create a template
The filename appears in the compact page header. Process document opens one workspace for the brief, labels, discussion and results. View gives the original more space. Page navigation, zoom, settings and download remain in the viewer toolbar. Drag either panel divider to adjust its width. Move the pointer to the image edges for previous/next document and folder navigation; use the wheel to zoom and View mode to pan.
- Expand a folder in the left panel and click a filename. Its Info icon opens properties. PDF pages are rendered as images; Download original retains the source format.
- Choose Process document. Opening the workspace does not start OCR or an AI call. In Brief, describe the document and what to extract, optionally choose a saved template, and expand Language and recognition options only when you need to adjust the document settings. Enter a brief or choose a template before proceeding.
- Open Labels (optional) to draw a field or a table. You can skip labels and open Scan directly. Spreadsheets (Excel, CSV) never need labels.
- Open Scan, choose an engine and click Scan document. For a saved structured template, this runs its saved fields and table definitions without redesigning the schema. A matching retained parse is reused unless you select Read the original again. Progress and errors remain visible.
- Inspect JSON or CSV / Table on the right beside the original. Edit the extraction instructions and save reusable templates in Brief. Results require review before publication.
Briefs, labels and discussion changes autosave to your private document draft. Save labels and draft also saves explicitly. Wait for the saved confirmation before leaving or reloading. A failed save remains visible; resolve it and save again. Closing the side panel preserves the current draft, and saved labels reload when reopening the document. Saving a reusable template is a separate action.
Green indicates completed reading, red indicates not processed or failed, and amber indicates queued, running or partial processing. A green status does not certify accuracy. Labels identify sample regions and desired fields; they are not verified expected values or OCR training. You can label before the first run, or add/refine labels after inspecting a result and run extraction again. Regions remain tied to the original sample/page; a different document is not assumed to have the same coordinates.
Templates support text/identifiers, integers, exact decimals, dates, booleans and configured enumerations. Runtime inputs supply context or validation settings; they are not source evidence.
Label a table or a field
There are two kinds of label:
- Table: choose Process document → Labels (optional) → Draw table and draw one rectangle around the whole table. Name it, for example Blood tests, then add its Columns by name and type (test, result, unit, range). You do not draw rows or cells. When a page has several tables, the table label tells the scan which one to read.
- Field: choose Draw field and draw a rectangle around one value, such as the report date. Name it and write its definition.
Labels are optional, and most documents need none. In our tests, drawing rows and cells did not change the extracted values; clear names and definitions did. Write what a field is and what it is not, for example "issue date, not the due date". Use the Brief for shared values, such as applying a report date to every test. Choose text for results containing signs such as <0.5; numeric companion columns can be added later. Remove table removes the table and its columns.
Templates made before this change keep working: their row and cell rectangles are still read.
Reuse label names
In the label editor, type a dotted name such as claim.amount or claim.amount.net, or choose a previously saved name from the field's dropdown. Choose Save reusable label name to make the name available across documents in the current project. The dots define a naming hierarchy; JSON keys and CSV columns remain explicit mappings and are not automatically nested JSON objects.
Expand Reusable label names to add a path or remove one. Select Also remove names below this path to remove a whole subtree. Removing a catalog name does not delete rectangles or rewrite saved templates. Use the image label's × to remove a label from the current draft.
Document language and scan settings
Click the small Info icon beside a filename to open Properties. Clicking the filename itself opens the original document. The dialog shows its source path, modification time, last scan, size, format and processing status, followed by language and recognition settings. Hover the filename for a short summary. For several documents, tick their checkboxes (or Select all loaded files), choose Properties, change the desired settings and choose Apply changes. This saves without starting recognition. Only settings you change apply to all selected files; their other properties remain separate. Each file reports whether its update succeeded. Selection covers loaded files in the active folder, not unloaded inventory pages.
Language, quality and content properties are available in Process document → Brief beside the extraction goal. Scan uses automatic recognition for the selected engine. You can also open Document settings (⚙) for the viewed file and choose Save document settings. Neither action starts processing. Enter the extraction goal and optional labels first, then choose Scan document. A spinner shows processing is running; completion, partial coverage or a failure is shown explicitly. The language picker is a searchable dropdown with checkboxes: search by name or code and select several languages. The available languages depend on the installed OCR packs; English and Hebrew are configured initially. Language selection guides recognition; it does not translate the document.
- Automatic — embedded text + OCR when needed is recommended for most files. The parser uses embedded PDF text and also runs OCR on scanned or image-containing pages. This is a parser rule, not an LLM decision. Always OCR reads each page image even when embedded text exists; use it when embedded text is garbled or incomplete. The later extraction step maps the reading result into the requested fields. This recognition-mode setting applies to Local and Docling readers; Vision reads page images directly.
- For the Local reader, Document quality: Automatic uses original-image contrast and dimensions to identify low contrast or small images. When enhancement is enabled, it adjusts preparation and upscaling within processing limits. Poor forces enhancement and bounded upscaling; Good keeps your selected OCR settings. Upscaling does not recover missing detail. In Brief, Detected image quality shows per-page dimensions and reported DPI when available after scanning. Older scans need rescanning to record these diagnostics. The rating is a heuristic, not a test of OCR accuracy, blur, handwriting or language; review and override it if needed. Embedded-text pages do not need an image-quality rating.
- Detect tables enables the Local reader’s native PDF table detection or Docling’s table-layout recognition. Vision preserves rows for subsequent field mapping.
- Enhance low-contrast scans applies contrast and denoising before Local OCR. It is enabled by default for new settings. Previously saved choices remain unchanged, including an explicit opt-out. The original file is preserved. Turn enhancement off and rescan if it makes recognition worse.
- Contains handwriting forces OCR and marks the parse for human review. Contains meaningful images also marks coverage incomplete for review. Accuracy depends on the selected reader and source quality; these flags do not guarantee handwriting or visual interpretation.
Settings follow the same connected folder and file path across inventory scans. They affect new parsing runs; existing results retain their original settings. Save the settings, then open Process document → Scan and choose Scan document. This rereads the document and reruns structured extraction; it does not approve values. A stale concurrent edit shows a conflict instead of overwriting another user's settings.
Choose the readers
Administrators choose the readers in Settings & Monitoring → Documents Automation → Readers, among the ones your platform administrator connected:
- PDF with text, HTML — Docling reads the text and tables as they are (no OCR, no AI cost).
- Scans in Latin languages — Docling's OCR (no AI cost), or a vision model.
- Scans in other scripts (Hebrew…) — Azure Layout when it is connected, else a vision model.
- Vision model — the provider and model used when a vision model reads.
In use shows the reader that will actually be used; a choice that is not connected falls back to the default and says so. What reading has cost lists your organization's reads per reader and model, with the cost per page and per read. Changing a reader does not read documents again.
Retention, on the same page and in days (up to 30), sets how long the encrypted copy of a document and its reader's result are kept. When it ends, Scan still has the tables it read.
Older engine choice in a document's settings
In Scan → Engine, choose an available reader:
- Local parser / OCR uses embedded PDF text and the installed OCR engine.
- Docling service reads original pages and table layout, retaining cell positions where available. Availability depends on the configured service; a sleeping service can take longer to respond.
- Vision model sends original page images to the configured image-capable AI model. It first reads rows and text, then the shared extraction step builds typed JSON/table fields. Its evidence points to a page rather than an exact cell, so verify values against the original.
Unavailable engines are disabled. There is no silent fallback to another service or model. Document-processing consent and workspace data-access rules still apply. Docling hosted in the cloud is cloud processing; later AI mapping may use a separate provider. Labels cannot recover unreadable pixels. Docling reads the layout first; prompts, field definitions and table labels guide the later mapping. Vision reads the image with the brief only.
Move between preparation and testing
Scan keeps the original document visible on the left and the reader controls and JSON/CSV results on the right, matching Labels. Choose a reading engine and Scan document to start; simply opening the step does not process the document. Brief and Labels (optional) return to preparation with your draft and source labels retained. View gives the original the full workspace.
If a draft save fails, a message appears next to the step buttons. You can still return to Brief or Labels and correct it; running a test waits for a successful save. JSON field keys must be unique lowercase English identifiers such as test_result; display labels can use Hebrew or another language. Correct the input and save again, or choose Retry save for a temporary failure.
If another window changed the saved draft, AgentData does not overwrite it. Load saved draft asks before replacing your unsaved edits with the latest saved version. Choose it only when you want to keep that saved version. A saved message applies to a completed save; new edits must finish saving before you close or reload the page.
A simpler extraction loop
Start with the brief: describe the output columns and what one row represents. For a laboratory report, for example: “One row per test; include test name, result exactly as printed, units, reference range, test date and remarks. Keep inequality signs and leave unreadable or absent values empty.” This asks for transcription and structure, not medical interpretation.
Labels are optional. Start without labels. Draw a table label when a page has several tables and you want one of them; name the columns rather than drawing rows. No reader is retrained by drawing a rectangle.
In Scan, choose an engine and click Scan document. Inspect JSON or CSV / Table on the right beside the original. The result shows its row/value count, and each CSV table shows its own row count. Use Download JSON or Download CSV to export the full current result. Missing or rejected values remain empty and warnings remain visible. Return to Brief to change the instructions before rescanning.
Returning to Documents reuses recently loaded workspace data for up to one minute, while active processing continues to update. Use Refresh beside the document section title to check for new folders, files or scan history immediately. Saved changes update the related views automatically.
Brief, labels, scan, compare and history
- Brief: the single Extraction template field searches system and user templates and also lets you edit the current template name. System templates load a starting prompt; saved user templates load their instructions and label regions. Type a new name and choose Save template to rename the saved version. Templates lists system prompts and saved template names/descriptions; select a user template there to edit its name, description or prompt. To make a new template, type a new name into the search box and choose Create; this copies the current brief and labels into a separate template. Edit the prompt, then choose Save template. Saving an existing template creates a new version. The label count confirms that regions are included. Document details are collapsed; language and recognition checkboxes are under Language and recognition options, one option per row. The red Save button appears for pending document changes. Navigate directly between tabs; nothing scans automatically.
- Labels (optional): draw a field or a table. Drag the ↔ handle on a table label to move it. Arrow keys on the focused handle also move it. Movement stays within the page. Selecting a template for another document places its sample regions on that source for adjustment; these are guidance, never verified extracted values. Draft labels autosave.
- Scan: choose the engine at the top and press Scan document. Recognition uses the engine's automatic mode, without a second reader choice. The action remains above the scrolling results. The original stays on the left at the same size as Labels, with engine settings and results on the right. The progress bar shows that work is active, the current stage (saving, waiting, reading, or building JSON/CSV), and elapsed time. Engines do not report a reliable completion percentage, so the bar is indeterminate. In recognized-text mode, changing the original's page changes the displayed text page, loading more retained pages as needed.
- Compare: the left side starts with Original document; the right starts with the latest available structured scan. Both dropdowns are searchable and always keep Original document first, including while filtering. Retained scans show date, engine, model and [rows, extracted values]. A dash means the count is unavailable. Older pages of history load automatically. Choose original versus scan, or two scans. Each result has its own JSON/CSV choice and count; completion status appears in the Output preview header. Drag the divider to resize the two panes, or focus it and use the arrow keys. Original viewers have independent page and zoom controls. Each pane uses the available workspace height. Hide left pane or Hide right pane gives the other side the full width; use Show to restore it. At least one pane remains visible. Comparing does not run a scan or change your brief.
- Scan history: one full-width table shows date (
dd/mm/yy HH:MM), status, elapsed time, model, total input/output tokens, estimated USD, nodes and fields. Nodes counts repeating rows, or one document record when there are no repeating rows; Fields counts schema fields. Complete/partial describes structured coverage, not a guarantee of accuracy. Unknown costs and counts show—, not zero. Show opens Compare with that result on the left and the original on the right. Remove asks for confirmation, then removes the attempt from your history and scan selectors. It preserves the source, templates and shared processing/audit records; retained content still follows the normal retention policy. Running attempts cannot be removed. The Processing log remains collapsed below the table. Expired results cannot be opened.
Saved scan selects a retained result by date and model; Load older scans loads more history. Reopening a document restores its latest available structured result. A count of four rows means that particular saved run contains four rows; choosing a different engine does not change an old result. Run Scan document to create a new one. Separate diagnostic runs outside the application are not added to Scan history.
The compact header beside Process document stacks upload/discovery and last structured scan dates in two lines, in local dd/mm/yy HH:MM format. Provider/model information also uses two lines. Original files are not renamed when you change a template name.
Briefs and labels autosave privately for the current document. Failed saves remain visible; concurrent edits show a conflict rather than overwriting another window. Saving a reusable template is a separate action and includes its prompt, field mapping and label regions. Navigate between tabs while a scan runs; another scan waits until it finishes. Stop waiting releases the browser controls, but the server may still finish the scan—check History before retrying. If the gateway connection fails while extraction continues, AgentData checks History and recovers the matching result without starting a duplicate scan.
Use Expand output preview or Open output in a new window for a larger workspace. The output preview opens the same two-pane comparison surface, defaulting to the original on the left and the currently selected scan on the right. Each side can be hidden or changed independently. The Compare step also has these controls beside Hide left pane / Hide right pane; only the comparison controls and panes move into the window. Hide/show controls sit in the window header beside Close. Each result’s Output preview header also has compact icons to expand or detach just that result. Compare keeps its own selections when expanding or returning. Keep the main page open while using a separate window. The expanded window can be moved and resized; smaller screens stack the panels.
Template mapping shows the definition; Extraction details and evidence shows fields and review states. Previous scans retain their own mapping. If an old draft has incorrect columns, Brief → Rebuild layout from brief clears the draft field/label layout after confirmation, preserving the brief and saved template versions. Run Scan document to generate a new structure. Use Save and continue to extraction for the review workflow.
Scans require processing consent and a configured AI provider. Larger documents may use a sample when drafting the schema, while extraction processes the retained source within configured limits and reports partial coverage. Recognized text is diagnostic input; it is not the completed JSON/CSV result.
Example: blood-test rows
Choose General document in Brief and enter:
Extract one row per blood test: test name, result exactly as printed (including < or >), units, reference range, remarks and test date. Preserve Hebrew names and remarks. Leave missing or unclear values empty and flag them for review. Do not infer a date or clinical meaning.
Choose Scan document, inspect CSV / Table, and refine with instructions such as “Keep the Hebrew remarks” or “Add the date printed in the report header to each test row.” Inspect the original and source evidence before accepting values, especially signs, decimal separators, units and dates. This extracts reported data; it does not interpret the clinical significance of results.
Contract and policy skills help structure claims, obligations, remedies, limits and conditions. They do not determine legal entitlement or approve a claim. Check the original and evidence before relying on a result.
Choose a document type
Under Templates → Start with a document type, choose a starting draft and review its fields before saving:
| Starting template | What it extracts |
|---|---|
| Invoice | Invoice number, issue date, currency and total, plus each billed item and amount. |
| Contract | Parties, dates and repeated sections containing obligations, measures, thresholds and units. |
| Insurance policy | Policy identifier, insured party, effective dates, currency and repeated items with limits. |
Each draft provides different instructions and row definitions to the extraction model. Customize field definitions, required fields, number/date conventions and repeated groups for your documents. These drafts are starting points, not trained or certified templates.
Extracting a contractual threshold does not establish a violation: that requires evidence of actual performance and explicit comparison rules. Claim-to-policy comparison likewise requires matching identifiers, periods, currencies and items, plus exclusions and coverage rules. Automatic cross-template matching and coverage decisions are not currently available in Document Automation.
Label examples and evaluate extraction
- Parse the document and save a template first. If parsing is disabled, ask your tenant administrator to enable processing in Documents Automation settings.
- Open Review → Reviewed labels, then choose the template and a successfully or partially parsed document.
- Select the field to label. Click a highlighted word on the page image, then choose Attach selected evidence. The first selection fills the expected value; check and correct it. Attach additional words when needed, or select an exact passage under Extracted text.
- For repeating invoice items, contract sections, or policy items, add a row with a unique row key and label its fields separately.
- Enter a review reason and choose Approve and save labels. Only mark a field absent after complete parsing. If OCR missed the text, obtain a clearer original and reprocess; template rectangles cannot substitute for verified text evidence.
Suggestions are editable drafts; review them before approval. Keep calibration examples separate from unseen holdout documents.
The initial pilot uses 20 historical documents, including an unseen holdout subset. Measure field values, required coverage, evidence and repeated rows against approved labels. Snapshot agreement or a successful job alone is not an extraction-accuracy certificate.
Extract and review results
- Ask your tenant administrator to enable processing consent and retention in Settings & Monitoring → Settings → Documents Automation. Preview/extraction may transfer document contents to the application worker; the folder connector does not imply processing remains on your computer.
- In the document chat panel, choose Save and continue to extraction. The reviewed document parse and saved template version are selected for you. Alternatively, open Review → Extraction results and select them yourself. Supply any declared runtime inputs, then choose Extract fields. A progress indicator runs until extraction completes, and the completed result opens for review.
- Open Review result. Check required/unresolved counts, page coverage, source evidence, missing rows and conflicts. Open source page highlights the referenced evidence.
- Enter a reason when correcting, accepting or rejecting a result. Corrections and decisions create new revisions. Blocking or incomplete output cannot be accepted.
- Export accepted tables or download the JSON/CSV representations. Review states and source/result versions remain explicit.
Human acceptance is required. Changing templates, labels or execution configuration can make prior evaluation evidence stale; rerun affected checks.
Monitor and schedule folders
Disabling a schedule, or changing a folder policy to Manual, prevents its unfinished jobs from saving new parsing or extraction results after the change takes effect. Results already saved remain available. A provider request already in progress may finish, but its result is not saved if schedule approval has been revoked. Manual scans are independent of the folder schedule.
Click ⚙ beside a folder in the document explorer to open that folder in Folders & automation. Its Scanning setting decides how files are picked up:
- Manual: use Refresh to rescan, then Process document for an individual file.
- Automatic: AgentData checks for new or changed files every N minutes (5 or more) and queues parsing followed by extraction with the folder's template.
- Scheduled: the same, every N hours.
The extraction template is optional for manual scanning (you choose one when you process a document). Automatic scanning of PDFs and images needs one, because they can't yet be matched by header: choose a saved Extraction template in the folder card before enabling On change or Scheduled. Save a tested, structured template; a prompt-only draft must first be tested against an example and saved again. The folder pins that template version, including its extraction instructions and recognition profile. Changing a template creates a new version; choose and save the new version on the folder when you want to use it.
Automatic policies require processing consent and a running customer-side connector. They use periodic checks, not instant operating-system notifications. Each new or changed file is parsed and extracted using its mapped template. Unchanged versions are deduplicated. Complete structured output marks the file Done (green); partial or failed attempts remain in history/monitoring and do not replace a previous complete result. Completion does not automatically accept or publish results.
For recurring extraction with a specific template, open Review → Extraction results, select a template/version and runtime inputs, choose Scheduled folder and an interval, then Schedule folder. These extraction schedules remain independent of the folder's scan policy; the folder row indicates when additional extraction schedules exist.
Monitoring shows processing jobs and scan schedules, including failures and next-run times. Disable a schedule to stop its pending work. Consent or access changes can halt processing; after resolving the cause, save the folder policy again or recreate the extraction schedule. Review contains extracted results and their publication status.
Accepted outputs
Extracted values and review revisions are saved in the AgentData database. With tenant Git synchronization configured, new revisions are also committed under documents/projects/<project-id>/<document-id>/runs/<run-id>/revisions/<revision>/result.json inside the configured repository directory. Results show the Git synchronization state; a Git error does not remove the saved database result. Original files stay in their source folder. Download accepted JSON/CSV from Results; local or S3 folder-write permission is unnecessary. Git snapshots contain extracted values and review metadata, and follow the repository’s own history/retention.
Publish reviewed document tables for SQL
- Open an accepted result in Review. Under Publication, choose an authorized direct PostgreSQL destination.
- Choose Read connection for SQL queries for the same database. If none is listed, add the PostgreSQL connection in Connectors, assign it to this project, and refresh the destinations. Its database account must be able to read the published tables. Write and read accounts may have different permissions.
- Enter a destination table name for each output table and choose Publish accepted result. AgentData adds a tenant/project prefix to the physical names and preserves the declared column types and row keys.
- Wait for a successful receipt, then choose Open … in Datasets / SQL. Publication checks read access before reporting the dataset as ready. If registration fails after the database write, fix the reported issue and retry the publication; retrying does not duplicate the rows.
A later reviewed run for the same source path, template version and runtime inputs replaces that document's previously published rows, including removed child rows. Other documents remain intact. Only the current explicitly approved version can be published. To restore an older validated scan, approve it again and queue its publication; its rows replace the previously published version without adding another copy. Changing a template version or table schema requires a new destination table name; existing tables are not silently migrated.
Compare document data with relational data
Open Datasets / SQL, select a published dataset, then optionally choose a confirmed relational table on the same read connection. Discover and confirm the reference table in the semantic model first if it is missing.
Choose explicit matching keys—for example, a test code and unit, or a policy item, currency and period. Add multiple keys where needed. Keep unmatched document rows uses a left join; unmatched reference values appear as NULL. Matching rows only excludes them. Names, currencies and units are not matched or converted automatically.
Choose All rows to inspect the joined values, or select a comparison and its document/reference columns. Run SQL query displays the rows and lets you expand the generated SQL and parameters. Queries are read-only and bounded; a message appears if the row limit is reached. Results are from the last query; rerun after changing the controls.
Editors may save the matching keys in the semantic model. Choose the relationship cardinality; AgentData checks uniqueness on the declared “one” side before saving. Published tables are registered as semantic entities, and their Cube/dbt YAML and saved relationships use the tenant's configured Git synchronization. Future changes to reference data may change key uniqueness, so maintain the reference database's constraints as well.
This screen supports comparisons within one PostgreSQL read connection. Cross-database semantic joins require the separately configured federation capability. Only reviewed, published rows are queried: unpublished documents and unresolved extraction results are not part of the dataset. A query result does not certify complete folder coverage.
Keep numeric qualifiers and original text
For values such as <0.5, keep the original field as text. In the extraction preview's CSV / Table view, choose Add numeric columns for that text field. AgentData adds a numeric value and operator derived from the same source evidence. Run Scan document again, then save and extract using the updated template.
For example, <0.5 becomes original text <0.5, numeric bound 0.5, and operator <. An unqualified 92 produces 92 and =. Missing values remain missing. Ambiguous ranges, prose or undeclared number formats require review rather than a guessed number. Set an explicit numeric locale in the template schema for locale-dependent separators.
Numeric comparison filters exclude qualified bounds and missing values; All rows retains them for inspection. No medical, legal or financial interpretation is inferred. Chat revisions preserve existing types, required fields, validation rules, runtime inputs and output mappings. Remove fields or change their types/groups in the template schema editor before asking chat to revise the instructions.
Automatic Flow events and automatic acceptance remain unavailable.
Troubleshooting
| State or issue | What to do |
|---|---|
| Processing disabled | Ask a tenant administrator to review and enable processing consent. |
| Not scanned / empty inventory | Confirm the folder contains supported documents, then scan. |
| Partial scan | Resolve the reported access or inventory-limit issue before relying on the count. |
| Connector offline | Start the connector and check its local configuration, then rescan. |
| Unsupported / blocked file | Check its format and path. Safe document reads reject symlinks and special files. |
| Original changed since scan | Rescan before opening or processing the new version. |
| Queue or transfer limit | Wait for existing work or ask the administrator to review configured limits. |
DOC-PARSER-FAILED / parser memory limit | Choose Process document → Scan → Scan document after the issue is resolved. Check the processing log; if it repeats, share the error code with your administrator. A failed job does not certify or accept output. |
| Incomplete parsing / OCR | Review page coverage and issues; reprocess after the issue is resolved. |
| Expired artifact | Reprocess the authorized original; an expired retained artifact cannot be recovered through its old result. |
| No recognized text / rotated or unclear scan | Correct orientation or supply a clearer scan, reprocess, and review numeric values against the image. A completed parse does not certify OCR accuracy. |
Access is scoped to tenant/project and rechecked when reading originals, results and exports. Full enterprise delegated document access, Windows document-folder access and customer/provider certification remain separate availability gates. See Enterprise identity for supported identity behavior.
For versioned App and Data Flow authoring, test results and activation, see Apps and Data Flow Notebooks.
If a document preview fails
Choose Retry preview after checking that your folder connector is running. AgentData shows the reason when the source changed or a rendering limit was reached. For a changed file, open Connectors, scan the folder, then reopen the document. Download original is available for viewing the source locally. A failed preview is not marked as processed, and retries do not discard your unsaved template labels.
Preview speed and document storage
The first view reads the original from its source and renders a page image. A local folder connector must be online; transfer time and large or complex PDFs can affect loading. During the browser session, recently viewed pages are reused across sections while the inventory’s file identity, modification time and size remain unchanged. Switching tenant/project or refreshing invalidates the relevant cache. When the browser requests a preview, the server checks current file metadata before reusing cached bytes or a rendered page; changed, removed or unreadable sources are rejected until you refresh the folder. Connector metadata checks can still require a round trip. A first view, changed file or expired cache still checks access and reads the source, so those requests can involve a connector round trip.
Local-folder originals remain on your machine. Managed uploads and retained original copies used for extraction are encrypted in AgentData’s database and subject to retention limits. Structured extraction results are also stored in the database. Simply viewing a local file does not permanently import its original into the database. More storage is only needed when capacity or quota is the problem; it does not by itself speed up connector transfers or PDF rendering.
Monitor documents from inventory to publication
Open Monitoring → Document processing overview and choose a connected folder or managed-upload folder. The file total matches the inventory visible to you, including unsupported, blocked or oversized files. An incomplete or unavailable scan is shown separately; when available, the previous usable inventory remains visible. Page navigation stays pinned to that inventory so a concurrent scan cannot skip or duplicate files. Refresh returns to the latest inventory.
Each row separates processing status, required fields found/total, extraction template/model, review decision and publication state. A successful scan is not an accepted result or a successful database publication. If an earlier result was published and the review changed, the row says Earlier result published. Required counts describe detected document/row slots; they do not prove that every source row was detected.
Elapsed time and USD estimates refer to the latest extraction, or your own latest trial when no extraction exists. Unknown or unconfirmed costs display —. Select View to inspect the source or Review result to open its review and publication controls. Expand Processing jobs for queue/cancellation details; recurring rules remain below. The overview returns operational counts and metadata, without extracted values.
Send accepted rows to a Flow
In Review, open an accepted result, expand Send accepted rows to a Flow, and choose an enabled Flow with an AgentData input. Select one accepted output table and map its columns to the Flow's required input fields. Queue Flow handoff submits that exact accepted revision; selecting a Flow does not run it.
Configure input field types in Data Flows → Data API before connecting a Flow. Direct mappings preserve declared string values, including numeric-looking identifiers; explicit Flow transformations and target types still apply. Decimal inputs use exact decimal strings. Existing destination column types must also match the intended data.
The publication list shows the handoff separately from extraction and review. Open Flow request / output selects its request ID in Data API, where Read output reads the retained bounded output. A repeated delivery reuses the same Flow request. Changes to the accepted revision, enabled interface, executable graph or row actions require reviewing a new handoff.
A Flow may contain several independently committed steps. If execution fails or its outcome is uncertain, inspect that request before retrying; AgentData does not blindly restart it. Use direct table publication when all declared document tables must commit in one supported PostgreSQL transaction. Failed handoffs preserve the extraction and review history.
Final results
Each document keeps one selected final result. Filter the file list by Done to see the documents that have one, and open a document to inspect it. Field coverage is the percentage of required fields populated; it does not prove factual accuracy or that every row in the source was found.
Before any explicit approval, a new complete scan becomes the default final version. A failed or partial scan does not replace it. Once a version is approved, it stays current until you explicitly approve another validated version. Before approval, Use as final in Scan history lets you select an older complete preview. Other scan versions remain available for comparison. Selecting a final version changes preview and explicitly unreviewed Doc2SQL reads; previously published external database tables are updated through the publication workflow. Doc2SQL data consumers use this selection, so rerunning a document does not multiply its rows across scan versions.
Completion is a status in AgentData. The original file stays in its source folder. Structured scan versions are saved separately from temporary original copies and private conversations. Old scans whose payloads already expired cannot be reconstructed from their history counts: rescan the original. A saved result does not restore an expired original preview. Access still requires permission to the source and project.
Save and map a reusable template
Saving a document brief is different from Save template. In Brief, enter a template name, save it, and find it under Templates and the user-template selector. A prompt-only template is a draft. Scan an example, check the columns and repeating rows, then save the structured template version before enabling automatic extraction.
To use a separate blood-test folder, open Connect folder, choose the local connector and browse to an existing folder. Alternatively enter New folder inside the selected folder and choose Create and connect folder. Folder creation requires a connector advertising this capability and local write permissions. Older native installations need an updated connector; you can also create the folder directly on the machine and select it in AgentData. Creating a folder does not overwrite existing files.
Attach the folder, choose the tested blood-test template in its row, choose On change or Scheduled, and save. The source connection, folder path and extraction template are separate choices: one connector can serve several folders with different templates.
Use Doc2SQL from another application
Create an API key in Conversation → Query → Connect (MCP) and bind it to the intended project. Use read to discover folders/results, query for filtered results and counts, and explicitly enable Upload documents (documents:write) for ingestion. Uploads require an editor or administrator-owned key. The key's stored project and tenant determine access.
REST requests use Authorization: Bearer <key> against your AgentData backend URL:
| Method and path | Purpose |
|---|---|
GET /api/doc2sql/folders | Folder IDs, pinned templates and scan policies |
GET /api/doc2sql/folders/{id}/documents | Inventoried files and processing status |
POST /api/doc2sql/folders/{id}/documents?name=report.pdf | Raw PDF/PNG/JPEG upload to a managed upload folder |
GET /api/doc2sql/documents | One final result per document; follow next_cursor using after |
GET /api/doc2sql/documents/{id} | Current typed tables, schema, provenance and review state |
GET /api/doc2sql/documents/{id}/scans | Saved structured scan versions |
POST /api/doc2sql/query | Equality filters and exact row/document/distinct-value counts |
Supply Idempotency-Key: <your-unique-upload-id> when uploading; reuse it for retries of the same file. Create a managed upload folder in Document Automation first, map its tested template and enable On change. Uploading wakes that folder's enabled change schedule. Processing is asynchronous; poll the folder inventory and then the final result. Scheduled folders run at their configured interval; manual folders require a user to start processing.
For queries, read a result first to discover the actual template_key, table and column names. A request takes this shape:
{
"template_key": "blood_tests",
"table": "test_results",
"filters": {"patient_id": "your-patient-id"},
"distinct_column": "patient_id",
"accepted_only": true
}
The names above are examples, not built-in fields. Include a consistent patient identifier in your template when you need patient-level counts or filters; the service does not infer patient identity. Results include exact matching row/document counts and an optional distinct-value count. Returned rows may be capped (truncated); exceeding the corpus processing limit produces an explicit error instead of an incomplete count. Queries use the last explicitly approved version of each document by default. A newer unapproved scan does not remove or replace the approved data. Set accepted_only: false explicitly when testing complete but unreviewed results. Use the Review workflow before publishing or treating output as accepted data.
The public AgentData MCP exposes the same operations: list_document_folders, list_document_files, list_completed_documents, list_document_scans, read_document_result, query_documents and upload_document. MCP uploads accept base64 content and a request_id. The existing read/query grants cover discovery and querying; upload requires the explicit project-bound write key. Ask your client to inspect the actual schema before answering questions such as “How many distinct patients have results?” or “Show this patient's tests.” These tools return extracted data, not medical interpretation.
Approve a scan and see the approved version
Open the document, choose Process document → Compare, and choose a saved scan on either side. Review the output against the original, then choose Approve and use this version and confirm. Last approved version shows the approval date; View approved version opens it. The same approval control is available under the scan output. Scan history marks the approved version.
Approval is separate from Use as final, which selects an unreviewed preview when no approved version exists. Once a version is approved, a newer scan remains a candidate in History and Compare. Approve the replacement explicitly to make it current for preview and approved-data queries. Partial scans and scans with unresolved blocking validation issues cannot be approved; the visible message explains why. Approval does not automatically republish external SQL tables.
Create a folder, assign a template and enable automation
- In Folders & automation, click Folder on the root folder (or any folder that supports sub-folders) and enter a name.
- Open the new folder (▸) → Settings → Template, and choose your saved extraction template, for example the blood-test template.
- Under Scanning, choose Automatic (every N minutes) or Scheduled (every N hours). The change is saved immediately.
- Upload files into it, or move files there by drag and drop. Complete output marks the file Done; partial output remains available for review. Results require explicit approval before approved-data queries use them.
If automatic scanning can't start, the message under the settings names the missing prerequisite: an image template, enabled document processing, or a tested structured template instead of a prompt-only draft.
Follow a running scan and refresh folders
Scanning has two stages: reading the original with the selected engine, then building JSON/CSV with the configured language model. During the second stage, the progress bar shows processed batches out of the total. A multi-page document can need several model calls and take several minutes even after Docling has finished. A partial result means some coverage or validation checks remain unresolved; review it before use.
Empty sub-folders appear after Refresh, which discovers folders and files without starting OCR or LLM extraction. Use it after creating a folder directly on the machine. To give a sub-folder its own template or scanning, add it with Folder and open its settings.
Interrupted scans
A scan that loses its worker cannot remain running indefinitely. When its processing deadline is reached, history reports a failed attempt. Previous saved results remain available. Retry after checking the failure; starting a retry does not approve its output.