Spreadsheet-first agent: the grid is the main UI with a floating copilot. Demo samples only (no uploads). The agent emits deterministic clean/transform ops applied client-side, charts results, and exports a multi-sheet .xlsx.
Requirements, wiring steps, and what this pattern adds to your project.
Pick how you want to pull this pattern in. Then wire env vars and routes the same way.
Download → Next.js app
Use Download → Next.js app in the preview toolbar. You get a zip scaffold (Pro downloads rewrite preview `/view/.../api/*` paths to `/api/*` automatically).
Extract the zip and install dependencies
Unzip the archive, then run `pnpm install` (or npm / yarn) in the project folder.
Fill .env.local
The download includes .env.local placeholders when needed. Add real values for: AI_GATEWAY_API_KEY.
Customize the agent and tool files
Adapt prompts, tools, and stop conditions in the generated project for your product.
Run the app and open the pattern route
Run `pnpm dev`, open the setup/checklist page if present, then navigate to the generated pattern route and verify responses.
AI_GATEWAY_API_KEYGet keyAI SDK APIs
ToolLoopAgentcreateAgentUIStreamResponsegatewaytooluseChatInferAgentUIMessageProviders
External services
app/page.tsxapp/layout.tsxapp/api/spreadsheet-agent/route.tsapp/api/spreadsheet-cells/route.tscomponents/ai-cell.tsxcomponents/column-resize-handle.tsxcomponents/formula-bar.tsxcomponents/formula-editor.tsxcomponents/grid-context-menu.tsxcomponents/cell-editor.tsxcomponents/column-header-menu.tsxcomponents/find-bar.tsxcomponents/grid-header.tsxlib/grid/column-actions.tslib/grid/column-stats.tslib/grid/fill.tslib/grid/find.tslib/grid/formats.tslib/grid/formula-colors.tslib/grid/grid-keys.tslib/grid/use-find.tslib/grid/use-formula-editing.tslib/grid/use-sheet-view.tslib/grid/use-row-window.tslib/grid/stored-state.tslib/grid/filters.tscomponents/selection-stats.tsxcomponents/sheet-status-bar.tsxcomponents/sheet-toolbar.tsxlib/grid/column-widths.tslib/grid/types.tslib/grid/use-grid-editing.tslib/sheet/commands.tslib/sheet/formulas.tslib/sheet/formula-syntax.tslib/sheet/row-ops.tslib/cells/types.tslib/cells/ai-ops.tslib/cells/run-jobs.tslib/cells/use-cell-runner.tscomponents/spreadsheet-agent-demo.tsxcomponents/spreadsheet-copilot.tsxcomponents/workbook-chart.tsxcomponents/data-grid-preview.tsxcomponents/step-log.tsxlib/sheet/types.tslib/sheet/reducer.tslib/sheet/replay.tslib/sheet/diff.tslib/sheet/scope.tslib/sheet/persistence.tslib/sheet/tool-results.tslib/sheet/use-sheet.tslib/sheet/use-flash-cells.tslib/sheet/use-undo-shortcuts.tslib/ai/spreadsheet-agent.tslib/ai/tools/apply-operations.tslib/ai/tools/render-chart.tslib/ai/tools/summarize-findings.tslib/ops/schema.tslib/ops/engine.tslib/parse-file.tslib/samples.tslib/sample-data/orders.tslib/sample-data/pipeline.tslib/sample-data/reviews.tslib/sample-data/support.tslib/sample-data/tweets.tslib/selection.tslib/profile.tslib/xlsx-export.tslib/types.tslib/rate-limit.tslib/request-utils.tsREADME.mdnpm packages
10
Registry components
ai/spreadsheet-agent.tsToolLoopAgent that receives a compact data profile via callOptions and emits applyOperations, renderChart, and summarizeFindings tools. Client applies ops to the full dataset.
ops/engine.tsPure deterministic ops engine (drop/rename/fill/dedupe/cast/trim/filter/sort/computed/aggregate) plus buildChartData. Keep data local; never send full rows to the server.
spreadsheet-agent/route.tsAPI route using createAgentUIStreamResponse with profile callOptions and Upstash rate limiting.
Spreadsheet-first agent: the grid is the main UI with a floating copilot. Demo samples only (no uploads). The agent emits deterministic clean/transform ops applied client-side, charts results, and exports a multi-sheet .xlsx.
Requirements, wiring steps, and what this pattern adds to your project.
Pick how you want to pull this pattern in. Then wire env vars and routes the same way.
Download → Next.js app
Use Download → Next.js app in the preview toolbar. You get a zip scaffold (Pro downloads rewrite preview `/view/.../api/*` paths to `/api/*` automatically).
Extract the zip and install dependencies
Unzip the archive, then run `pnpm install` (or npm / yarn) in the project folder.
Fill .env.local
The download includes .env.local placeholders when needed. Add real values for: AI_GATEWAY_API_KEY.
Customize the agent and tool files
Adapt prompts, tools, and stop conditions in the generated project for your product.
Run the app and open the pattern route
Run `pnpm dev`, open the setup/checklist page if present, then navigate to the generated pattern route and verify responses.
AI_GATEWAY_API_KEYGet keyAI SDK APIs
ToolLoopAgentcreateAgentUIStreamResponsegatewaytooluseChatInferAgentUIMessageProviders
External services
app/page.tsxapp/layout.tsxapp/api/spreadsheet-agent/route.tsapp/api/spreadsheet-cells/route.tscomponents/ai-cell.tsxcomponents/column-resize-handle.tsxcomponents/formula-bar.tsxcomponents/formula-editor.tsxcomponents/grid-context-menu.tsxcomponents/cell-editor.tsxcomponents/column-header-menu.tsxcomponents/find-bar.tsxcomponents/grid-header.tsxlib/grid/column-actions.tslib/grid/column-stats.tslib/grid/fill.tslib/grid/find.tslib/grid/formats.tslib/grid/formula-colors.tslib/grid/grid-keys.tslib/grid/use-find.tslib/grid/use-formula-editing.tslib/grid/use-sheet-view.tslib/grid/use-row-window.tslib/grid/stored-state.tslib/grid/filters.tscomponents/selection-stats.tsxcomponents/sheet-status-bar.tsxcomponents/sheet-toolbar.tsxlib/grid/column-widths.tslib/grid/types.tslib/grid/use-grid-editing.tslib/sheet/commands.tslib/sheet/formulas.tslib/sheet/formula-syntax.tslib/sheet/row-ops.tslib/cells/types.tslib/cells/ai-ops.tslib/cells/run-jobs.tslib/cells/use-cell-runner.tscomponents/spreadsheet-agent-demo.tsxcomponents/spreadsheet-copilot.tsxcomponents/workbook-chart.tsxcomponents/data-grid-preview.tsxcomponents/step-log.tsxlib/sheet/types.tslib/sheet/reducer.tslib/sheet/replay.tslib/sheet/diff.tslib/sheet/scope.tslib/sheet/persistence.tslib/sheet/tool-results.tslib/sheet/use-sheet.tslib/sheet/use-flash-cells.tslib/sheet/use-undo-shortcuts.tslib/ai/spreadsheet-agent.tslib/ai/tools/apply-operations.tslib/ai/tools/render-chart.tslib/ai/tools/summarize-findings.tslib/ops/schema.tslib/ops/engine.tslib/parse-file.tslib/samples.tslib/sample-data/orders.tslib/sample-data/pipeline.tslib/sample-data/reviews.tslib/sample-data/support.tslib/sample-data/tweets.tslib/selection.tslib/profile.tslib/xlsx-export.tslib/types.tslib/rate-limit.tslib/request-utils.tsREADME.mdnpm packages
10
Registry components
ai/spreadsheet-agent.tsToolLoopAgent that receives a compact data profile via callOptions and emits applyOperations, renderChart, and summarizeFindings tools. Client applies ops to the full dataset.
ops/engine.tsPure deterministic ops engine (drop/rename/fill/dedupe/cast/trim/filter/sort/computed/aggregate) plus buildChartData. Keep data local; never send full rows to the server.
spreadsheet-agent/route.tsAPI route using createAgentUIStreamResponse with profile callOptions and Upstash rate limiting.
Loading preview…
Early-bird pricing — limited time


Open on desktop for the interactive preview.
Spreadsheet-first agent: the grid is the main UI with a floating copilot. Demo samples only (no uploads). The agent emits deterministic clean/transform ops applied client-side, charts results, and exports a multi-sheet .xlsx.
Loading preview…
Early-bird pricing — limited time


Open on desktop for the interactive preview.
Spreadsheet-first agent: the grid is the main UI with a floating copilot. Demo samples only (no uploads). The agent emits deterministic clean/transform ops applied client-side, charts results, and exports a multi-sheet .xlsx.