Use Cases & Examples
Real-world scenarios and code examples showing how to use BrainPredict Sales to solve common sales challenges.
Use Case 1: Predict Deal Outcomes
Scenario
Your sales team has 50 active deals in the pipeline. You need to forecast which deals will close this quarter and prioritize sales efforts accordingly.
Solution
Use the Deal Predictor AI model to get close probability and expected close date for each deal:
from brainpredict_sales import BrainPredictSales
client = BrainPredictSales(api_key='YOUR_API_KEY')
# Get all active deals from CRM
deals = client.get_opportunities(status='open', limit=50)
# Predict outcomes for all deals
predictions = []
for deal in deals:
prediction = client.predict_deal(
opportunity_id=deal['id'],
deal_value=deal['amount'],
stage=deal['stage'],
days_in_stage=deal['days_in_stage'],
contact_count=deal['contact_count'],
last_activity_days=deal['last_activity_days']
)
predictions.append(prediction)
# Sort by close probability (highest first)
predictions.sort(key=lambda x: x['close_probability'], reverse=True)
# Print top 10 deals most likely to close
print("Top 10 Deals Most Likely to Close:")
for i, pred in enumerate(predictions[:10], 1):
print(f"{i}. Deal {pred['deal_id']}: {pred['close_probability']}% probability")
print(f" Expected close: {pred['expected_close_date']}")
print(f" Recommended actions: {', '.join(pred['recommendations'])}")
print()
# Calculate total forecasted revenue
total_revenue = sum(p['predicted_value'] for p in predictions)
print(f"Total Forecasted Revenue: €{total_revenue:,.0f}")Results
- +35% win rate by focusing on high-probability deals
- -30% sales cycle by addressing risk factors early
- 95% forecast accuracy for quarterly revenue planning