Let’s Build a Telegram Assistant with CrewAI



AI Summary

Building AI Agents with Cursor and Deep Seek

Overview

  • Create a personal voice assistant using Telegram, Cursor, and Deep Seek.

Step 1: Setting Up Telegram

  • Use Cursor to create a project and implement code to listen for messages and respond.
  • Use HTTP requests instead of Python libraries for Telegram API interaction.
  • Obtain a bot token using Telegram’s BotFather:
    • Download Telegram and create an account.
    • Search for “BotFather”, start a chat, and use /newbot to create a bot.
    • Name your bot and set the username (must end in “bot”).
    • Copy the access token provided.
  • Store the bot token in an environment file and test message reception.

Step 2: Creating the AI Agent

  • Use Cursor to create a “Crew” for the personal assistant.
  • Choose an activation flow to simplify setup for a single agent.
  • Integrate all necessary tools from Compos, starting with Google Calendar tools:
    • Create, find, delete, and update events.

Step 3: Adding Tools

  • Add Gmail tools for sending emails.
  • Introduce Serp API for news scraping.
  • Configure each API by signing up and entering API keys in Compos.

Step 4: Testing the Assistant

  • Use the main.py file to run the bot, listen for input, and process commands.
    • Handle both text and voice commands using OpenAI or similar for transcription.
  • Implement logic to manage both types of inputs and provide appropriate responses.
  • Test voice commands by creating calendar events, querying data, and ensuring the system responds correctly.

Step 5: Voice Feedback Integration

  • Add text-to-speech functionality to provide voice responses to user commands.
  • Ensure successful integration of all tools and run comprehensive tests to verify the full functionality of the assistant.