> Source: https://builder-docs.ema.ai/builder-guides/examples/sales-intelligence
> Title: Example: Building a Sales Intelligence Assistant

# Example: Building a Sales Intelligence Assistant

> This walkthrough builds a Sales Intelligence AI Employee that accepts a company name and produces a detailed market intelligence report as a downloadable document.

## What You Will Build

A chatbot AI Employee that:

-   Takes a company name as input
-   Searches the web for market intelligence on that company
-   Synthesizes search results into a structured report
-   Generates a downloadable document containing the report

## Prerequisites

-   Access to the GWE platform

## Create the AI Employee

1.  Navigate to the GWE platform.
2.  Locate the tile labeled **GWE Chatbot Persona**.
3.  Click **Create and save** and assign a name (for example, "Sales Intel Assistant").

## Access the Workflow Builder

1.  Click **Go to Workflow builder** on the confirmation screen.
2.  A **Chat Trigger** block is automatically present. This block handles all incoming user conversations.

## Step 1: Rewrite the User Query for Web Search

1.  Add a **Respond to a Query** agent to the canvas.
    
2.  Connect the chat trigger's **user query** to this agent's **query input**.
    
3.  Write instructions that tell the agent to convert the company name into an effective web search query. For example:
    
    > "Given a company name, generate a search query that will return recent market intelligence, financials, competitive landscape, and news about the company."
    

## Step 2: Add the Deep Web Search Agent

1.  Add the **Deep Web Search** agent.
2.  Connect the **response output** from the Respond to a Query agent (Step 1) to the Deep Web Search agent's **query input**.

The Deep Web Search agent executes a live web search and returns relevant results.

## Step 3: Consolidate Search Results

1.  Add a **Respond to a Query** agent.
2.  Connect the Deep Web Search agent's output to this agent's input.

This agent formats and consolidates the raw search results into structured content that downstream agents can use.

## Step 4: Generate the Market Intelligence Report

1.  Add another **Respond to a Query** agent.
    
2.  Connect the output from the previous agent to this agent's **query input**.
    
3.  Write instructions that tell the agent to produce a comprehensive market intelligence document. For example:
    
    > "Using the provided search results, write a detailed market intelligence report covering company overview, recent news, financial highlights, competitive landscape, and strategic outlook. Use clear section headings and bullet points."
    

## Step 5: Generate a Downloadable Document

1.  Add a **Publish Document** agent.
2.  Connect the response output from Step 4 to the Publish Document agent's input.
3.  Configure the document name (for example, use the company name as the file title).

The Publish Document agent converts the text response into a downloadable document file.

## Test the Workflow

1.  Click **Use AI Employee** in the top-right corner of the workflow builder.
2.  This redirects you to a chat window.
3.  Enter a company name (for example, "Salesforce" or "Stripe").
4.  The workflow will execute all steps and produce a downloadable market intelligence document.

## Next Steps

-   [Document Generation](/legacy-docs/builder-guides/document/document-generation) -- learn more about configuring the Document Generator agent and using style guides.
-   [Writing Effective Instructions](/legacy-docs/builder-guides/chat/writing-instructions) -- improve the quality of generated reports by refining agent instructions.
-   [Creating AI Employee Templates](/legacy-docs/builder-guides/advanced/creating-templates) -- package this workflow as a reusable template for your team.
