Sales Notes & Pipeline Data
Relevant source files
The following files were used as context for generating this wiki page:
The Sales Notes & Pipeline Data system within BrightPath Training serves as the centralized repository for lead qualification, pipeline tracking, and historical customer engagement. It integrates structured data from a CRM JSON database with semi-structured Markdown memory files to provide specialist agents with the context necessary for lead conversion and account management.
This system is primarily utilized by the Sales Ops Agent to qualify leads, identify upsell opportunities, and update the CRM based on inbound communications. By combining historical data with real-time updates, the system ensures that sales representatives can frame ROI and address objections effectively.
Sources: agents/sales_agent.md:1-12, README.md:120-130
Data Architecture & Storage
The system utilizes a multi-tiered storage approach to manage sales data, combining a relational database for events, a JSON file for structured contact data, and Markdown files for long-form context.
Structured CRM Data
The core contact information is stored in data/crm.json. Each entry includes unique identifiers, financial metrics, and behavioral tags.
| Field | Type | Description |
|---|---|---|
id | String | Unique contact identifier (e.g., C001) |
name | String | Full name of the contact |
company | String | Associated organization name |
status | String | Current state (e.g., warm_lead, active, cold_lead) |
vip | Boolean | High-priority customer flag |
annual_value | Number | Recurring annual revenue for partners |
estimated_value | Number | Potential revenue for prospects |
tags | List | Categorical labels (e.g., slow_payer, upsell_coaching) |
Sources: data/crm.json:1-92
Semi-Structured Pipeline Memory
The memory/sales_notes.md file tracks high-level pipeline activity, including company names, deal stages, and deadlines. It also records qualitative "Conversion Notes" such as typical objections and decision-maker profiles.
Sources: memory/sales_notes.md:1-40
Relational CRM Logs
A SQLite database (brightpath.db) contains a crm_log table used to record specific actions taken by agents during a pipeline run.
CREATE TABLE IF NOT EXISTS crm_log (
id INTEGER PRIMARY KEY AUTOINCREMENT,
timestamp TEXT,
contact TEXT,
action TEXT,
notes TEXT
)
Sources: app.py:270-275, orchestrator.py:75-81
Data Flow & Agent Integration
The sales pipeline follows a structured flow where inbound messages are enriched by memory before being processed by the Sales Ops Agent.
Pipeline Logic Diagram
This diagram illustrates how sales data is retrieved from memory and then written back during a pipeline run.
The system ensures data consistency by reading from load_memory() and load_crm() at the start of every specialist agent call.
Sources: app.py:465-480, orchestrator.py:290-305
Memory Management Utilities
The memory_utils.py module provides the logic for modifying the sales pipeline data. It uses structured appending to ensure Markdown files remain scannable for both humans and LLMs.
Key Functions
update_sales_notes(company, contact, update_lines): Appends new activity logs tosales_notes.mdwith a date header.update_customer_history(contact, update_lines): Locates a customer's section incustomer_history.mdand inserts a timestamped update block.log_crm(contact, action, notes): Commits a record to the SQLitecrm_logtable.
Sources: memory_utils.py:100-140, app.py:290-295
Scenario-Specific Logic
The system includes automated memory updates for specific sales scenarios. For example, when a cold lead re-engages, the system automatically triggers a status update in both the customer history and the sales notes.
def memory_update_14_rachel_reengaged(triage, agent_result):
update_customer_history("Rachel Drummond — Stormfront Media (Prospect)", [
"Status updated: Cold lead → Re-engaged / Warm",
"Referenced original proposal — ready to move forward",
])
update_sales_notes("Stormfront Media", "Rachel Drummond", [
"Status: Cold → Warm — update pipeline immediately",
])
Sources: memory_utils.py:220-235
Sales Qualification & Pricing Logic
The Sales Ops Agent uses the pipeline data to categorize leads into specific tiers based on the information found in the CRM and sales notes.
Lead Qualification Tiers
| Tier | Criteria |
|---|---|
| Hot | Budget confirmed, decision maker identified, timeline < 6 weeks |
| Warm | Interest confirmed, timeline unclear, needs nurturing |
| Cold | Early stage, no budget, long timeline |
Sources: agents/sales_agent.md:30-36
Standard Product Pricing
The agent refers to the following pricing structure when evaluating potential deal value in the pipeline:
- Corporate (5–15 people): £2,200 (half) / £3,800 (full)
- Corporate (16–30 people): £3,500 (half) / £5,500 (full)
- Leadership Coaching: £350/session
- Annual Training Partnership: From £12,000/year
Sources: agents/sales_agent.md:15-25
Summary
The Sales Notes & Pipeline Data system provides a robust framework for managing the lifecycle of a lead within BrightPath Training. By utilizing a combination of the crm.json file for entity data and sales_notes.md for activity tracking, the system enables the AI agents to maintain a long-term memory of customer interactions, handle duplicate leads across different contacts, and proactively identify upsell opportunities during routine communications.
Sources: README.md:120-135, memory_utils.py:255-275