Skip to content

monatis/open-tasks

Repository files navigation

Open Tasks

Open-source implementation of OpenAI's 'tasks' feature

Motivation

OpenAI introduced a featured called Tasks to schedule tasks directly in ChatGPT.

It was marketted as a big feature, but it's nothing more than function calling, so I just wanted to implement my own with Gemini.

How it works?

It has two functions defined to schedule tasks --recurring or one-time. The configured LLM is supposed to call one of them when it thinks that it needs to set a reminder for itself. İt should pass the task plan as an argument to the these functions in addition to the firing time for one-time reminders and cron expression for recurring reminders. Then, it is scheduled with APScheduler. The callback function for the reminders receives the task instructions and metadata, and it makes a new call to the LLM with these information injected in the prompt.

Implementation Details

I designed the agent to act as an "AI chief of staff to the CTO," and I'm planning to really use it as a part of the team at my upcoming startup after adding more capabilities. It can currently do web or news search with DuckDuckGo --easily replaceable with other search providers-, create documents and send me emails, and schedule tasks to be performed later and/or repeatedly. I didn't want to introduce dependencies on projects such as Langchain and CrewAI, and I implemented all the tools and agentic workflow myself.

  • You can see and modify the system prompts in prompts.py.
  • See tools.py for the functions used by the LLM.
  • agent.py hosts the main agent.

Future work

I'm planning to connect it to the whole knowledge base of my startup, giving more tools to do research, and enable interaction with the team on Slack. I also have some experimental ideas with sub-agents and multimodal interaction, so stay tuned for more info.

Usage

If you would like to give it a try:

  1. Clone this repository.
  2. Rename .env.example to .env and fill in your Gemini API key and SMTP credentials for sending emails.
  3. Install dependencies:
    • If you Have uv installed: uv sync
    • Otherwise: pip install .
  4. Start the API: python serve.py
  5. I haven't implemented a UI yet, so go to localhost:5000/docs to test it on the Swagger UI.

Note: If you have any suggestion or a use case in mind, feel free to reach out to me in issues.

Fun fact

In order to test the the agent, I used the following prompt:

I want to publish a post regarding how I developed you, i.e., a Gemini-backed agent serving as the chief of staff to the CTO that can set reminders for the CTO and itself. Create a document that contains a blog post mentioning the technical stack: apscheduler, SMTP, and duckduckgo. I was inspired by OpenAI's new feature called 'Tasks'. You can use web search to gather missing information.

Then it performed several web searches, read some of the search results, created [this document in examples](/examples/CTO's blog post about his AI assistant.md) and then scheduled a reminder for itself to follow up about it with me.

About

Let LLMs schedule tasks for you and itself

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages