templates/template-csv-to-questions/README.md
An agent that takes a CSV file as input, generates an AI summary to compress the data, and then produces focused questions based on that summary. Built with Mastra.
This template demonstrates how to handle large datasets without hitting token limits by using a large context window model as a summarization layer before question generation.
This template shows how to combine agents into a workflow that can process large CSV files, generate summaries, and produce questions—all while keeping token usage efficient and costs down.
<video controls width="640" height="360" src="https://res.cloudinary.com/mastra-assets/video/upload/v1772538181/template-csv-to-questions_ylvbvn.mp4"></video>
This demo runs in Mastra Studio, but you can connect this agent to your React, Next.js, or Vue app using the Mastra Client SDK or agentic UI libraries like AI SDK UI, CopilotKit, or Assistant UI.
openai/gpt-5-mini to handle large datasets efficiently.npx create-mastra@latest --template csv-to-questions to scaffold the project locally..env.example to .env and fill in your OpenAI API key.npm run dev and open localhost:4111 to try it out.Open Studio and navigate to the csv-to-questions workflow. Enter a CSV URL and the workflow will generate questions based on the content.
Need a CSV to try? Grab this world GDP dataset: https://raw.githubusercontent.com/plotly/datasets/master/2014_world_gdp_with_codes.csv
Swap in a different model, or wire the agent into your app using the Mastra Client SDK. The agent, tools, and workflow are all in src/ — edit them directly to fit your use case.
Mastra templates are ready-to-use projects that show off what you can build — clone one, poke around, and make it yours. They live in the Mastra monorepo and are automatically synced to standalone repositories for easier cloning.
Want to contribute? See CONTRIBUTING.md.