How we built an AI-powered contact research system that automatically profiles prospects using LinkedIn, Twitter, GitHub, and news sources - all while maintaining privacy and security.
We built an AI system that automatically researches anyone who contacts us. Here's why and how.
Contact forms are broken. Someone fills out a form, you get an email with their name and message, and that's it. You're left googling them, checking LinkedIn, trying to piece together who they are and what they actually need.
For a consulting business, this is backwards. The more context you have upfront, the better you can help them. But manual research takes time, and you miss things.
When someone submits our contact form, our system automatically:
All of this happens in the background, usually completing within 5 minutes of form submission.
Our previous setup was Vercel + Supabase. It worked, but had limitations:
Cloudflare Workers + D1 solved all of this for $5/month total.
The system uses OpenAI's latest models with custom tools:
// Enhanced company lookup with industry mapping
const companyData = await lookupCompany(emailDomain);
// Returns: industry, description, size, confidence score// Multi-platform social research
await Promise.all([
searchLinkedIn({ name, company }),
searchTwitter({ name, company }),
searchGitHub({ name, email }),
searchNews({ name, company }),
]);The AI combines all sources into a structured profile with confidence scoring. Low-confidence data gets flagged for manual review.
We're careful about what we collect and how long we keep it:
The goal is business context, not surveillance.
Multiple layers protect against abuse:
Origin and referer validation prevents cross-site request forgery:
const allowedOrigins = [
"https://ctkadvisors.net",
"https://www.ctkadvisors.net",
];
const isValidOrigin = origin && allowedOrigins.includes(origin);
if (!isValidOrigin && !isValidReferer) {
return { success: false, error: "Invalid request origin" };
}Every form submission requires Cloudflare Turnstile verification:
const turnstileResult = await verifyTurnstileToken(
data.turnstileToken,
clientIP,
secretKey
);The system has transformed our contact process:
Before:
After:
Example profile generated:
Built entirely on Cloudflare's edge platform:
The entire system runs globally at the edge, with sub-100ms response times.
Monthly costs breakdown:
Total: $20/month for unlimited contact intelligence.
Compare to hiring a VA for research: $15/hour × 10 minutes per contact = $2.50 per contact. We break even at 8 contacts per month.
The system is working well, but we're adding:
AI tools are powerful when you give them structure. The key was building specific tools for LinkedIn search, company lookup, and news research rather than asking the AI to "figure it out." It made up crap more often than not.. and getting the signature to force tool caling was a bit of a headache. In the end though, it works well.
Privacy matters more than features. We could collect much more data, but chose restraint. Business context, not personal surveillance.
Edge computing works for AI workloads. Running everything on Cloudflare's edge gives us global performance without the complexity of multi-region deployments.
Security is foundational. Turnstile, rate limiting, and input validation aren't afterthoughts - they're essential.
The result is a contact form that actually helps us help people better. Which is the whole point.
Interested in building something similar? The patterns here work for any business that needs better prospect intelligence. The key is starting simple and adding intelligence gradually. Use the form, contact us!