Location
Augsburg, Germany
Project
Qualify leads, spend AI only on companies worth it
Fixed rules and a quick check weed out portals, dead and parked websites, and a web search repairs outdated links. Only companies worth it reach the costly AI analysis.
The starting point
A lead list from the CRM is never quite fresh. Behind many links there is no company site any more, but a portal, a parked domain, a block page or a successor. If an AI reads every row in full, it burns tokens on exactly that clutter and returns wrong industries. By hand, it means opening, reading and classifying every website.
Why I built this
I was given the task of sorting a long lead list by industry. The obvious way, letting an AI read every website in full, went wrong: behind many links sat a portal or a parked domain. Once the link pointed to a press portal, and the AI carefully classified the press release of a completely different company. So I built a system that first uses fixed rules to check whether the link really leads to the company. The costly AI only reads what is worth it.
The solution
You get a sales list where every company carries an industry, a code, a confidence and a reason, and the AI only worked on companies worth it. The key is the order: first, code checks without AI whether the link leads to the company at all. Then a quick check on a short excerpt decides whether the page is usable, otherwise a web search finds the current address. Only then does the AI read the full pages, and classification gets only the rules of the matching industry groups instead of the whole rulebook.
How it works
Drag or use the arrow keys to move the steps
- Step 1: Read the lead list leads to Check the link without opening it
- Step 2: Check the link without opening it leads to Read the website
- Step 3: Read the website leads to Check whether analysis pays off
- Step 4: Check whether analysis pays off leads to Extract the facts (usable)
- Step 5: Extract the facts leads to Classify in two stages
- Step 6: Classify in two stages leads to Cross-check with fixed rules
- Step 7: Cross-check with fixed rules leads to Sales list with industry
- Step 8: Check whether analysis pays off leads to Web search (not usable)
- Step 9: Web search leads to Extract the facts (company found)
- Step 10: Cross-check with fixed rules leads to Review flag (doubt)
- Step 11: Review flag leads to Sales list with industry
Steps as text
Step 1: Read the lead list
The system reads the CRM export as CSV and works out the separator, the encoding and the columns for name, website and country on its own. Account number, sales contact and company size pass through unchanged into the result list. If a run stops, a restart can skip every company already processed, so no company goes through the AI twice.
Step 2: Check the link without opening it
If the link points to LinkedIn, a business directory, a press portal, a marketplace or a search engine, the page is never loaded. Such addresses sit on a fixed list. They never show the company itself, only third-party content that misleads the AI. These leads go straight to the web search.
Step 3: Read the website
A headless browser loads the home page and a few subpages. Fixed rules prefer about, product and service pages and skip login, cart, privacy, legal notice, jobs, blog and files. A text filter keeps only passages about products and industry. Each page and each company has a fixed time limit.
Step 4: Check whether analysis pays off
If the page title shares no word with the company name, the page counts as unrelated, no AI involved. Otherwise a small model reads only a short excerpt and answers in a few words: usable, parked, blocked, login, under construction, moved, holding or too thin. If the company moved, the new address is read once. Portal links and pages with too little text go to the web search.
Step 5: Web search
The search gets whatever the list holds: name, city, address, phone, country and the old link, marked as possibly outdated. It looks through directories of that country for the current website and line of business, also after a rename. Every source is saved. If it finds nothing, the lead stays in the list without a code. The search only runs when the check asks for it.
Step 6: Extract the facts
Only now, with checked content from the website or the web search, does the AI read the full pages. For each page, in parallel, it extracts products, line of business, whether the company makes or trades, headcount, founding year, country and certificates. These merge into one company profile. If the AI copies sample values from its template, the code throws them out.
Step 7: Classify in two stages
Stage one picks the few industry groups that fit, adding Other when confidence is low. Stage two picks the exact code and sees only the definitions of those groups. So the long rulebook is not sent along for every company, and each company needs fewer tokens. If stage one finds no group, the AI classifies in one step against the full rulebook.
Step 8: Cross-check with fixed rules
Then code checks without AI: makers of kitchen equipment land under machinery, not food. If a company names several third-party brands and shows no manufacturing of its own, it is listed as a trader. If an industrial code sits next to hotel, consulting or catering and products are missing, confidence drops and the row gets a review flag.
Step 9: Sales list with industry
Every company is saved right after it is processed, so a crash never loses finished results. At regular intervals an interim Excel file is written. At the end, industry, code, confidence, reasoning and products sit next to the CRM data, plus a log of the run: AI calls, tokens used and web searches.
Tools
- OpenAI
- Python
- FastAPI
- Celery
- Redis
- PostgreSQL
- Docker
- React
A similar workflow for your business?
In a short call, we'll work out which of your steps can be automated.