Ideal Customer Finder

Ideal Customer Finder is an autonomous B2B sales prospecting agent. A sales rep describes their ideal customer in plain English — and a Qwen-powered agent finds matching companies from the live web, enriches them with decision-maker contacts and buying signals, scores each account for fit, and drafts personalized outreach. All in under a minute. Nothing sends without human approval.


The Problem

B2B sales reps spend 70% of their time on work that isn't selling. Researching companies, hunting for the right contact, writing a personalized email — all of it manual, all of it slow, all of it based on stale data from static databases last updated months ago.

The result: reps reach out to companies that just got acquired, contact people who left six months ago, and send generic emails that miss the signal entirely. Pipeline suffers. Quota suffers.

The root cause isn't effort — it's the absence of an agent that can turn a business intent into live, actionable intelligence.


The Solution

Ideal Customer Finder is an Autopilot Agent for B2B prospecting.

A sales rep types one sentence: "Series B fintech companies in North America, 200–500 employees, expanding into enterprise." The agent handles everything from there — sourcing, enrichment, signal detection, scoring, and outreach drafting — end-to-end, with a human checkpoint before anything leaves the system.

This is the core Autopilot Agent pattern: ambiguous business input → autonomous multi-step execution → external tool invocation → human-in-the-loop at the critical moment.


How the Agent Works

The pipeline is a 9-node state machine. Each node has a single responsibility. Qwen drives the reasoning at every stage that requires judgment.

Natural language ICP description (ambiguous input)
    ↓
[Qwen] Parse intent → structured search parameters (industry, size, geography, signals)
    ↓
[Nimble Search API] Find matching LinkedIn company URLs + parse firmographics from snippets
[Qwen text-embedding-v4] Embed ICP definition → store in pgvector (background, non-blocking)
    ↓
[Nimble Search API] Contact enrichment — decision-maker profiles per account
[Qwen text-embedding-v4] Embed each account description → store in pgvector (background, non-blocking)
    ↓
[Nimble Search API] 4 parallel signal queries per company (funding, hiring, expansions, exec changes)
    ↓
[Qwen LLM] Score each account for ICP fit — reasoning over industry, size, geography, and live signals
    + pgvector cosine similarity → dual score: "AI reasoning" + "Semantic match"
    ↓
[Qwen] Generate value hypothesis per top account
    ↓
[Qwen] Write personalized outreach email anchored to a real, current buying signal
    ↓
⚑ Human-in-the-Loop checkpoint — approve or reject each draft before anything sends

The entire pipeline runs in under a minute for approximately 5 cents.


Where Qwen Does the Work

Qwen is active at five stages — not just text generation, but embedding and semantic understanding too.

1. Intent parsing. A sales rep's ICP description is inherently ambiguous. "Fast-growing logistics startups" needs to become a structured query: industry codes, headcount ranges, geographic filters, signal keywords. Qwen translates business intent into search parameters with no manual configuration required.

2. Account scoring. After Nimble returns live firmographic data and buying signals, Qwen evaluates each company against the ICP criteria and assigns a fit score with reasoning. This is not a rules engine — Qwen weighs factors against each other the way a good sales analyst would.

3. Value hypothesis generation. For each top-scoring account, Qwen synthesizes what the prospect's specific situation means for the seller's product — the "so what" that a generic template can never produce.

4. Personalized outreach drafting. Qwen writes each email using the actual buying signal as the hook. Not "I thought you might be interested in..." — but "I saw you just raised your Series B and are expanding into enterprise accounts." The signal is real. The email is specific. The relevance is earned.

5. Semantic embedding. Qwen's text-embedding-v4 model generates 1536-dimensional vector embeddings for both the ICP definition and each sourced account. A pgvector cosine similarity query then scores how semantically close each account is to the ICP — a dimension that rule-based scoring misses. The result is a dual score surfaced in the UI: "AI reasoning" (Qwen LLM judgment) and "Semantic match" (vector similarity). The embedding writes are fire-and-forget background threads — they never block the pipeline.

6. Voice narration. Qwen's Qwen3-TTS-Flash-Realtime model narrates each pipeline step as it executes — "Scanning the live web for buying signals", "Qwen scoring each account for ICP fit", etc. — and announces the final result when the agent completes. On dashboard load, a personalized greeting plays — including a reminder to review any pending outreach drafts.

7. Voice input. Qwen's Qwen3-ASR-Flash model powers the ICP Builder's mic button — a sales rep can describe their ideal customer by speaking rather than typing. The recording is transcribed and dropped into the chat input, ready to send or edit.

Voice input via getUserMedia requires a secure context (HTTPS or localhost) — browsers block microphone access on plain HTTP. The production deployment uses a custom domain with a Let's Encrypt SSL certificate rather than the raw ECS public IP precisely to enable this — without HTTPS, the mic button would be silently disabled in production.

8. Draft rewriting. When a rep rejects an outreach draft, they can optionally type feedback — "too formal", "lead with the hiring signal instead", "shorter". Qwen rewrites the email incorporating that feedback and creates a new draft in the approval queue, linked to the rejected original. The HITL checkpoint becomes a feedback loop, not just a gate: human judgment improves the output rather than discarding it.

