AI & Automation
AI Assistant Context Window Sizing: 40x12 Selection Scan, 160-Cell & 14 KB Caps
Audit how Arte Sheets scopes live worksheet context for AI Assistant text and voice prompts—scanning up to 40x12 selected cells plus A1:H12 headers within a 160-cell, 14,000-byte, and 30-sheet-tab budget.
Why selecting the exact target table beats highlighting an entire 5,000-row sheet
To keep prompts fast and never serialize an entire multi-thousand-row workbook unnecessarily, Arte Sheets builds a bounded live snapshot for each AI Assistant turn (both typed prompts and bounded <= 3-minute WebRTC voice sessions). First, it scans your active selection up to 40 rows (r1..r1+39) by 12 columns (c1..c1+11), and then supplements any unseen cells from the top-left A1:H12 header anchor (12 rows x 8 columns) so column headers remain visible even when your cursor sits lower on the sheet.
Blank cells are skipped automatically; each non-empty cell serializes its address, up to 300 characters of raw input/formula, and up to 100 characters of formatted display value until reaching either 160 non-empty cells or 14,000 UTF-8 JSON bytes (alongside up to 30 sheet-tab names/IDs). Knowing these exact thresholds lets analysts highlight focused summary blocks or KPI ranges so every relevant formula cell arrives in context without hitting the 160-cell or 14 KB cap.
| Context Snapshot Dimension | Engine Bound | Practical Prompting Tip |
|---|---|---|
| Active Selection Window | Up to 40 rows x 12 columns | Select the specific table/KPI block rather than 1,000+ rows |
| Top-Left Anchor Fallback | A1:H12 (12 rows x 8 columns, deduplicated) | Keep schema headers or model assumptions near A1:H12 |
| Serialized Non-Empty Cells | <= 160 cells and <= 14,000 UTF-8 bytes | Long 300-char formulas consume the 14 KB byte cap faster |
| Workbook Tab Directory | First 30 sheets ({id, name}) | Place active AI target tabs among the leading 30 sheets |
Deduplicated Coordinate Scan Window Formula
Combine MIN(rows, 40) * MIN(cols, 12) from the active selection with the 96-cell A1:H12 anchor minus any overlapping coordinates B4.
=MAX(0, (MIN(B2, 40) * MIN(B3, 12)) + 96 - B4)Effective Serialized Cell Count & Truncation Driver Formula
Compare estimated non-empty cells inside the scan window against both the 160-cell cap and INT(14000 / avg_json_bytes_per_cell) to see which bound governs.
=LET(est_nonempty, INT(E3 * B5), byte_cap_cells, INT(14000 / MAX(1, B6)), MIN(160, MIN(est_nonempty, byte_cap_cells)))Try the example
Use the original values or change them to test your understanding.