How ahmed2806/ai-client-acquisition-agent works
LeadPilot AI discovers and researches B2B businesses, evaluates product fit, qualifies opportunities, and presents saved leads for human review. The main workflow runs from the React discovery/chat interface through FastAPI into the multi-category or single-category agent pipeline, then to PostgreSQL and the lead dashboard. README documents Google Places, website research, local/hosted LLM inference, deterministic scoring, qualification, and review capabilities. Arrows are limited to relationships shown in excerpts or README; some dashboard-to-API calls and unsampled route details are not fully evidenced.
Main entry points: pipeline_agent.py Lead Pipeline · main.py FastAPI Application · database.py Database Session · App.tsx Workspace Router
Components 34
Web Experience
- Workspace Router
frontend/src/App.tsx - Discovery Page
frontend/src/pages/DiscoveryPage.tsx - AI Chat Page
frontend/src/pages/ChatPage.tsx - Lead Dashboard
frontend/src/pages/LeadsPage.tsx - Digital Presence
frontend/src/components/discovery/DigitalPresenceCard.tsx - API Client
frontend/src/services/api.ts
API and Review
- FastAPI Application
backend/app/main.py - Chat Endpoint
backend/app/routes/chat.py - Lead Endpoints
backend/app/routes/leads.py - Review Endpoints
backend/app/routes/reviews.py - Evidence Endpoints
backend/app/routes/evidence.py
Discovery Workflow
- Multi-Category Flow
backend/app/agents/multi_category_pipeline.py - Lead Pipeline
backend/app/agents/pipeline_agent.py - Business Discovery
backend/app/agents/discovery_agent.py - Google Places
backend/app/services/google_places.py
Research and Qualification
- Website Enrichment
backend/app/services/website_enrichment.py - Social Search
backend/app/services/social_search.py - Profile Verification
backend/app/services/social_verification.py - Social Research
backend/app/services/social_research.py - Company Research
backend/app/agents/research_agent.py - Opportunity Analysis
backend/app/agents/opportunity_agent.py - Batch Inference
backend/app/services/batch_inference.py - LLM Provider
backend/app/llm.py - Fit Scoring
backend/app/services/lead_scoring.py - Lead Qualification
backend/app/agents/qualification_agent.py
Lead Storage
- Lead Persistence
backend/app/services/lead_persistence.py - Company CRUD
backend/app/crud.py - Database Session
backend/app/database.py - Company and Scores
backend/app/models.py - Evidence Store
backend/app/services/evidence_store.py
Other components
- Sales Researcher
- PostgreSQL
- Google Places API
- Public Websites
Connections 48
- Sales Researcher → Workspace Router: uses
- Workspace Router → Discovery Page: routes to
frontend/src/App.tsx - Workspace Router → AI Chat Page: routes to
frontend/src/App.tsx - Workspace Router → Lead Dashboard: routes to
frontend/src/App.tsx - Discovery Page → API Client: requests via
frontend/src/pages/DiscoveryPage.tsx - AI Chat Page → API Client: sends chat
frontend/src/pages/ChatPage.tsx - Lead Dashboard → API Client: requests via
frontend/src/pages/LeadsPage.tsx - Discovery Page → Digital Presence: renders
frontend/src/pages/DiscoveryPage.tsx - API Client → FastAPI Application: HTTP requests
frontend/src/services/api.ts - FastAPI Application → Chat Endpoint: registers
backend/app/main.py - FastAPI Application → Lead Endpoints: registers
backend/app/main.py - FastAPI Application → Review Endpoints: registers
backend/app/main.py - FastAPI Application → Evidence Endpoints: registers
backend/app/main.py - FastAPI Application → Business Discovery: calls
backend/app/main.py - FastAPI Application → Lead Pipeline: calls
backend/app/main.py - Chat Endpoint → Multi-Category Flow: invokes
backend/app/routes/chat.py - Chat Endpoint → LLM Provider: uses
backend/app/routes/chat.py - Multi-Category Flow → Business Discovery: runs searches
backend/app/agents/multi_category_pipeline.py - Multi-Category Flow → Lead Pipeline: processes leads
backend/app/agents/multi_category_pipeline.py - Business Discovery → Google Places: queries
backend/app/agents/discovery_agent.py - Google Places → Google Places API: searches businesses
- Lead Pipeline → Google Places: looks up websites
backend/app/agents/pipeline_agent.py - Lead Pipeline → Website Enrichment: enriches sites
backend/app/agents/pipeline_agent.py - Website Enrichment → Public Websites: fetches content
- Lead Pipeline → Social Search: searches profiles
backend/app/agents/pipeline_agent.py - Lead Pipeline → Social Research: builds research
backend/app/agents/pipeline_agent.py - Website Enrichment → Profile Verification: verifies profiles
backend/app/services/website_enrichment.py - Social Search → Profile Verification: candidate checks
backend/app/services/social_search.py - Social Research → Profile Verification: uses verification
backend/app/services/social_research.py - Lead Pipeline → Company Research: batches research
backend/app/agents/pipeline_agent.py - Lead Pipeline → Opportunity Analysis: batches assessment
backend/app/agents/pipeline_agent.py - Company Research → Batch Inference: runs batches
backend/app/agents/research_agent.py - Opportunity Analysis → Batch Inference: runs batches
backend/app/agents/opportunity_agent.py - Batch Inference → LLM Provider: invokes model
backend/app/services/batch_inference.py - Opportunity Analysis → Fit Scoring: calculates fit
backend/app/agents/opportunity_agent.py - Lead Pipeline → Lead Qualification: qualifies leads
backend/app/agents/pipeline_agent.py - Lead Pipeline → Lead Persistence: saves eligible
backend/app/agents/pipeline_agent.py - Lead Endpoints → Database Session: opens session
backend/app/routes/leads.py - Lead Endpoints → Company and Scores: reads records
backend/app/routes/leads.py - Review Endpoints → Database Session: opens session
backend/app/routes/reviews.py - Review Endpoints → Company and Scores: checks evaluations
backend/app/routes/reviews.py - Evidence Endpoints → Evidence Store: uses store
backend/app/routes/evidence.py - Evidence Store → Database Session: uses session
backend/app/services/evidence_store.py - Lead Persistence → Database Session: uses session
backend/app/services/lead_persistence.py - Lead Persistence → Company and Scores: writes lead data
backend/app/services/lead_persistence.py - Company CRUD → Company and Scores: manages companies
backend/app/crud.py - Database Session → PostgreSQL: connects
backend/app/database.py - Lead Dashboard → Digital Presence: shows presence