A production-grade, multi-threaded Python sales agent designed to simulate concurrent lead conversations, automate follow-ups, and persist lead data in a lightweight CSV format. It features a modern CLI interface powered by the rich library.
Demo: Tella Video Walkthrough
- Multi-threaded lead handling with safe concurrency (5+ conversations)
- Structured terminal interface using
rich - Background follow-up scheduler for delayed responses
- Persistent data storage in CSV format
- Thread-safe design using resource locks
sales-agent/
├── agent.py # Lead conversation logic
├── followup\_manager.py # Background reminder system
├── main.py # Thread orchestration and app entry
├── trigger\_simulator.py # Lead event simulator
├── leads.csv # Saved leads
├── requirements.txt # Python dependencies
└── README.md # Documentation
git clone https://github.com/AmaedaQ/sales-agent.git
cd sales-agent
python -m venv venv
# Activate environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate
pip install -r requirements.txtpython main.py- Runs 5 concurrent conversations
- Triggers automated follow-up handler
- All data saved to
leads.csv
python main.py --leads 10
python followup_manager.py --test-mode
python trigger_simulator.py --count 3| File | Description | Key Concepts |
|---|---|---|
agent.py |
Handles dialogue and lead capture | rich, CSV, I/O |
followup_manager.py |
Tracks follow-up timelines | threading, datetime |
main.py |
Spawns and manages threads | threading, queue |
trigger_simulator.py |
Simulates lead events | CLI, randomization |
lead_id,name,age,country,interest,status
1001,Alice,29,Canada,CRM Tools,secured
1002,,,,,no_response
-
Simulate high load:
python main.py --leads 20
-
Fast-forward follow-ups:
python followup_manager.py --test-delay 5
-
Validate CSV entries:
python -c "import csv; print(len(list(csv.reader(open('leads.csv')))))"
- Chose multithreading for true concurrent task simulation
- CSV provides a fast, tool-friendly storage method for prototyping
richenhances terminal output with better UX and visibility- Background scheduler runs as a daemon thread for real-time automation
This project is licensed under the MIT License.
