Lead-finding bot

Automatic collection of orders from Telegram channels and freelance job boards with AI scoring for an IT‑company

Lead-finding bot

About the project

An IT company that does web development and integrations was looking for new clients by hand: a manager scrolled through dozens of Telegram channels with job posts and orders, and several freelance job boards, every day.
That took several hours a day, good orders were found late, and some posts simply got lost in the general flow.

our task

Build a bot that finds suitable orders on its own, filters out irrelevant ones, scores every lead and immediately sends the team a ready card with contacts and a link to the source.

How it works

The system consists of several modules that run on a schedule and in real time:
  • Collection from Telegram. A user session built on Telethon (MTProto API) is subscribed to industry channels and chats and receives new posts the moment they are published.
  • Collection from job boards. Parsers built on httpx and Playwright pick up new projects from freelance boards on a schedule, including those that load content with JavaScript.
  • Filtering and deduplication. Listings are normalised, and duplicates of the same order from different sources are removed by text hash and vector similarity.
  • AI scoring. An LLM reads the order and compares it with the company’s profile: it assigns a relevance score, extracts tags — the stack and the type of task — and pulls out the client’s contacts.
  • Delivery. Leads above the threshold go to the team’s private Telegram channel as a card: score, date, contact, tags, a link to the original post and the full text of the order.

Technology stack

  • Python, asyncio — the core of the service;
  • Telethon — reading channels, aiogram — the bot and lead publishing;
  • httpx, Playwright — job board parsing;
  • LLM API with structured output — scoring and tagging of orders;
  • PostgreSQL + pgvector — lead storage and duplicate search;
  • Redis, APScheduler — queues and scheduling;
  • Docker — deployment on the client’s server.

Engineering challenges

The main difficulty was selection quality: the channels are full of permanent job listings, adverts and reposts. We tuned the prompt and the scoring threshold on a real sample of labelled posts, and moved the criteria into settings, so the team can change the stack and task types without touching the code.
We also paid special attention to resilience: Telegram API limits, layout changes on job boards and outages of individual sources don’t stop the system. Each module restarts independently, and the bot reports failures to a service chat.

what we achieved

The team stopped spending hours on manual monitoring. Suitable orders arrive in Telegram a few minutes after publication, already with a score, tags and contacts. The manager sees only relevant leads and responds to them first, and new sources are connected in a couple of lines of config.

This project shows how AI and automation turn a flood of noise into a sales funnel. We built a system that works around the clock and brings the team clients while it is busy with projects.