Environmental · B2B 2025–2026

Telegram bot for an environmental testing laboratory

Telegram assistant: a quote in five minutes instead of an hour

The task

An environmental testing laboratory in Saint Petersburg. Before the bot, a manager spent about an hour on each commercial quote: working out which tests were needed, copying prices from the price list, adding 3% for issuing test reports, adding 5% VAT, writing the total out in words and formatting it in Word.

The catalogue has 209 services in 8 categories. A mistake in one price line or in the VAT undermines the client's trust. Manual work doesn't scale as the number of requests grows.

The laboratory works with B2B clients: industrial sites, developers, property management companies. Quotes go into tenders and approval chains. The document format is fixed: client details, a table of services, a total with VAT, the total in words, a signature.

A manager could handle 5–6 quotes a day. As incoming requests grew, the bottleneck became obvious. The lab needed a tool in Telegram, where clients already write, rather than a separate web portal that people would have to learn.

The solution

A client writes in Telegram "we need wastewater tested for petroleum products and heavy metals", and the bot picks the services from the catalogue. A 7-step quote form: tax ID with checksum validation, company details pulled automatically via DaData, KPP code, address, contact, phone, sampling location. Press "Confirm" and the docx is ready.

LangGraph orchestrates three agents: Supervisor routes requests, Intake asks for missing parameters, Proposal builds the quote. GigaChat 2, because laboratories working with government clients need their infrastructure in Russia.

The docx template follows the laboratory's letterhead: a table of services, 3% for test reports, 5% VAT, the total in words. In 80% of cases the manager gets a file that can go out without edits.

How it works

The service catalogue is stored in structured JSON with fixed IDs. The model can only offer services from the list: after generation the IDs are validated, and if they don't match, the bot asks the client to clarify.

The message queue runs on Redis. If Redis goes down, the bot switches to MemoryStorage and the conversation continues. Anti-flood limits spam, and a regex-based jailbreak detector blocks attempts to extract the system prompt.

77 automated tests cover VAT calculation, the tax ID checksum, docx assembly and agent scenarios. We catch regressions before release, because a mistake in a quote costs more than a UI bug.

How the protection works

Anti-flood, a regex-based jailbreak detector, service ID validation (the model can't "invent" a test), a fallback to MemoryStorage when Redis is unavailable. We don't keep personal data in the logs.

For laboratories with government contracts, an LLM hosted in Russia matters. GigaChat covers this without proxies or foreign APIs.

Industry context

Needs like "a Telegram bot for a laboratory" or "automated quotes for environmental testing" are rarely met by generic bot builders: you need a price list with VAT, company details, a docx in the company template and compliance with 152-FZ, the Russian personal data law.

Similar tasks come up at testing laboratories, metrology centres and clinics with a fixed price list. The common pattern: many items in the catalogue, a strict output document template, clients in a messenger.

The result

The time per quote dropped from an hour to five minutes. The manager checks and sends instead of building the table from scratch. Nobody searches through Excel for the 209 services any more.

How the work went

First we exported the price list into a structured catalogue and agreed the docx template with the laboratory's lawyers. Until the catalogue was clean, the bot had nothing to rely on.

Then we built the dialogue: the client's free-form request, clarifying questions, the company details form. We tested on real wording from managers' correspondence, not invented phrases.

We introduced the agent setup when a simple script wasn't enough: clients write vaguely, and it takes several rounds of clarification without losing context.

Load testing at peak demand showed that Redis is required, but the in-memory fallback prevents downtime during a short outage.

The same pattern works for other laboratories and B2B service companies with a large price list: Telegram as the input, docx as the output, strict validation of the numbers.

FAQ

Why GigaChat and not a foreign model? For laboratories with government contracts and 152-FZ obligations, processing data in Russia is critical. GigaChat covers this without workarounds.

Will the bot replace the manager? No. It assembles the quote and does the numbers. A person handles the final sending and difficult negotiations. The savings come from routine, not from expertise.

Can it work with a different price list? Yes. The catalogue lives in JSON or a spreadsheet, and the docx template is set up for your letterhead. Timing depends on the number of items and how complex the VAT rules are.

How long until launch? With a ready price list and quote template, from a few weeks. A pilot on a limited catalogue is faster.

Who it's for

Laboratories and B2B service companies with a fixed price list and a stream of requests in a messenger. If a manager spends more than 20 minutes on a standard quote, automation pays for itself in the first month.

Environmental testing is a case of its own: many items in the price list, VAT and surcharges for test reports, a strict Word template. A generic CRM won't help here.

Compared with the alternatives

No-code bot builders can't produce a docx with VAT and 209 items. A CRM with a quoting module would mean training managers, and it doesn't live in Telegram, where the client is already writing.

A manual Word template breaks every time the price list changes. Here the price list is updated in one place and the bot picks it up automatically.

Summary

The bot became part of the managers' daily work: a standard quote goes out in minutes, and nobody looks up the 209 services in Excel any more. The next step, at the client's request, is integration with their internal CRM for client history.

If you have a similar price list and a stream of requests in Telegram, let's go through the task on a call. We build a dialogue prototype for 10–15 services in 5–9 days with no prepayment, so you can see how it works before the full catalogue.

Have a similar task? We'll go through it on a half-hour call. For new clients we build a working prototype in 5–9 days, with no prepayment.