https://github.com/leo-capvano/yoagent_bot
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.
https://github.com/leo-capvano/yoagent_bot
agent api-gateway aws bot-telegram brave dynamodb lambda langchain llm python rest-api s3 secrets-manager telegram telegram-bot-template terraform
Last synced: 6 months ago
JSON representation
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.
- Host: GitHub
- URL: https://github.com/leo-capvano/yoagent_bot
- Owner: leo-capvano
- License: mit
- Created: 2025-01-19T17:06:36.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2025-04-12T09:46:31.000Z (9 months ago)
- Last Synced: 2025-04-12T10:37:04.127Z (9 months ago)
- Topics: agent, api-gateway, aws, bot-telegram, brave, dynamodb, lambda, langchain, llm, python, rest-api, s3, secrets-manager, telegram, telegram-bot-template, terraform
- Language: Python
- Homepage: https://github.com/leo-capvano/yoagent_bot
- Size: 27.7 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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

## Set Up Infrastructure and Telegram Bot
1. Create a telegram bot and obtain a **bot token** --> [CREATE_BOT.md](docs/CREATE_BOT.md)
2. Set up the infrastructure by running the Terraform script --> [SET_UP_INFRA.md](docs/SET_UP_INFRA.md)
## 📝 License
MIT License – see the [LICENSE](LICENSE) file for details.