← Back

Company Enrichment

We use several sources to find buyers for transactions we're working on: our CRM which has been added to regularly since 2022, Apollo.io, PrivateEquityInfo.com, Mergr.com, Pitchbook, and old-fashioned Google search. But for sellers with broad appeal (i.e. lots of interested parties), our lists can grow long and often overlap between our sources.

In particular, using Apollo we might return many thousand example companies matching our basic criteria but very few of these would be realistic buyers for our client. Confidentiality matters in the middle market, and we don't want to spam competitors who will never buy.

We needed a way to remove duplicates, filter out the companies who aren't realistic buyers, while still keeping a long, broad market listing.

System Architecture: This was the first internal tool I built at Trailhead and we settled on Render.com to host our code. It's proved to be a strong pick with zero issues from me. While we have a lightweight web app to make import and cleaning a little simpler for my teammates and I, it's all written in Python using Flask.

System Architecture
+-----------------------------------------------------------------------------+ | COMPANY ENRICHMENT | | | | +---------------------+ | | | Flask Web App | | | | (Render Host) | | | +---------+-----------+ | | | | | +---------------------+---------------------+ | | | | | | | v v v | | +---------------+ +---------------+ +---------------+ | | | IMPORT | | ENRICH | | EXPORT | | | | CSV Data | | Website | | Results | | | | | | Classify | | | | | +-------+-------+ +-------+-------+ +-------+-------+ | | | | | | | v v v | | +---------------+ +---------------+ +---------------+ | | | PostgreSQL |<--->| Perplexity | | CSV File | | | | Database | | API | | Download | | | +---------------+ +---------------+ +---------------+ | | | +-----------------------------------------------------------------------------+
Process Steps
01

Import Company List

Upload CSV file with company records. System cleans column names and imports to PostgreSQL database.

02

Find Missing Websites

For companies without domain names listed, query Perplexity API with company name + location. Perplexity searches the web and returns the most likely company website.

03

Classify Against Criteria

For each company with a website, query Perplexity with customizable prompt. Example: "Is this a home furnishings manufacturer?" Returns YES/NO classification. This is the important part.

04

Export Results

Download enriched data as CSV. Filter by classification status (YES only, NO only, or all). Ready for CRM import or further analysis.

Enrichment Pipeline
+-----------------+ | CSV Upload | | Company List | +--------+--------+ | v +-----------------+ | Clean Columns | | Import to DB | +--------+--------+ | v +-----------------+ | PostgreSQL | | Database | +--------+--------+ | v +-----------------+ +-----------------+ | FIND WEBSITES |-------->| CLASSIFY | | | | | | Company Name | | Company Name | | + City/State | | + Website | | | | | | | | Perplexity AI | | Perplexity AI | | | | | | | | Website URL | | YES / NO | +-----------------+ +--------+--------+ | v +-----------------+ | Export to CSV | | Filter by YES | +-----------------+
Classification Prompt Structure
+------------------------------------------------------------------+ | PROMPT TEMPLATE | +------------------------------------------------------------------+ | | | Search the internet for the company {company_name}, | | website {website} and determine if the company is a | | [INDUSTRY TARGET] or not. | | | | A [INDUSTRY TARGET] must meet ALL of these criteria: | | - [CRITERION 1] | | - [CRITERION 2] | | - [CRITERION 3] | | - [EXCLUSIONS] | | | | IMPORTANT: Respond with ONLY the single word YES or NO. | | | +------------------------------------------------------------------+ Example: Home Furnishings Manufacturer criteria |-- Must MANUFACTURE (not just retail) furniture |-- Must be HOME/RESIDENTIAL (not commercial/office) |-- Products: sofas, chairs, tables, beds, dressers +-- Exclude: cabinetry only, mattresses only, building materials

Stack

Python Flask PostgreSQL Perplexity API Pandas Render
On-demand web application