Skip to content

Developed a fully serverless Telegram bot on AWS using Lambda and API Gateway. It features secure webhook integration with custom authentication via a Lambda authorizer and DynamoDB, plus a Python-based LLM agent enhanced with a web search tool using Brave APIs.

License

Notifications You must be signed in to change notification settings

leo-capvano/yoagent_bot

Repository files navigation

Overview

  • Want to create you own LLM Telegram bot?
  • Want to know how to create a fully-serverless and secure Telegram webhook bot on AWS?

This project shows how to deploy and register a Telegram bot backed by serverless AWS architecture. It exposes a secure API that act as a wrapper for an LLM of choice.

Features

This repository template demonstrates how to create the back-end infrastructure of a Telegram bot that is both secure and cost-effective.

Telegram bots can be deployed using the Webhook method. In this approach, when you send a message to the Telegram bot via the chat interface, Telegram forwards your message to a pre-configured REST API—this is your webhook.

In this repository, you will find:

  • Infrastructure for creating a serverless API using AWS Lambda and API Gateway.
  • An authentication setup that utilizes a Lambda authorizer and DynamoDB to:
    • Authenticate the request sender (ensuring requests come only from Telegram servers via a whitelisted IP).
    • Verify the Telegram user making the request is registered in a DynamoDB table.
  • Python source code that implements a simple LLM Agent with an integrated web search tool (leveraging the Brave APIs).

Architecture

architecture.png

Set Up Infrastructure and Telegram Bot

  1. Create a telegram bot and obtain a bot token --> CREATE_BOT.md
  2. Set up the infrastructure by running the Terraform script --> SET_UP_INFRA.md

📝 License

MIT License – see the LICENSE file for details.

About

Developed a fully serverless Telegram bot on AWS using Lambda and API Gateway. It features secure webhook integration with custom authentication via a Lambda authorizer and DynamoDB, plus a Python-based LLM agent enhanced with a web search tool using Brave APIs.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published