The modern B2B sales cycle often begins with a grueling, manual scavenger hunt. Sales development representatives spend their mornings scrolling through Reddit threads, monitoring Hacker News, and tracking GitHub stars, searching for that one specific signal—a frustrated user complaining about a competitor or a founder announcing a new product launch. Even when a promising lead surfaces, the work is far from over. To qualify that lead, a human must cross-reference the user's activity across multiple communities to ensure the signal is genuine and timely. For the team at Thrad.ai, this ritual of analyzing six different sources per lead consumed between 30 and 45 minutes of manual labor per person. The friction was not just the time spent, but the cognitive load of switching between disparate API structures and data formats.

The Four-Agent Architecture for Automated Discovery

To eliminate this manual bottleneck, Thrad.ai engineered a multi-agent pipeline powered by Amazon Bedrock, moving away from the limitations of a single-model prompt toward a specialized workforce of four distinct agents. The process begins with a parallel data acquisition phase. The Trend Research Agent acts as the primary scout, querying six high-signal sources: Hacker News, YouTube, dev.to, Product Hunt, Reddit, and Stack Overflow. Its sole objective is to identify product launches or explicit purchase intent. Simultaneously, the Search Specialist Agent operates in the background, enriching the lead's profile by scraping Wikipedia, GitHub, Lobsters, and Stack Overflow to provide deeper contextual background. By assigning dedicated sources and tools to separate agents, the system avoids the precision loss that typically occurs when a single LLM attempts to manage too many external tool calls at once.

Once the raw data is aggregated, it is passed to the Analysis Agent. This agent utilizes the Claude Sonnet 4.6 model via Amazon Bedrock to evaluate the pairing of the potential customer and the identified trend. To streamline deployment and reduce the complexity of region-specific ARN configurations, the team implemented the global inference profile `global.anthropic.claude-sonnet-4-6`. This allows the system to route requests to the optimal region automatically, ensuring low latency and high availability. The Analysis Agent assigns a quality score from 0 to 100; only leads that cross a specific threshold are passed to the final stage. The Email Generation Agent then takes over, synthesizing the research into a personalized outreach draft that adheres to strict brand guidelines and undergoes a final verification check before being queued for delivery.

Triangulation and the Logic of Signal Validation

Collecting vast amounts of data is trivial, but the real challenge in AI-driven research is the proliferation of noise. A single post on a forum is often just a promotional blurb or a fleeting comment, not a qualified business opportunity. To solve this, Thrad.ai implemented a process called Triangulation. The system refuses to recognize a lead unless evidence is confirmed across at least two independent sources. For instance, a product announcement on a developer forum is ignored unless it is corroborated by a corresponding spike in GitHub stars, a request for recommendations in a separate thread, or active discussions on Stack Overflow. This gating mechanism ensures that high-cost inference tokens are not wasted on low-probability leads.

To enforce this rigor, the team integrated Pydantic to establish strict output contracts between agents. By forcing the LLM to adhere to a predefined schema at runtime, the system ensures type safety. If an agent returns data that deviates from the expected format, the system intercepts the error immediately, preventing a cascade of failures in the downstream analysis. This structural discipline allows the Analysis Agent to apply a sophisticated weighted scoring system to every lead. The valuation is broken down into five metrics: topic suitability (25%), timing relevance (20%), engagement potential (20%), intent signals (20%), and data quality (15%).

Adding a layer of temporal intelligence, the system applies a Temporal Decay logic to prioritize urgency. Signals generated within the last 24 hours receive a 1.5x multiplier to their score, while signals older than seven days are penalized with a 0.5x multiplier. This ensures the sales team engages with leads while the intent is still fresh. Furthermore, the system applies a bonus of up to 10 points for leads that match the Ideal Customer Profile (ICP), specifically those operating open-source projects with a focus on B2B developer tools.

Swarm vs Graph: Choosing the Right Orchestration

One of the most significant technical hurdles in multi-agent systems is the risk of infinite loops and token exhaustion during agent handoffs. Thrad.ai benchmarked two distinct orchestration patterns—Swarm and Graph—to determine which best suited the lead research workflow. The Swarm approach relies on dynamic control transfer using a `handoff_to_agent` tool and shared memory. In this model, the Trend Research Agent can pass a lead to the Search Specialist, who then passes it to the Analysis Agent. Crucially, if the Analysis Agent determines the information is insufficient, it can dynamically route the request back to the research phase for more context. To prevent the system from looping indefinitely, the team implemented a safety window of 8 handoffs and a requirement for at least 3 unique agents to be involved before the process is forced forward.

python

Swarm configuration and handoff parameter example

swarm_config = {

"handoff_window": 8,

"min_unique_agents": 3,

"shared_memory": True

}

In contrast, the Graph approach utilizes a fixed Directed Acyclic Graph (DAG). In this configuration, the Trend Research and Search Specialist agents act as parallel entry points, executing simultaneously to reduce total latency. The Analysis Agent only triggers once both preceding agents have completed their tasks. The system uses conditional edges to ensure that only leads with a score of 60 or higher proceed to the Email Generation stage, effectively cutting off low-quality leads before they incur further costs.

python

Graph definition with parallel entry points and conditional edges

workflow = Graph()

workflow.add_edge("TrendResearch", "Analysis")

workflow.add_edge("SearchSpecialist", "Analysis")

workflow.add_conditional_edge("Analysis", "EmailGen", lambda x: x.score >= 60)

When benchmarking these two methods against a workload of 50 leads, the results revealed a clear trade-off. The Swarm pattern excelled in complex scenarios where agents needed to iteratively refine their search, providing superior flexibility. However, this came at the cost of unpredictability and higher token consumption due to the reasoning required for each handoff. The Graph pattern provided high auditability and reproducibility; because every lead followed the same path, failures were easy to debug and reproduce. The limitation of the Graph was its rigidity; adding a feedback loop required manually redefining the DAG edges.

For organizations looking to implement similar systems, the choice depends on the nature of the task. If the workflow is repetitive and requires a strict audit trail for compliance or quality control, the Graph pattern is the optimal choice. If the task is exploratory and requires agents to autonomously decide when more information is needed, the Swarm pattern is more effective. Implementing these architectures requires proficiency in Python, basic knowledge of the AWS Cloud Development Kit (CDK), and a deep understanding of LLM prompt engineering. Detailed implementation guides and the full codebase are available in the [README.md](README.md) of the project repository.

The burden of B2B lead generation has shifted from the manual labor of searching to the intellectual labor of agent design. The quality of the automation is no longer determined by the power of the underlying model, but by the precision of the orchestration logic.

Ultimately, the success of AI automation depends on the designer's ability to find the equilibrium between predictability and flexibility.