Sefism is free for learners. We are here to help you grow, one step at a time.Join for free
Sefism.
AI & ML

Sandboxed Spreadsheet Analyst Agent for Small Business Owners

Build an agent that answers a shop owner's questions about their messy Excel and CSV files by writing and running Python in an isolated sandbox, then returns a chart, a plain-language answer and the exact script it ran. The project is about safe code execution, cost limits, reproducibility and trajectory evals on real-world data, not about a chat interface.

Difficulty

Advanced

Needs a team, real planning, and a supervisor who knows the area.
Effort

2 semesters · 2 students

Deliverables

7 to ship

4 optional extras

Suggested stack

PythonpandasLLM API with tool callingDocker or a hosted code sandboxFastAPIReactPostgreSQLLangfusepytest
A suggestion, not a requirement. Swap anything for what you already know.

What you should ship

  • Upload of Excel and CSV files with automatic profiling: columns, types, missing values and likely problems such as mixed date formats
  • An agent loop that writes Python, runs it in an isolated sandbox with no network, no secrets and CPU, memory and time limits, and reads back the results
  • Answers that always include a chart or table, a plain-language explanation and the exact script, which can be re-run on next month's file
  • Step, time and cost limits per question, with a clear message when a limit is hit
  • A tracing view that shows every step of a run for debugging
  • An eval set of at least 60 questions over 5 realistic messy datasets, scored on correctness of the final number and on the path taken
  • A pilot with at least 5 small businesses, with their consent, measuring time saved and trust in the answers

If you have time left

  • Questions and answers in Urdu or Hindi as well as English
  • Monthly reports generated automatically from saved scripts
  • Detecting and asking about ambiguous questions before running any code
  • Comparing two models on accuracy and cost per question

The problem: the data is there, the analyst is not

Small shops, clinics, distributors and online sellers keep their records in spreadsheets: sales ledgers, stock sheets, supplier bills and exports from point-of-sale apps. The owner has real questions, such as which products are losing money, which customers stopped ordering and whether this month is worse than last year, but no analyst and no time to learn pivot tables. The files are messy: dates in three formats, product names spelled five ways, totals typed in by hand.

What already exists and the gap

  • ChatGPT's data analysis features, Claude and Gemini can analyse uploaded files by writing and running code.
  • Microsoft Copilot in Excel and Gemini in Google Sheets bring assistants into the spreadsheet itself.
  • Julius AI is a dedicated tool for chatting with data.

These are capable, but for a small business owner there are gaps: answers they cannot verify, analysis they cannot repeat next month without asking again, little control over where data goes and how much each question costs, and weak handling of local formats and languages. A focused agent that always shows its script, re-runs it on new files and runs code in a sandbox you control fills a real niche.

Inspiration

The DABstep benchmark, built by the payments company Adyen with Hugging Face from real analysis tasks in Adyen's own work, showed that multi-step data analysis remains hard even for strong agents. It is a good model for your own evals: questions with one correct answer, over realistic data, checked automatically.

What you build

  • Business owners: upload files, ask questions in plain language, get a chart, an explanation and a saved analysis they can run again next month.
  • The agent: profiles the data, asks clarifying questions when a request is ambiguous, writes pandas code, runs it in the sandbox, checks the result and explains it.
  • You as developer: a trace of every run and an eval dashboard.

The technically interesting part

  • The sandbox. Every run executes in a fresh isolated environment with no network, no credentials, strict resource and time limits and only the uploaded files mounted. Treat the model's code as untrusted, because the spreadsheet itself might contain text that tries to steer it.
  • Ground truth from the environment. The agent reads real outputs and errors after each step and fixes its own code, within a step limit.
  • Reproducibility. Save the final script with its inputs, so the same question can be answered on next month's file without calling the model again.
  • Cost control. Track tokens per question, cap spend and measure cost per answered question.
  • Evals. Score the final number against a known answer, and check the trajectory: did it clean the dates before grouping, did it avoid double counting?

How to evaluate it

  • Accuracy on 60 or more questions with known answers across 5 messy datasets, over several trials.
  • Trajectory checks for common analysis mistakes.
  • Cost and time per question, and how often limits are hit.
  • A security test: spreadsheets containing injected instructions must not make the agent reach the network or other files.
  • Pilot feedback on time saved and whether owners trust and understand the answers.

Suggested plan

  • Weeks 1 to 3: collect or build 5 realistic messy datasets and write the first 30 questions with answers.
  • Weeks 4 to 7: the sandbox, file profiling and a basic agent loop.
  • Weeks 8 to 11: self-correction, charts, saved scripts and limits.
  • Weeks 12 to 16: tracing, the full eval set and security tests.
  • Weeks 17 to 22: pilot with small businesses and improvements.
  • Weeks 23 to 26: final evaluation and report.

Path to a product

Accountants, business consultants and point-of-sale software vendors all serve owners who need this. The most promising route is to specialise, for example pharmacies or wholesale distributors, with ready-made reports for that trade, then sell monthly subscriptions or a white-label version to software vendors. Your cost-per-question numbers decide the pricing.

Scope warning

Use data shared with written consent or realistic synthetic data, and never keep files longer than needed. Do not connect to live accounting systems in the core scope, and do not give the sandbox network access.

Learn what you need on Sefism

Get help with this idea

The difficult parts are a sandbox that is genuinely isolated and evals that prove the numbers are right. Tauseef can help you design both and find businesses for the pilot. If you are new here, create a free account first.

Ideas and guidance, not finished projects

These are project ideas and scoping guidance, published free for students to use as a starting point. I do not build, write, or sell final-year projects, and I do not complete coursework for anyone. Take an idea, make it yours, and build it.

Not sure this one fits you?

I help students pick an idea that matches their skills and their deadline, then scope it down until it is finishable. Guidance only, never done for you.

Discuss this idea
Work with me

Stuck on something specific?

Writing only gets you so far. If you want an answer to your situation rather than the general case, book a session and we will work through it together. Sessions are free for approved Sefism members, and a few slots open each week.