Strategy for calendar data as tools?

Dear community.

I’m building my own private assistant with API. and until now, I’m enjoying to add some features without any special issue.

But for the calendar… I’m not sure which strategy would be better to handle calendar data.

My application would have hundreds of events parsed from .ics files. The events are randomly updated. My application would be run on the RPI, so I don’t want to use a database for this. I want to keep this application as tiny as possible.

The structure of event data is like this.

  { title, description, startTime, endTime, location, category  },

And what I want is to inquire about various topics, like;

  • “What is my next schedule?”
  • “Briefly summarize my schedule for today.”
  • “Where is Sam’s birthday party?”
  • “Can I wake up late tomorrow?”
  • “How many days left until Christmas?”

What I concern is;

  • To use file search seems not ideal. It doesn’t make sense for me to upload a new file into the vector store and update assistant/threads whenever the data is changed.

  • If I make a magic function like getAllEvents() and return hundreds events at once, will it consume huge tokens?

  • Or should I provide a detailed function like getEvents(startTime, endTime, limit, searchWord, ...)? But in that case, I’m not sure GPT could build parameters properly.

For example; My data might have an event like;

  title: "John Doe's Anniversary", 
  description: "Birthday party at home" 

If I may ask “John’s birthday party”, I guess GPT may build parameters like {title: "John's birthday party"} or {description: "John's birthday party"}, But my function could not find that event with those parameters. (my function is not AI. :smiley: )

  • OR… It still be better to upload my data file to update vector store in every hour?

Any opinion is welcomed! Thanks.

At this time, until tokens are much cheaper, I would store calendar in a database, give the Ai a precise schema, and have a function access the db using either sql or parameters the ai generates. May be hit or miss.

1 Like

Consider GPT3.5 turbo has 16k tokens context and is very cheap, you could try dumping all the events inside and use it to act as a calendar. Should be smart enough to do it.
So in your main assistant which is GPT4 instead of the function getAllEvents() you will have a function askCalendar() that takes a text as input.
When you ask “Where is Sam’s birthday party?” your main assistant asks the calendar assistant.

Interesting idea. I’ll consider.

1 Like