9. AI avatar video hook. Once a rep approves an outreach draft, they can generate a personalised talking-head video to attach to the email. Three Qwen models chain together to produce it: a character model writes a natural spoken script from the value hypothesis, TTS synthesises it into audio, and a video model animates a static avatar with that audio to produce a downloadable MP4. The avatar speaks directly to the prospect by company name, references their specific buying signal, and closes with a call to action. The rep is notified by voice when the video is ready, and can regenerate if they want a different take.

The avatar itself is generated on the Avatar page using two additional Qwen models: wan2.6-t2i generates a new portrait from a text description, while qwen-image-2.0 edits an existing photo — either pasted as a URL or uploaded directly from disk. The rep picks the result they want and activates it as their avatar with one click. The active avatar persists across container restarts via a marker file on the host volume mount.

The Avatar page also lets the rep choose the voice for their video — six curated Qwen TTS voices are presented in two groups (female and male), each with a one-line description of its sales style and a live preview button. The selected voice is saved alongside the active avatar and used automatically for all future video generation. This matters because the avatar and voice must match: a male avatar speaking in a female voice breaks the illusion the video is designed to create. The voice selection is independent of avatar generation — a rep can swap voices at any time without regenerating their portrait.

For reps who want the video to sound like them, the Avatar page also offers voice cloning via cosyvoice-v3-plus. The rep reads a short sample sentence aloud — the browser records it, uploads it to the backend, and Dashscope's VoiceEnrollmentService clones the voice in ~30 seconds. The resulting voice_id is stored in the same marker file as the avatar and preset voice, and used automatically for all future video generation. The cloned voice replaces the preset selection — the rep's own voice drives the avatar.


Handling Ambiguous Inputs

The Autopilot Agent track specifically calls out handling ambiguous inputs as a key criterion. This is where most prospecting tools break down — they require exact company names, known LinkedIn URLs, or rigid filter selections.

Ideal Customer Finder accepts a free-form natural language ICP. Qwen's first node is entirely dedicated to resolving ambiguity: extracting intent, inferring unstated criteria, and structuring the query in a way that Nimble's Search API can execute against the live web. A rep who has never heard of LinkedIn's industry taxonomy can describe their ideal customer in plain English and get back a qualified pipeline.


External Tool Invocation

The agent invokes Nimble's Search API at three distinct stages:

  • Account sourcing — live LinkedIn company page search, returning URLs and firmographic snippets
  • Contact enrichment — LinkedIn profile search per account to find decision-maker names, titles, and profile URLs
  • Signal detection — 4 concurrent search queries per company across funding, hiring, executive change, and market expansion signals

In a live run against a Series B Fintech Scaleup ICP:

  • 10 matching companies found from live LinkedIn search
  • 35 decision-maker contacts enriched via profile search
  • 78 buying signals retrieved from live web results
  • 5 personalized outreach drafts generated, queued for human approval

Every one of those numbers is zero without live web tool invocation at runtime.


Human-in-the-Loop Design

Ideal Customer Finder never sends anything automatically. Every outreach draft waits in a review queue — the rep sees the company, the contact, the buying signal Qwen anchored the email to, and the draft itself. They approve or reject. Only then does the draft proceed.

This is intentional architecture, not a missing feature. The Autopilot Agent track calls out HITL checkpoints at critical decision points as a requirement. Outbound email is a reputational action. Automation handles the research and drafting. A human makes the final call.

Rejection is not a dead end. If the rep types feedback when rejecting — "too long", "lead with the funding signal", "more direct" — Qwen rewrites the draft incorporating that feedback and returns a new version to the approval queue. The rejected draft is preserved in the audit trail; the rewrite is badged so the rep can see its lineage. The loop closes: human judgment feeds back into the model output.


Production Architecture

This is not a demo. It is a v1 production application.

  • Multi-tenant PostgreSQL with Row-Level Security — tenant isolation enforced at the database engine level, not the application layer. Even if application filtering is bypassed, the database rejects cross-tenant row access.
  • pgvector with HNSW indexvector(1536) columns on accounts and icps tables; Qwen embeddings stored and queried at agent runtime
  • Celery async workers — the agent pipeline runs as a background task; the frontend polls for progress without blocking
  • JWT authentication — stateless, expiring tokens
  • Full observability — every Nimble API call and every Qwen LLM call is traced: inputs, outputs, token counts, reasoning, and latency logged to the database and surfaced in the UI
  • Deployed on Alibaba Cloud ECS — containerized with Docker, reverse-proxied with Nginx, running in production

Three architectural decisions reflect deliberate engineering rather than convenience:

Custom TypedDict state machine — zero framework dependencies. The 9-node pipeline is implemented as a plain Python state machine using TypedDict for shared state. No LangChain, no LangGraph, no agent framework. Each node is a method with a single responsibility: read state, call its tool or LLM, write results back. This makes the pipeline fully inspectable, trivially testable, and free of framework abstractions that obscure what the agent is actually doing.

