Spreadsheet editor with AI chat for data analysis and manipulation. Edit tables through conversation.
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: OPENAI_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.
OPENAI_API_KEYGet keyAI SDK APIs
streamTexttoolconvertToModelMessagesgenerateTextProviders
External services
app/page.tsxapp/layout.tsxapp/api/artifact-table/route.tscomponents/expandable-panel.tsxcomponents/panel-left-chat.tsxcomponents/chat-message-input.tsxcomponents/chat-message-list.tsxcomponents/intro-heading.tsxcomponents/panel-right-artifact.tsxcomponents/sheet-editor.tsxcomponents/table-artifact-loading.tsxcomponents/table-artifact.tsxcomponents/table-chat.tsxcomponents/table-artifact-mobile.tsxcomponents/table-artifact-context.tsxhooks/use-artifact-panel-state.tsxhooks/use-table-editor-artifact.tslib/ai/artifacts/table-editor.tslib/ai/context.tslib/ai/tools/index.tslib/ai/tools/table-editor.tslib/error-handler.tslib/ai/types.tslib/sheet-utils.tsREADME.mdnpm packages
8
Registry components
artifact-table/route.tsAPI route for the table artifact system. Uses runWithContext for AsyncLocalStorage-based context management. Implements hydrateContextFromMessages to restore previous table state. Configures streamText with tableEditor and addData tools.
tools/table-editor.tsMassive tool implementation containing addDataTool and tableEditorTool (handles create, add_column, filter_rows, sort_data, calculate, clean_data, edit_column, merge_data operations). Implements CSV parsing, column profiling, data transformations, and progressive artifact streaming.
artifacts/table-editor.tsDefines the TableEditorArtifact using the artifact() helper. Contains the comprehensive Zod schema for table editor state: title, stage, csvContent, summary, operations, version history.
ai/context.tsAsyncLocalStorage-based context management for the artifact system. Provides runWithContext, getContext, getWriter, and artifact data accessors.
lib/sheet-utils.tsCore spreadsheet utility library: CSV parsing with fallback, row normalization, Excel-style column reference resolution, filter predicate builder, value type coercion, and automatic column type detection.
Spreadsheet editor with AI chat for data analysis and manipulation. Edit tables through conversation.
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: OPENAI_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.
OPENAI_API_KEYGet keyAI SDK APIs
streamTexttoolconvertToModelMessagesgenerateTextProviders
External services
app/page.tsxapp/layout.tsxapp/api/artifact-table/route.tscomponents/expandable-panel.tsxcomponents/panel-left-chat.tsxcomponents/chat-message-input.tsxcomponents/chat-message-list.tsxcomponents/intro-heading.tsxcomponents/panel-right-artifact.tsxcomponents/sheet-editor.tsxcomponents/table-artifact-loading.tsxcomponents/table-artifact.tsxcomponents/table-chat.tsxcomponents/table-artifact-mobile.tsxcomponents/table-artifact-context.tsxhooks/use-artifact-panel-state.tsxhooks/use-table-editor-artifact.tslib/ai/artifacts/table-editor.tslib/ai/context.tslib/ai/tools/index.tslib/ai/tools/table-editor.tslib/error-handler.tslib/ai/types.tslib/sheet-utils.tsREADME.mdnpm packages
8
Registry components
artifact-table/route.tsAPI route for the table artifact system. Uses runWithContext for AsyncLocalStorage-based context management. Implements hydrateContextFromMessages to restore previous table state. Configures streamText with tableEditor and addData tools.
tools/table-editor.tsMassive tool implementation containing addDataTool and tableEditorTool (handles create, add_column, filter_rows, sort_data, calculate, clean_data, edit_column, merge_data operations). Implements CSV parsing, column profiling, data transformations, and progressive artifact streaming.
artifacts/table-editor.tsDefines the TableEditorArtifact using the artifact() helper. Contains the comprehensive Zod schema for table editor state: title, stage, csvContent, summary, operations, version history.
ai/context.tsAsyncLocalStorage-based context management for the artifact system. Provides runWithContext, getContext, getWriter, and artifact data accessors.
lib/sheet-utils.tsCore spreadsheet utility library: CSV parsing with fallback, row normalization, Excel-style column reference resolution, filter predicate builder, value type coercion, and automatic column type detection.
Loading preview…
Early-bird pricing — limited time

Open on desktop for the interactive preview.
Spreadsheet editor with AI chat for data analysis and manipulation. Edit tables through conversation.
Loading preview…
Early-bird pricing — limited time

Open on desktop for the interactive preview.
Spreadsheet editor with AI chat for data analysis and manipulation. Edit tables through conversation.