Topview Logo
  • Create viral videos with
    GPT-4o + Ads library
    Use GPT-4o to edit video empowered by Youtube & Tiktok & Facebook ads library. Turns your links or media assets into viral videos in one click.
    Try it free
    gpt video

    Building An AI Assistant To Do Tasks For Me (Notion/Chrome)

    blog thumbnail

    Introduction

    In today’s fast-paced world, productivity tools are essential for managing our daily tasks efficiently. In this article, we will walk you through the process of creating a virtual assistant powered by local language models (LLMs) that can help you with tasks like managing your to-do list and drafting emails. This assistant will be developed as a Chrome extension so that you can access it seamlessly while browsing.

    Setting Up Your Project

    We start by creating a new directory for our project. Open your terminal and navigate to your desktop, then create a folder named the_assistant. Once inside that folder, open your code editor of choice.

    cd ~/Desktop
    mkdir the_assistant
    cd the_assistant
    code .
    

    Next, we need to set up the necessary files for our Chrome extension:

    1. manifest.json - This will define the structure of the extension.
    2. content.js - This will contain the logic to interact with web pages.
    3. background.js - This handles the background processes of the extension.
    4. popup.html - This file will serve as the user interface of our extension.
    5. popup.js - This will contain the logic for the popup interface.

    After creating these files, we can start coding our extension.

    Creating a To-Do List in Notion

    To demonstrate our assistant, we'll create a sample to-do list in Notion. Create a new page in Notion and include a few tasks, such as:

    • Send a cold email.
    • Get a birthday present for Jack.
    • Find out how to get a UK passport.

    The virtual assistant will interact with this list to manage our tasks more effectively.

    Developing the Chrome Extension

    Manifest File

    In our manifest.json, we specify permissions and configurations for the extension. Here’s a simple example of how it can look:

    (
      "manifest_version": 3,
      "name": "AI Assistant",
      "version": "1.0",
      "permissions": [
        "activeTab",
        "storage"
      ],
      "background": {
        "service_worker": "background.js"
      ),
      "action": (
        "default_popup": "popup.html"
      ),
      "content_scripts": [
        (
          "matches": ["*://www.notion.so/*"],
          "js": ["content.js"]
        )
      ]
    }
    

    Content Script

    In content.js, we want to capture the to-do list items from the Notion page and allow the assistant to interact with them. Initially, we will identify the checkboxes and implement functionality to mark tasks as complete.

    Popup Interface

    For popup.html, we will create a simple user interface that allows users to interact with the assistant. It should have an input field for the LLM's local server URL and options to execute tasks directly from their to-do list.

    Running the Local LLM

    To run the local AI model, install and set up AMA. This allows us to run models on our local machine. The assistant will call these models when executing tasks so that everything remains private.

    1. Download the AMA software.
    2. Serve your model locally using ama serve.

    Now, our assistant can call the local LLM via APIs.

    Final Touches

    As we finalize the Chrome extension, we will ensure that the usage instructions are clear. The extension should indicate that you need to have the LLM running locally and include a link to the download site. The popup should accommodate all necessary information compactly.

    After writing and testing the complete code, we can load the unpacked extension via Chrome’s extension menu and start using it immediately!

    Conclusion

    With this virtual assistant, managing your tasks has never been easier! By integrating local LLMs with Notion and a Chrome extension, you can automate your task execution while ensuring your data remains private. The setup is relatively straightforward, and you now have a powerful tool at your disposal.

    Keywords

    • Virtual Assistant
    • Local LLM
    • Chrome Extension
    • Notion Integration
    • To-Do List Management

    FAQ

    Q1: What is a virtual assistant in this context?
    A: It is an AI-powered tool that helps manage tasks, such as sending emails or organizing your to-do list.

    Q2: How do I run the assistant locally?
    A: You need to install AMA and serve it locally using the command ama serve.

    Q3: Is my data secure while using this assistant?
    A: Yes, since the LLM runs on your local machine, your data does not leave your computer.

    Q4: Can I customize the to-do list?
    A: Yes, you can modify the tasks directly within Notion.

    Q5: What programming languages are used?
    A: The extension is primarily built using JavaScript, HTML, and JSON for the Chrome configurations.

    One more thing

    In addition to the incredible tools mentioned above, for those looking to elevate their video creation process even further, Topview.ai stands out as a revolutionary online AI video editor.

    TopView.ai provides two powerful tools to help you make ads video in one click.

    Materials to Video: you can upload your raw footage or pictures, TopView.ai will edit video based on media you uploaded for you.

    Link to Video: you can paste an E-Commerce product link, TopView.ai will generate a video for you.

    You may also like