Two-Tiered Evaluation Harness Architecture for AI Agents

Building a Deterministic Lead Qualification API for Salesforce

Building a Deterministic Lead Qualification API for Salesforce Lead qualification sounds simple: receive a business name and address, look up the company, and create a Lead in Salesforce. The difficult part starts when the same restaurant arrives from two sources, the address is written differently, a search returns several similar businesses, or two requests reach the API at the same time. A system that guesses incorrectly can enrich the wrong company. A system that checks for duplicates too late can create two Salesforce records. A system without an audit trail cannot explain why a lead was accepted or rejected. ...

September 28, 2026 · Tarek Mustafa
Image showing a cartoonish image about using Agentforce to search for lead data

Lead Enrichment with Python and SerpAPI

Enriching Salesforce Leads with Place IDs I built a Python-driven automation that enriches Salesforce Leads using Google Place IDs as a stable identifier for businesses on Google Maps. The goal was to move beyond manual lead research. If a Lead already has a Place ID, the script can use that identifier to fetch structured business details and sync the useful fields back into Salesforce. The Three Ingredients 1. Salesforce Lead Object Configuration To prepare Salesforce for enrichment, I added custom fields to the Lead object. This included a Place ID field to serve as the lookup key, along with fields for Google rating, review count, website, and other useful business details. ...

April 11, 2026 · Tarek Mustafa