Sketch-Intent-Driven Smart Office: Whiteboards, Spreadsheets, and Data Analysis

    This article examines how multimodal, sketch-based input can drive office workflows across whiteboards, spreadsheets, and data analysis. It covers the system architecture, sketch-to-intent parsing, traceable spreadsheet edits, and the engineering boundaries of natural-language data queries, with practical structures and code examples for building verifiable and controllable workflows.

    Introduction: From Text Commands to Visual Expression

    When users interact with intelligent assistants, they usually need to describe their requirements clearly in text. For tasks with spatial relationships, such as flowcharts, project schedules, and budget structures, text descriptions are costly to write and easy to miss details. In the past year or two, multimodal input has gradually entered office scenarios. Users can select regions, draw arrows casually, and then add explanations by voice. This interaction shifts the burden of “how to describe accurately” from the user to the system.

    This article uses the chain of “whiteboards, spreadsheets, and data analysis” as an example to break down the core technical components of such systems and discuss engineering implementation points and risk control methods.

    Overall Architecture

    An intelligent collaboration system for office scenarios is typically divided into four layers:

    1. Input layer: Receives text, voice, handwriting strokes, and canvas graphics, and records the regions selected by the user.
    2. Understanding layer: Converts multimodal input into a unified structured intent representation, including task type, entities, constraints, and modification scope.
    3. Execution layer: Calls capabilities such as document generation, spreadsheet operations, and data queries to turn intent into concrete artifacts.
    4. Collaboration and audit layer: Handles concurrent multi-user editing, version records, and change tracking.

    The interfaces between layers should be stable and verifiable. The output of the understanding layer should ideally be a data structure with a clear schema, not free text. Otherwise, the execution layer cannot determine whether an operation is valid.

    From Sketches to Structured Intent

    After handwritten content enters the system, layout parsing is the first step. Common approaches include:

    • Shape recognition: Distinguishing basic elements such as rectangles, arrows, circles, and text boxes;
    • Text recognition: Running OCR on handwritten or printed text and preserving its coordinates on the canvas;
    • Relationship inference: Determining the order or dependency between nodes based on the start and end positions of arrows;
    • Region annotation: Recording the range selected by the user and limiting modification instructions to that range.

    After parsing, the system generates an intermediate representation. The following schematic structure uses field names defined for this article and does not represent any specific product interface:

    1. {
    2. "intent": "generate_timeline",
    3. "scope": {"type": "region", "bbox": [120, 80, 640, 420]},
    4. "entities": [
    5. {"id": "t1", "label": "Flavor finalization", "owner": "R&D team", "due": "2026-12-01"},
    6. {"id": "t2", "label": "Cost accounting", "owner": "Finance team", "due": "2026-12-03"}
    7. ],
    8. "dependencies": [{"from": "t1", "to": "t2"}],
    9. "constraints": {"deadline": "2026-12-06", "ambiguous_fields": ["owner"]}
    10. }

    The ambiguous_fields field is critical. When information such as owners or dates cannot be determined from the sketch, the system should list items that need confirmation rather than filling them in arbitrarily. This principle can significantly reduce later rework.

    Spreadsheet Generation and Traceable Edits

    Generating a spreadsheet from natural language or structured intent usually includes the following steps:

    1. Determine the worksheet structure, such as summary sheets, detail sheets, and aggregation sheets;
    2. Specify the data type, validation rules, and display format for each column;
    3. Write formulas and check whether cross-sheet references are correct;
    4. Add interactive elements such as dropdown options and conditional formatting.

    After generation, users will continue to request modifications, such as adding a balance column or highlighting overdue tasks. The core here is change tracking. It is recommended to record changes at the cell level as the smallest granularity, saving the old value, new value, operation source, and timestamp for each modification. Users can use this to check where changes were made and to support rollback.

    Example code:

    1. from dataclasses import dataclass
    2. from datetime import datetime
    3. @dataclass
    4. class CellChange:
    5. sheet: str
    6. cell: str
    7. old_value: object
    8. new_value: object
    9. source: str # "user" or "assistant"
    10. timestamp: datetime
    11. def apply_change(sheet_store, change: CellChange):
    12. current = sheet_store.get(change.sheet, change.cell)
    13. if current != change.old_value:
    14. raise RuntimeError("Cell has already been modified. Please refresh and try again.")
    15. sheet_store.set(change.sheet, change.cell, change.new_value)
    16. sheet_store.append_log(change)

    This code follows an optimistic concurrency control approach: it compares the old value before writing and rejects the write if a conflict is found, preventing silent overwrites of other users’ changes.

    Export also requires attention to format compatibility. CSV is suitable for pure data exchange but loses formulas and styles. To preserve the full structure, choose a general spreadsheet format that supports multiple worksheets, formulas, and styles, and perform a structure validation before export.

    Data Analysis: Boundaries of Natural-Language Queries

    After connecting enterprise data sources, users can ask about sales for a certain quarter in natural language. This type of capability is often called text-to-SQL or semantic query. Engineering teams need to address three issues.

    First, semantic mapping. When business users say “sales,” it may correspond to multiple fields across multiple tables. The system should maintain a semantic layer that maps business terms to standard metric definitions and clarifies the calculation basis, such as whether returns are deducted and whether tax is included.

    Second, permission control. Queries must execute within the user’s permission scope, and statements generated by the model must not bypass row-level permissions. It is recommended to apply filtering conditions uniformly at the database or query gateway rather than relying on the model to comply voluntarily.

    Third, result validation. Generated queries should be shown to the user for confirmation, along with the tables used, time range, and filter conditions. Below is a parameterized schematic query:

    1. SELECT region, SUM(amount) AS total_sales
    2. FROM sales_orders
    3. WHERE order_date >= :quarter_start
    4. AND order_date < :quarter_end
    5. AND org_id = :current_org_id -- injected by the access gateway, not generated by the model
    6. GROUP BY region;

    Parameters are bound by the program rather than concatenated as strings, reducing injection risk. The gateway injects org_id based on user identity, and the model output is not allowed to specify this value on its own.