DEV Community

James Collins
James Collins

Posted on

Competitive Intelligence Agent: From Slides to Live Signals

In many B2B organizations, "competitive intelligence" still means hunting through old slide decks, ad‑hoc notes, and a long history of Slack threads. Even if you track competitors somewhere in your CRM, the reality on the ground changes faster than those assets: pricing pages move, job descriptions hint at new bets, and funding announcements reset roadmaps overnight. When your analysis or enablement material lags behind, it becomes background noise instead of a strategic guide.

Historically, closing this gap meant a lot of copy‑paste work: open a few tabs, search for news, skim job boards, and then try to reconcile that with whatever your CRM says about the account. With modern tooling, this workflow can be turned into a repeatable pattern. By combining OpenAI, optional HubSpot CRM access, and SerpApi, a Competitive Intelligence Agent can pull live web signals, overlay your internal context, and return a sourced briefing on demand.

The Challenge: Stale Assets and Fragmented Context

Competitive landscapes do not stand still, but the artifacts we use to describe them often do. Common issues include:

  • Static collateral in a moving market: Competitive decks are produced for a launch, a QBR, or a training session, then slowly drift away from reality.
  • Many sources, no single view: Product marketers and PMs check pricing pages, comparison sites, review platforms, press releases, and job listings—but there is no unified answer to "What is happening with this competitor right now?"
  • Internal knowledge is siloed: Your CRM may already show where a competitor appears in deals and which stakeholders you know, yet that insight rarely shows up in market analysis.

Bringing all of this into a single, timely briefing used to require custom glue code. Standards like the Model Context Protocol (MCP) aim to give models a consistent way to talk to APIs and databases, but in this project we use a straightforward approach: direct integrations with SerpApi and, optionally, the HubSpot SDK.

How the Competitive Intelligence Agent Behaves

The agent follows a simple loop—Plan → Gather → Summarize—to turn scattered data into a coherent briefing.

1. Plan

Given a request such as "Give me a competitive snapshot of acme.com, including what we know in HubSpot," the model decides which tools to use:

  • External: SerpApi‑backed web, news, and jobs search to understand positioning, recent milestones, and hiring focus.
  • Internal (optional): HubSpot company, contact, and activity lookups to see how this competitor (or customer with a known competitor) appears in your own pipeline.

2. Gather

The agent then calls the tools it selected:

  • SerpApi:
  • Web search for pricing pages, comparison articles, and review sites
  • News search for launches, funding, and partnerships within a defined time window
  • Jobs search for roles and locations that hint at strategic priorities
  • HubSpot SDK (optional):
  • Find a company by domain if it already exists in your CRM
  • Look up specific contacts by email
  • Retrieve a timeline of notes, calls, and emails associated with those contacts

Each tool returns structured JSON that can be reasoned about and cited.

3. Summarize

Once enough information has been collected, the model stops calling tools and produces a concise briefing. A typical output might look like:

"Acme emphasizes low‑latency analytics for operational workloads [1], [2]. Over the past month they announced an EU expansion and a partnership with a major cloud provider [3]. In our HubSpot data, we see one open deal where Acme is listed as a competing vendor, plus a Director‑level contact who raised concerns about migration cost three months ago [4]. For upcoming conversations, we should highlight data residency guarantees and total cost of ownership versus their current stack."

The result is something closer to a one‑page memo than a raw list of links.

Key Building Blocks

The repository contains a complete implementation. At a high level, the Competitive Intelligence Agent is assembled from three layers.

1. SerpApi for Web, News, and Jobs

SerpApi handles live search across several Google surfaces:

  • Web search: Company sites, competitor comparison pages, and review content.
  • News search: Time‑bounded news about funding, launches, acquisitions, or leadership changes.
  • Jobs search: Open roles and locations that reveal where and how a company is investing.

Because SerpApi returns normalized JSON instead of HTML, the agent can focus on reasoning over titles, snippets, links, and timestamps rather than scraping and parsing.\n+

2. Optional HubSpot SDK for Internal Context

If you provide a HUBSPOT_ACCESS_TOKEN, the agent also exposes HubSpot‑backed tools that answer "what do we already know?":

  • hubspot_search_company_by_domain — discover whether the company is already in your CRM and retrieve its basic record.
  • hubspot_get_contact_by_email — fetch contact details for known stakeholders.
  • hubspot_get_contact_activity_history — pull a summarized history of notes, calls, and emails tied to that contact.

This turns the agent from a pure external‑research helper into a bridge between the market and your existing pipeline.

3. OpenAI for Orchestration and Writing

An OpenAI model coordinates the process by:

  • Selecting which tools to invoke based on the question.
  • Interpreting the structured JSON returned by SerpApi and HubSpot.
  • Drafting a narrative answer with clear sections and numbered citations.

The Python layer is responsible for defining tools, handling authentication, and streaming tool results back into the conversation; the model is responsible for the reasoning and writing.

Practices for Reliable Briefings

To keep outputs trustworthy and useful, the implementation follows a few simple practices:

  • Explicit citations: External claims—such as funding rounds, launch dates, or pricing changes—are tied to numbered references so readers can verify them.
  • Time‑aware queries: Loose phrases like "recent" or "last month" are translated into date filters for SerpApi, ensuring news queries match the intended window.
  • Read‑only CRM access: HubSpot integration in this project is observational. The agent reads companies, contacts, and activities but does not create or update records.

These constraints make it easier to embed the agent into real workflows without surprising side effects.

Where MCP Fits In

If you are exploring the Model Context Protocol (MCP), this project offers a concrete pattern you could later port into that world. MCP aims to give language models a unified way to talk to tools and data sources. In contrast, this agent wires SerpApi and HubSpot directly via their SDKs and APIs.

Functionally, the shape is similar: the model chooses tools, the runtime executes them, and the model synthesizes an answer. A future variant could swap the direct integrations for SerpApi MCP and a HubSpot MCP server while preserving the same Plan → Gather → Summarize behavior.

Conclusion: Continuous Competitive Sensing

Instead of occasionally updating a competitive deck, teams can move toward continuous competitive sensing—asking for a current snapshot of a market or rival whenever they need it.\n+

By pairing SerpApi, OpenAI, and optional HubSpot CRM, the Competitive Intelligence Agent turns scattered signals into a single, sourced briefing. Strategy, product, and revenue teams get fast context without tab‑sprawl, and they can make decisions with both public information and their own CRM history in view.

Top comments (0)