App structure
App structure
Section titled “App structure”Next.js
Section titled “Next.js”src/app/page.tsx— Landing page (setup checklist, links to chat and docs).src/app/chat/page.tsx— Main chat interface:TamboProvider,TamboMcpProvider,MessageThreadFull, and eitherJupyterEmbedPanelorNotebookPanel.
src/lib/tambo.ts— Central config: components and tools arrays. Register generatable components (Graph, DataSummaryCard, SelectForm, SuggestNextSteps, etc.) and tools (getUploadedDataset, summarizeDataset, runSqlOnDataset, filterDataset, groupByDataset, buildChartFromData, getColumnSample, getKPIs, getSalesData, getProducts, getUserData, getDatasetByUrl, imputeDataset, pivotDataset).src/app/chat/page.tsx— Passescomponents,tools,mcpServers,contextKeytoTamboProvider.
Data and APIs
Section titled “Data and APIs”src/utils/data.ts— Data parsing, column types,getDatasetSummary,imputeDataset,filterDataset,groupByDataset,pivotDataset,buildChartFromData,getColumnSample.src/lib/dataset-upload-store.ts— In-memory store for the currently staged uploaded dataset (getUploadedDatasetContent, setUploadedDataset, clearUploadedDataset).src/app/api/:- dataset — POST: store
{ content, filename, format }→{ datasetId }; GET:?id=...→{ content, filename, format }. - run-code — Execute Python code (e.g. from Run button in notebook panel); optional dataset CSV.
- run-sql — Run SQL on provided rows.
- upload-to-jupyter — Upload file content to Jupyter work folder; returns
{ path, treeUrl, loadPath }. - ensure-jupyter-notebook — GET: create work/notebook.ipynb on Jupyter if missing.
- tambo — Proxy to local Tambo API or Tambo Cloud.
- uploadthing — File upload (if used).
- dataset — POST: store
Components
Section titled “Components”src/components/tambo/— Chat UI: message thread, message input, suggestions, tooltips, MCP config modal, elicitation UI, graph, data-summary-card, select-form, suggest-next-steps, runnable-code-block, notebook-panel, jupyter-embed-panel, markdown-components, thread history, etc.src/components/ui/— Canvas and UI pieces (e.g. interactable tabs, canvas details).
Notebook panel
Section titled “Notebook panel”The right-hand panel shows the thread as notebook-style cells (src/components/tambo/notebook-panel.tsx). When NEXT_PUBLIC_JUPYTER_LAB_URL is set, the panel embeds JupyterLab (jupyter-embed-panel.tsx) so the user works in a real notebook; the AI drives it via Jupyter MCP tools.
For Tambo’s own docs (registering components, tools, schemas), see tambo.co/docs.