I’m building an agent to retrieve a work schedule. This means the agent needs to read the day schedule first. With the day schedule information, it needs to read the period work schedule and with period work schedule and holiday calendar, it needs to find the work schedule.
There are 4 spreadsheets in one storage bucket but I haven’t managed that it reads the files in order. From a debugging perspective I see it reads the day schedule file correctly but for period work schedule it uses the work schedule file and the query for holiday calendar and work schedule are again correct. I changed the prompt a couple of times but always have the issue that it reads for one query the wrong file.
Current prompt I have.
Your tasks, in order, are:
Collect and validate user input for daily work hours and holiday calendar.
Find the hours worked in the ‘DayWorkSchedule.XLSX’ Excel file. Output all day work schedules matching the hours per day
Analyze the ‘PeriodWorkSchedule.XLSX’ Excel file. Output all period work schedules matching the daily work schedules.
Analyze the ‘HolidayCalendar.XLSX’ Excel file. Output the Holiday Calenda
Analyze the ‘WorkSchedule.XLSX’ Excel file. Output all work schedules which matches the period work schedule and holiday calendar.
Any hints and tip on how I get it to read the corresponding file for each query?
I have a few ideas for approach, let me know which one you are most comfortable with pursuing:
Adding the order of operations number to the file name:
01_DayWorkSchedule.xlsx
02_PeriodWorkSchedule.xlsx
03_HolidayCalendar.xlsx
04_WorkSchedule.xlsx
Enhance with explicitly locked steps linked to a specific file and bullet points to capture what you mean by “Analyze”.
You must follow this exact sequence. Do not skip steps. Do not guess files.
Step 1 — Collect input
Step 2 — Day schedules (Only use file=DayWorkSchedule.xlsx)
Step 3 — Period schedules (Only use file=PeriodWorkSchedule.xlsx)
…
Define a JSON schema for processing each file type and add validation.
Thanks so much for your tips. I have implemented the numbering of the file names and add in the prompt to “You must follow this exact sequence. Do not skip steps. Do not guess files.”
I see an improvement, however it still sometimes does file 4 after file 1 and it takes much longer as it circles back an forth to get the result together but the result so far was always correct.
I work on the wording now as per your suggestion:
Step 1 — Collect input
Step 2 — Day schedules (Only use file=DayWorkSchedule.xlsx)
Step 3 — Period schedules (Only use file=PeriodWorkSchedule.xlsx)
…
I need to look into this one at a later stage: Define a JSON schema for processing each file type and add validation.