Connector framework — extensible by design. BaseConnector defines the interface; ConnectorRegistry maps connector types to implementations. Adding a new data source requires one file with zero changes to core platform code. The Nimble MCP connector and the direct Nimble connector are both registered implementations — switchable via USE_NIMBLE_MCP in .env without touching the agent.

Semaphore-capped parallel signal detection. The signal detection node fires up to 40 concurrent Nimble Search API calls (10 accounts × 4 signal queries). Without a concurrency cap this burst triggers 429 rate limit retries that add latency and risk signal loss. An asyncio.Semaphore(6) splits the load into batches, eliminating 429s with negligible wall-clock cost — later domains wait ~1–2s for a slot, far less than the retry delay it replaces.

A sales manager can open the trace for any agent run and see exactly what data Nimble returned, exactly how Qwen scored each account and why (including both LLM and semantic scores), and exactly what signal anchored each email draft. The system is fully auditable.


Track Fit: Autopilot Agent

Ideal Customer Finder was built to satisfy every criterion of the Autopilot Agent track:

Criterion How it's met
Automates a real-world business workflow end-to-end Full B2B prospecting pipeline: ICP → sourced accounts → enriched contacts → detected signals → dual-scored leads → personalized drafts → AI avatar generation → AI avatar video hook
Handles ambiguous inputs Natural language ICP → structured query via Qwen; no templates or dropdowns required
Invokes external tools Nimble Search API called at three pipeline stages with up to 51 concurrent API calls per run (1 sourcing + 10 contact + 40 signal); wan2.7-i2v video generation via Dashscope REST; wan2.6-t2i + qwen-image-2.0 avatar generation via Dashscope SDK; cosyvoice-v3-plus voice cloning via Dashscope tts_v2 SDK
Human-in-the-loop at critical decision points Explicit approval gate before any outreach draft proceeds; rep records voice sample and activates cloned voice before it is used in video; rep selects and activates avatar before it is used in video; rep reviews and downloads video before attaching to email
Production-readiness over toy demos Multi-tenant database, async workers, JWT auth, full tracing, pgvector HNSW index, dual LLM+semantic scoring, live Alibaba Cloud deployment

Monetization

The buyer: B2B SaaS or fintech companies transitioning from founder-led sales to structured outbound — typically 50–500 employees, Series A–C, with 2–10 SDRs spending most of their week on research instead of selling.

The math: Sales reps cost $80–150K/year. If 70% of that time is non-selling work, companies are paying $56–105K per rep per year for work Ideal Customer Finder automates for ~$0.02 per run.

Tier Price Included
Starter $99/user/month 50 agent runs/month, 1 ICP
Growth $199/user/month 200 agent runs/month, unlimited ICPs
Team $299/user/month Unlimited runs, team workspace, API access

Competitive landscape:

Product Price Gap vs Ideal Customer Finder
Apollo.io $49–99/user/month Static contact database, no live signal detection
Clay $149–800/month Enrichment workflows, no autonomous agent
Outreach.io $100+/user/month Sequencing only, no sourcing or signal detection
6sense $30–60K/year Intent data, enterprise only, no outreach generation

Ideal Customer Finder sits between Clay (enrichment) and 6sense (intent data) — live signal detection plus autonomous agent execution plus HITL approval in a single workflow. That gap is real and currently unoccupied at the mid-market price point.

What makes it shippable today: multi-tenant RLS isolation at the database engine level, persistent storage across deployments, full agent audit trail, HITL by design, and a connector framework that adds new data sources in one file with zero changes to core platform code.

What's next: email sending (the HITL approval flow is complete; wiring the actual send step is one Celery task) and self-serve onboarding with Stripe billing to complete the monetization loop.


Qwen Model Selection

The pipeline uses two Qwen tiers deliberately. qwen3.7-plus handles the parallel structured-output nodes — ICP translation, signal inference, account scoring — where throughput and cost matter more than creative depth. qwen3.7-max handles the synthesis nodes — value hypothesis generation and personalized outreach — where output quality directly affects what the sales rep sees at the HITL checkpoint.

Three models were evaluated for the Nimble MCP integration path (qwen3.5-flash, qwen3.6-flash, qwen3.7-plus). The two lighter models skip MCP tool calls on complex structured prompts — returning in_tok=~170-190 with no tool loaded and answering from training data instead. Only qwen3.7-plus invoked the MCP tool reliably across all prompt types. A separate bottleneck was identified during parallel load testing: Dashscope throttles MCP tool invocations under concurrent requests. The architecture routes step 1 (single call) through MCP and steps 2–3 (up to 50 parallel calls) through the direct Nimble connector.

Built With

  • alibaba-cloud-ecs
  • celery
  • cosyvoice-v3-plus
  • dashscope
  • docker
  • fastapi
  • jwt
  • next.js
  • nginx
  • nimble-mcp-server
  • nimble-search-api
  • pgvector
  • postgresql
  • python
  • qwen-flash-character
  • qwen-image-2.0
  • qwen-text-embedding-v4
  • qwen3-asr-flash
  • qwen3-tts-flash-realtime
  • qwen3.7-max
  • qwen3.7-plus
  • redis
  • ssl-certificate
  • wan2.6-t2i
  • wan2.7-i2v
Share this project:

Updates