Deep Research
2024shippedAI-powered lead intelligence platform using Google's Gemini Interactions API to generate comprehensive buyer dossiers for luxury real estate brokers.
// GitHub
// Problem
Sales and marketing teams were pouring money into AI tools with disappointing returns. The core issue? Lead qualification was still guesswork. I spoke with a luxury real estate broker who captured this perfectly: 'What if a billionaire inquires through my website form? They look the same as everyone else.' Without context on a lead's actual buying power, net worth, and lifestyle, agents couldn't prioritize effectively. High-value prospects got the same generic follow-up as tire-kickers, while time-sensitive opportunities slipped through the cracks. The sales world needed OSINT-style intelligence gathering, but automated and instant.
// Solution
A platform that turns a simple email address into a comprehensive buyer dossier within minutes. When a lead shows interest in a property, the system automatically triggers Google's Gemini Interactions API to conduct deep background research—pulling together professional history, asset signals, social footprint, and buying power indicators. The AI synthesizes everything into an actionable profile with a clear verdict: is this lead worth the white-glove treatment? Agents see the full picture before they ever pick up the phone.
// What I Built
A full-stack real estate AI platform with two main interfaces: a public luxury listing site with lead capture, and an agent dashboard for managing prospects. When someone 'likes' a property, the system creates a lead record and immediately kicks off an async Deep Research job via Google's Interactions API. The research runs in the background, parsing results and backfilling structured data (name, verdict, net worth signals) into the database. Agents see a real-time dashboard with leads grouped by status, each with a detailed dossier panel showing personal info, assets, social signals, and AI-recommended engagement strategies. A second-pass enrichment system uses SSE streaming to extract structured fields from the dossier with confidence scores and citation mapping, letting agents review and approve proposed profile updates.
// Technologies
Google Gemini Interactions API
Async deep research capability that runs comprehensive background investigations in the cloud, returning structured intelligence reports without blocking the UI
Next.js 16 + React Server Components
App Router with server actions handling all mutations—lead creation, research polling, enrichment application—keeping sensitive logic server-side
PostgreSQL + Drizzle ORM
Type-safe database layer with JSONB columns for flexible enrichment data, allowing schema evolution without migrations for draft proposals and citation mappings
Server-Sent Events (SSE)
Real-time streaming for the enrichment pipeline, pushing progress updates and field extraction results to the UI as Gemini processes the dossier
GCP Service Account OAuth
Production-grade authentication flow using service accounts instead of API keys, with bearer token generation for secure Gemini API access
// Lessons Learned
- 01Vercel's v0 platform API release sparked this whole idea. Seeing how they exposed AI capabilities as an API got me thinking about what else could work this way—turns out background research is a perfect fit for async, fire-and-forget AI jobs.
- 02The Gemini Interactions API is genuinely different from chat-style APIs. It's designed for long-running research tasks where you kick off a job and poll for results. Learning to architect around async workflows instead of request-response changed how I think about AI integration.
- 03OSINT techniques translate surprisingly well to sales intelligence. The same approaches used in security research—triangulating identity, mapping connections, assessing credibility—are exactly what sales teams need to qualify leads.
- 04SSE streaming for UI hydration is underrated. Using Server-Sent Events to progressively populate the enrichment panel created a much better UX than waiting for the full response, and it let me show confidence scores and citations as they were extracted.
- 05Structured output from LLMs (using responseSchema) eliminates an entire class of parsing bugs. Getting guaranteed JSON back from Gemini instead of hoping the model follows format instructions was a game-changer for reliability.