TL;DR
Lately, I have been procrastinating a lot, binge-watching Netflix, doom-scrolling social media, etc.
Finally, I decided to get rid of my procrastination. What better way than to code an AI agent that keeps me on track and periodically reminds me if I should start indulging in media consumption?
- Your AI Agent Tooling Platform
Here’s a quick introduction about us.
Composio is an open-source tooling infrastructure for building robust and reliable AI applications. We provide over 100+ tools and integrations across industry verticals from CRM, HRM, and Sales to Productivity, Dev, and Social Media.
They also provide local tools such as CodeAnalyser, RAG, SQL, etc.
This article discusses using the CodeAnalysing tool to index a codebase for questions and answers.
Tech Stack
To successfully complete the project, you will need the following.
OpenAI SDK and API key: To interact with the LLM.
Composio: For accessing image analysing tool.
PyAutoGUI: To automate interactions on the screen.
Osascript: To execute AppleScript commands for controlling macOS applications.
So, let’s get started.
Let's Get Started 🔥
Begin by creating a Python virtual environment.
python -m venv ai-friend
cd ai-friend
source bin/activate
Now, install the following dependencies.
pip install composio-core
pip install composio-openai openai
pip install pyautogui
Next, Create a .env file and add environment variables for the OpenAI API key.
OPENAI_API_KEY=your API key
To create an OpneAI API key, go to the official site and create an API key in the dashboard.
Upon logging in, a screen with a key will appear.
and the
Here is an example of the agent in action.👇
// Detect dark theme
var iframe = document.getElementById('tweet-1820129229683454160-47');
if (document.body.className.includes('dark-theme')) {
iframe.src = "https://platform.twitter.com/embed/Tweet.html?id=1820129229683454160&theme=dark"
}
Next Steps
In this article, you built your personalised AI friend that monitors your activity. However, adding external integrations such as a Calendar or Gmail tool can be even more helpful. This lets you know if you have some events to attend or essential emails to respond to.
You can easily do it with Composio’s wide array of integrations, from GitHub and Calendar to Slack, Discord, and more.
If you want to see more AI-related articles, let me know in the comments and give us a star on GitHub.
Thank you for reading!
SOCIAL SHARE CARD GENERATOR