A sophisticated multi-agent AI system for intelligent car sales, demonstrating advanced agent coordination, real-time research, and professional sales workflows.
Originally developed by Eduardo Hilario for AI Agents Day demo.
CarBot Pro showcases the cutting-edge capabilities of multi-agent AI systems in a real-world sales scenario. The system coordinates three specialized AI agents to provide a complete, professional car buying experience with intelligent inventory management, real-time research, and advanced negotiation capabilities.
Agent | Model | Role | Specialization |
---|---|---|---|
π― Carlos | GPT-4o | Sales Expert | Customer interaction, sales process, negotiation |
π¬ MarΓa | o4-mini | Research Specialist | Vehicle research, technical analysis, market data |
π’ Manager | GPT-4o | Business Coordinator | Inventory management, pricing, business policies |
- π§ Intelligent Agent Coordination - Seamless communication between specialized agents
- π Smart Inventory Search - AI-powered vehicle matching with 40+ enriched vehicle database
- π Real-time Web Research - Live vehicle information via SerpAPI integration
- π Dynamic Customer Profiling - Automatic extraction and management of customer preferences
- πΌ Professional Sales Process - Complete sales funnel from greeting to closing
- π Real-time Analytics - Comprehensive metrics and conversation analytics
- π State Management - Advanced sales stage tracking and progression
- Greeting - Initial rapport building
- Discovery - Needs assessment and profiling
- Presentation - Intelligent vehicle recommendations
- Objection Handling - Professional concern resolution
- Negotiation - Policy-based pricing and alternatives
- Closing - Sale finalization with inventory updates
- Follow-up - Post-sale relationship management
- Comprehensive Data: Make, model, year, color, mileage, price
- Technical Specs: Engine, transmission, fuel efficiency, safety ratings
- Special Features: Technology packages, interior details, location
- Price Range: β¬25,000 - β¬320,000 (economy to luxury supercars)
git clone https://github.com/LIDR-academy/car-salesman.git
cd car-salesman
python quick_setup_advanced.py
- Python 3.8 or higher
- OpenAI API key (required)
- SerpAPI key (optional, for web research)
- Clone the repository
git clone https://github.com/LIDR-academy/car-salesman.git
cd car-salesman
- Create virtual environment
python -m venv .venv
# Activate (Linux/macOS)
source .venv/bin/activate
# Activate (Windows)
.venv\Scripts\activate
- Install dependencies
pip install --upgrade pip
pip install -r requirements.txt
- Configure environment variables
cp config.env .env
# Edit .env with your API keys
- Set up API keys in
.env
# Required: OpenAI API Key
OPENAI_API_KEY=sk-your_openai_key_here
# Optional: SerpAPI Key for web research
SERPAPI_API_KEY=your_serpapi_key_here
- Run the application
streamlit run enhanced_app.py
- Access the interface
- Open your browser to
http://localhost:8501
- Configure API keys in the sidebar
- Click "π Initialize Advanced System"
- Start chatting with Carlos!
- Open your browser to
# Example conversation flow
customer_input = "I'm looking for a safe family car"
# System processes through multi-agent workflow:
# 1. Carlos updates customer profile
# 2. Carlos consults Manager for inventory options
# 3. Manager searches inventory and provides recommendations
# 4. Carlos presents options to customer
# 5. Customer asks for technical details
# 6. Carlos requests research from MarΓa
# 7. MarΓa provides detailed analysis
# 8. Carlos shares processed information with customer
"Hi, I'm looking for a car"
Expected: Carlos greets and builds rapport
"I need a bigger, safer car because we just had a baby"
Expected: Carlos updates customer profile, shows understanding
"I want a red sedan that's less than 2 years old"
Expected: Carlos consults Manager, searches inventory
"I'm interested in BMW vehicles"
Expected: Carlos refines search, presents BMW options
"What safety features does it have for babies?"
Expected: Carlos requests research from MarΓa
"What's the trunk space in the BMW X3?"
Expected: MarΓa provides technical specifications
"What's the price of the black BMW X3?"
Expected: Carlos consults Manager for official pricing
"Can you offer any discount?"
Expected: Manager evaluates policies, Carlos negotiates
"I'll take it"
Expected: Carlos finalizes sale, updates inventory
graph TB
Client[π€ Customer]
subgraph "Multi-Agent System"
Carlos[π― Carlos<br/>Sales Agent<br/>GPT-4o]
Maria[π¬ MarΓa<br/>Research<br/>o4-mini]
Manager[π’ Manager<br/>Coordinator<br/>GPT-4o]
subgraph "Carlos Tools"
T1[ConsultManager]
T2[ResearchVehicleInfo]
T3[UpdateCustomerProfile]
T4[UpdateSalesStage]
T5[RespondToClient]
T6[FinalizeSale]
T7[UpdateNotes]
end
end
subgraph "External Systems"
Inventory[π Inventory DB]
SerpAPI[π SerpAPI]
KB[π Knowledge Base]
end
Client <--> Carlos
Carlos <--> T1
Carlos <--> T2
T1 <--> Manager
T2 <--> Maria
Manager <--> Inventory
Maria <--> SerpAPI
Maria <--> KB
- π€ AI Models: OpenAI GPT-4o, o4-mini
- π Agent Framework: LangChain
- π₯οΈ Frontend: Streamlit
- π Data Processing: Pandas, NumPy
- π Visualization: Plotly
- π Web Search: SerpAPI
- π Language: Python 3.8+
langchain>=0.3.25
langchain-openai>=0.3.18
langchain-community>=0.3.24
streamlit>=1.45.1
pandas>=2.2.3
plotly>=5.17.0
openai>=1.82.0
python-dotenv>=1.1.0
carbot-pro/
βββ π README.md # This file
βββ π quick_setup_advanced.py # Automated setup script
βββ π― advanced_multi_agent_system.py # Core multi-agent system
βββ π¦ enhanced_inventory_manager.py # Inventory management
βββ π₯οΈ enhanced_app.py # Streamlit interface
βββ π§ͺ test_system.py # System tests
βββ π requirements.txt # Python dependencies
βββ βοΈ config.env # Environment template
βββ π data/ # Vehicle database
βββ π carbot_system.log # System logs
Variable | Required | Description |
---|---|---|
OPENAI_API_KEY |
β Yes | OpenAI API key for GPT-4o and o4-mini |
SERPAPI_API_KEY |
β Optional | SerpAPI key for web research (fallback to knowledge base) |
Each agent can be customized with different parameters:
# Carlos (Sales Agent)
carlos_llm = ChatOpenAI(
temperature=0.8, # Creative for sales
model_name="gpt-4o", # Latest GPT-4o
max_tokens=1000
)
# MarΓa (Research Agent)
maria_llm = ChatOpenAI(
temperature=1, # Factual for research
model_name="o4-mini", # Efficient for analysis
max_tokens=800
)
# Manager (Coordinator)
manager_llm = ChatOpenAI(
temperature=0.4, # Balanced for decisions
model_name="gpt-4o", # Strategic thinking
max_tokens=600
)
- Conversation Analytics: Interaction count, agent communications
- Sales Performance: Stage progression, conversion tracking
- Customer Profiling: Profile completeness, preference analysis
- Agent Efficiency: Response times, tool usage patterns
The system provides comprehensive logging:
- Agent Actions: All agent decisions and tool usage
- Inter-Agent Communications: Message flow between agents
- Customer Interactions: Complete conversation history
- System Events: Inventory updates, errors, performance metrics
Run the test suite to verify system functionality:
python test_system.py
The test suite covers:
- β Agent initialization
- β Tool functionality
- β Inventory operations
- β Customer profile management
- β Sales stage transitions
We welcome contributions! Here's how you can help:
- π§ New Agent Tools: Expand Carlos's capabilities
- π Additional Research Sources: Integrate more data providers
- π Enhanced Analytics: Advanced metrics and visualizations
- π¨ UI Improvements: Better Streamlit interface
- π§ͺ Testing: Expand test coverage
- π Documentation: Improve guides and examples
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Make your changes
- Add tests for new functionality
- Commit your changes:
git commit -m 'Add amazing feature'
- Push to the branch:
git push origin feature/amazing-feature
- Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
β If you find this project useful, please consider giving it a star on GitHub!
Built with β€οΈ for the AI community