Files

hm_tabular

Query spreadsheets you've uploaded — outline, exact ranges, search and formula lineage

When you upload a spreadsheet, HyperMemory processes it into workbooks, sheets and regions (the tables and blocks inside a sheet), keeping values, number formats and formulas. hm_tabular lets an agent read that structure precisely instead of guessing from a summary.

Spreadsheet querying is being extended. Today, for a processed Excel workbook every mode returns the workbook’s processed structure (its manifest); for a CSV file range and search read the cells directly, and trace returns no lineage because CSV files have no formulas.

Modes

modeWhat it returnsRequires
outlineThe workbook → sheet → region hierarchy.file_id
rangeThe exact cells of a bounded A1 range.file_id, sheet, range
searchRegions, headers, labels, displayed values, number formats and formulas that match a query.file_id, query
traceThe calculation lineage of one cell: what it depends on (precedents) or what depends on it (dependents). Lineage is followed, not evaluated.file_id, sheet, cell

Parameters

ParameterTypeDefaultUsed byDescription
modestringrequiredalloutline, range, search or trace.
file_idstringrequiredallThe file’s id from hm_upload_file or hm_list_files.
include_regionsbooleantrueoutlineInclude the regions inside each sheet.
max_sheetsinteger250outlineMaximum sheets (1–500).
sheetstring—range, traceSheet name.
rangestring—rangeAn A1 range, e.g. B2:F40.
max_cellsinteger2000rangeMaximum cells (1–2000).
querystring—searchWhat to look for.
limitinteger25searchMaximum matches (1–50).
cellstring—traceThe starting cell, e.g. F12.
directionprecedents | dependentsprecedentstraceWhich way to follow the lineage.
max_depthinteger6traceHow many steps to follow (1–8).
max_nodesinteger200traceMaximum cells in the lineage (1–500).

Examples

{ "mode": "outline", "file_id": "file_01JBX7Q2" }
{ "mode": "range", "file_id": "file_01JBX7Q2", "sheet": "Forecast", "range": "A1:H24" }
{ "mode": "trace", "file_id": "file_01JBX7Q2", "sheet": "Forecast", "cell": "H24", "direction": "precedents" }

Equivalents

Each mode has its own REST route — POST /api/v1/memory/tabular/outline, /tabular/range, /tabular/search and /tabular/trace — and the JSON body still includes mode.

hm tabular outline file_01JBX7Q2
hm tabular range file_01JBX7Q2 --sheet Forecast --range A1:H24
hm tabular search file_01JBX7Q2 "net revenue"
hm tabular trace file_01JBX7Q2 --sheet Forecast --cell H24 --direction precedents