The Sales Agent
Relevant source files
The following files were used as context for generating this wiki page:
The Sales Agent, also referred to as the Sales Ops Agent, is a specialized AI component within the BrightPath AI Operations System. Its primary purpose is to qualify inbound leads, identify upsell opportunities, and manage the sales pipeline for BrightPath Training. It operates as the second stage in a three-agent pipeline, receiving processed data from the Triage Agent to provide high-context, professional sales responses and CRM updates.
Sources: README.md:5-11, agents/sales_agent.md:4-6
As a critical part of the multi-agent system, the Sales Agent interacts with file-based memory and the company CRM to ensure that every lead is handled according to existing contact history and corporate policies. This ensures that the business owner receives actionable summaries and drafted responses that are consistent with the company’s brand and pricing tiers.
Sources: README.md:14-17, agents/sales_agent.md:9-14
Architecture and Role
The Sales Agent is invoked by the orchestrator.py or app.py when the Triage Agent classifies an inbound message category as sales or complex. It functions as a specialist agent that consumes a comprehensive system prompt containing its role definition, current memory state, CRM data, and the specific triage notes generated in the previous step.
Sources: orchestrator.py:202-212, app.py:417-419, agents/triage_agent.md:14-19
Integration Flow
The following diagram illustrates how the Sales Agent fits into the broader message processing pipeline.
This diagram shows the routing from Triage to the Sales Agent and its dependencies on external context.
Sources: README.md:7-12, orchestrator.py:255-263
Core Responsibilities and Logic
The Sales Agent is governed by a specific set of rules and qualification tiers that dictate how it handles different types of leads.
Lead Qualification Tiers
The agent categorizes leads based on budget, decision-making authority, and timeline.
| Tier | Description |
|---|---|
| Hot | Budget confirmed, decision maker identified, timeline within 6 weeks. |
| Warm | Interest confirmed, timeline unclear, requires nurturing. |
| Cold | Early stage, no budget confirmed, long timeline. |
Sources: agents/sales_agent.md:21-25
Operational Rules
- Pre-response Check: Must check
sales_notes.mdfor prior contact history before drafting any response. - Pricing Restrictions: Never quote custom pricing; always offer a discovery call for large requests.
- Threshold Upselling: Suggest an "Annual Training Partnership" if the lead mentions more than 30 people.
- Competitor Handling: Acknowledge competitors briefly but emphasize BrightPath's unique value.
- Re-engagement: Treat any lead with no contact for 14+ days as a re-engagement case.
Sources: agents/sales_agent.md:27-33
Technical Implementation
Execution Interface
In the Python implementation, the Sales Agent is executed via the run_sales_agent function. This function constructs a system prompt by concatenating the agent's markdown definition, memory files, CRM data, and triage output.
def run_sales_agent(message, triage, memory):
system = f"{load_agent('sales_agent')}\n\n--- MEMORY ---\n{memory}\n\n--- CRM ---\n{load_crm()}\n\n--- TRIAGE ---\n{json.dumps(triage, indent=2)}"
return call_claude(system, f"Original message:\n\n{message}")
Sources: app.py:417-419, orchestrator.py:171-182
Data Structures (Output Format)
The Sales Agent returns a structured JSON object. This structure is used by the orchestrator to update the database, modify memory files, and inform the Manager Briefing Agent.
| Field | Type | Description |
|---|---|---|
lead_tier | String | hot, warm, or cold. |
estimated_value | String | low, medium, high, or very_high. |
draft_response | String | Full professional email response for the customer. |
crm_update | Object | Contains status, notes, next_action, and deadline. |
Sources: agents/sales_agent.md:37-53
Sequence of Operation
The following sequence diagram details the interaction between the Orchestrator, the Sales Agent, and the persistent storage layers during a sales request.
The sequence of events from agent invocation to state persistence.
Sources: orchestrator.py:255-275, memory_utils.py:12-18
Memory and State Persistence
The Sales Agent is "stateful" across sessions because it reads from and writes to markdown files in the memory/ directory.
- sales_notes.md: Stores pipeline activity, competitor awareness, and specific activity logs (e.g., Sarah Miles board review dates).
- customer_history.md: Maintains per-customer notes, past workshop attendance, and sentiment history.
- open_tasks.md: Records outstanding actions identified by the agent, such as "Follow up if no reply in 5 days".
Sources: README.md:65-71, memory_utils.py:65-71, memory/sales_notes.md:1-12
Automated Updates
When a sales scenario completes, the system calls run_memory_update. For example, in Scenario 14 (Rachel Drummond re-engagement), the system automatically updates the status from "Cold" to "Warm" in sales_notes.md and adds a high-priority task to the database.
Sources: memory_utils.py:145-167, app.py:350-358
Conclusion
The Sales Agent is the primary driver for revenue-related automation in the BrightPath system. By combining rigid business rules (like pricing tiers and person-count thresholds) with LLM-driven empathy and historical context, it automates lead qualification while ensuring that the business manager remains informed of high-value opportunities through the subsequent briefing stage.
Sources: agents/sales_agent.md:1-15, README.md:1-5