A developer created a system to verify contact information extracted by an AI agent from procurement documents. The agent parses technical specifications and company reports to generate lead cards for sales managers, but often hallucinates phone numbers and names.
The verification process relies on deterministic code rather than another AI model. The system compares extracted data against the raw text the agent actually read. For phone numbers, the code strips formatting, prefixes, and extensions, keeping only the core ten digits to check for their presence in the source text.
Name verification uses a token-based approach that compares word stems to ensure the person mentioned in the document matches the AI's output. If a name or phone number cannot be verified against the source, the system removes the data and automatically downgrades the lead's grade from A to C.
The system also adjusts lead statuses based on specific logic. For instance, if the AI identifies a general reception number, the code can upgrade the lead status from candidate to lead. All corrections are logged to help developers refine prompts and monitor AI performance over time.




