AI-Powered Presales Automation System | 10x Sales Efficiency
Why SmartSales โข Features โข Quick Start โข Use Cases โข Documentation
- โ Repetitive Work - Asking the same questions to every customer
- โ Low Efficiency - One sales rep can only handle 3-5 customers per day
- โ Inconsistent Quality - Depends on individual experience
- โ Scattered Knowledge - Product info, pricing, and cases spread everywhere
- โ Slow Response - Customers wait hours for proposals
- โ Intelligent Dialogue - AI guides customers to provide key information
- โ 10x Efficiency - One rep can serve 30+ customers simultaneously
- โ Standardized Output - Template-based consistent quality
- โ Knowledge Base Integration - Auto-retrieve product info, pricing, cases
- โ Instant Response - Generate proposals within 1 minute
Not just a chatbot, but a business-savvy presales consultant
Core Technologies:
- ๐ง Context Understanding - Remembers conversation history
- ๐ฏ Smart Follow-up - Dynamically generates questions based on missing info
- ๐ Slot Management - Auto-identifies and fills business-critical information
- ๐ Intent Recognition - Distinguishes inquiry, confirmation, modification
Ensures every customer receives complete and professional service
Stage 1: Information Collection (info_collection)
โโ Auto-identify customer industry, scale, pain points
โโ Smart follow-up on missing key information
โโ Real-time calculation of information completeness
Stage 2: Information Summarization (info_summarization)
โโ Generate structured requirement summary
โโ Present to customer for confirmation
โโ Support natural language modifications
Stage 3: Proposal Generation (proposal)
โโ Auto-generate proposal based on template
โโ Retrieve relevant info from knowledge base
โโ AI generates personalized recommendations
โโ Output complete presales proposal document
Configure once, benefit forever
# Proposal Template Example
## Customer Information
- Company: {{slot:company_name}}
- Industry: {{slot:industry}}
- Scale: {{slot:company_size}}
## Requirement Analysis
Customer's core pain point: {{slot:pain_point}}
Based on our experience, {{slot:industry}} industry typically needs:
{{ai:Generate targeted analysis based on industry and pain points}}
## Solution
{{rag:Query product database, match most suitable products}}
## Pricing
{{rag:Query pricing table based on customer scale}}
## Success Cases
{{rag:Query success cases in same industry}}
## Implementation Plan
Estimated timeline: {{ai:Estimate based on customer scale and requirement complexity}}Supported Placeholders:
{{slot:xxx}}- Customer information slots{{sys:xxx}}- System information (time, session ID, etc.){{rag:xxx}}- Knowledge base retrieval (products, pricing, cases){{ai:xxx}}- AI-generated content (analysis, recommendations, estimates){{ext:xxx}}- External tool calls (CRM, ERP, etc.)
Make AI your product expert
Based on RAGFlow Retrieval-Augmented Generation:
- ๐ Product Knowledge Base - Auto-retrieve product features, specs, advantages
- ๐ฐ Pricing Database - Auto-match pricing plans based on customer scale
- ๐ Case Library - Retrieve industry success cases for persuasion
- ๐ Policy Library - Auto-reference company policies, service terms
- ๐ FAQ Library - Quick answers to common questions
Smart Retrieval Features:
- โ Semantic understanding (not just keyword matching)
- โ Context-aware (adjusts retrieval strategy based on conversation history)
- โ Deduplication caching (avoids repeated retrieval)
- โ Source attribution (marks information sources in proposals)
Service wherever customers are
- ๐ฌ Instant Messaging - Telegram, Discord, Slack, WhatsApp
- ๐ Web Interface - Embed in website, customer service system
- ๐ฑ Mobile - WeChat Official Account, Mini Program (planned)
- ๐ฅ๏ธ CLI - Command-line interface (internal testing)
- ๐ API - RESTful API (system integration)
Customer: A CRM software company
Pain Point: 50+ daily inquiries, only 3 presales staff, can't keep up
Results:
- โฑ๏ธ Response time reduced from 2 hours to 5 minutes
- ๐ Inquiry conversion rate increased from 15% to 28%
- ๐ฅ Presales team efficiency improved 12x
Customer: An enterprise digital transformation consulting company
Pain Point: Each customer has different needs, proposal writing takes 2-3 days
Results:
- โก Proposal generation time reduced from 3 days to 30 minutes
- ๐ More standardized proposal quality, customer satisfaction up 40%
- ๐ฐ Presales cost reduced 60%
Customer: A cross-border e-commerce platform
Pain Point: Customer inquiries for product recommendations, manual service can't match quickly
Results:
- ๐ฏ Product recommendation accuracy 85%
- ๐ Inquiry conversion rate increased 35%
- ๐ฌ Customer service pressure reduced 70%
- Natural Language Understanding (NLU)
- Context Memory (multi-turn dialogue)
- Intent Recognition (inquiry/confirmation/modification)
- Sentiment Analysis (identify customer emotions)
- Multi-language Support (Chinese/English)
- Three-stage state machine
- Auto slot filling
- Information completeness check
- Natural language confirmation
- Process visualization (planned)
- Service catalog management
- Five-type placeholder system
- Template hot reload
- Multi-service parallel
- Version management (planned)
- RAGFlow deep integration
- Semantic retrieval
- Context-aware
- Source attribution
- Real-time updates
- Dialogue quality assessment
- Slot coverage statistics
- Conversion rate analysis (planned)
- Customer profiling (planned)
- A/B testing (planned)
- Multi-tenant isolation
- Permission management
- Audit logs
- Data encryption
- Private deployment
- Python 3.9+
- LLM API (OpenAI / Claude / Local models)
- RAGFlow (optional, for knowledge base retrieval)
# 1. Clone the repository
git clone https://github.com/AaronWander/HT-SmartSales.git
cd HT-SmartSales
# 2. Install dependencies
pip install -r requirements.txt
# 3. Configure environment variables
cp .env.example .env
# Edit .env and configure your API keys# Create service directory
mkdir -p presales_services/my-service
# Create proposal template
cat > presales_services/my-service/proposal.md << 'EOF'
# {{slot:company_name}} Custom Solution
## Customer Information
- Company: {{slot:company_name}}
- Industry: {{slot:industry}}
- Requirement: {{slot:requirement}}
## Solution
{{rag:Query product solution based on industry}}
## Pricing
{{rag:Query pricing based on scale}}
EOF
# Create slot configuration
cat > presales_services/my-service/slots.yaml << 'EOF'
id: my-service
required_base:
- company_name
- industry
- requirement
meta:
company_name:
label: Company Name
desc: Customer's company name
industry:
label: Industry
desc: Customer's industry sector
requirement:
label: Core Requirement
desc: Customer's main needs or pain points
EOF# Method 1: CLI mode (testing)
python cli.py
# Method 2: Telegram Bot
python gateway/run.py --platform telegram
# Method 3: Web API
python gateway/run.py --platform apiUser: Hello, I'd like to learn about your products
AI: Hello! I'm SmartSales AI assistant. To provide you with the most
suitable solution, may I know your company name first?
User: We are ABC Tech Company
AI: Got it, ABC Tech Company. What industry is your company in?
User: We're in e-commerce
AI: Understood, e-commerce industry. What problems are you facing or
what needs do you have?
User: Our order volume has grown, inventory management is chaotic
AI: Received! Let me summarize the information:
- Company: ABC Tech Company
- Industry: E-commerce
- Requirement: Order volume growth, chaotic inventory management
Is this information correct?
User: Yes
AI: Great, generating your custom proposal...
[Generates complete presales proposal document]
HT-SmartSales/
โโโ agent/ # ๐ง Core business logic
โ โโโ presales_policy.py # Slot policy and config parsing
โ โโโ presales_state_machine.py # Three-stage state machine
โ โโโ presales_answer_gate.py # Answer quality gate
โ โโโ presales_summarizer.py # Information summary generation
โ โโโ presales_proposal.py # Proposal template rendering engine
โ
โโโ presales_services/ # ๐ Service configuration directory
โ โโโ example-service/ # Example service
โ โโโ proposal.md # Proposal template
โ โโโ slots.yaml # Slot configuration
โ
โโโ tools/ # ๐ง Tool integration
โ โโโ ragflow_tool.py # RAGFlow knowledge base tool
โ โโโ ... # Other tools
โ
โโโ gateway/ # ๐ Multi-platform access
โ โโโ run.py # Gateway main program
โ โโโ telegram_gateway.py # Telegram integration
โ โโโ discord_gateway.py # Discord integration
โ โโโ ... # Other platforms
โ
โโโ docs/ # ๐ Documentation
โ โโโ presales-rag/
โ โโโ design-decision-record.md # Design documentation
โ โโโ runtime-config.md # Configuration guide
โ โโโ TEMPLATE_GUIDE.md # Template writing guide
โ
โโโ tests/ # ๐งช Tests
โ โโโ agent/test_presales_*.py # Business logic tests
โ โโโ tools/test_ragflow_tool.py # Tool tests
โ
โโโ LICENSES/ # ๐ Open source declarations
โ โโโ HERMES-MIT.txt # Hermes Agent license
โ โโโ RAGFLOW-APACHE2.txt # RAGFlow license
โ โโโ README.md # License description
โ
โโโ README.md # ๐ This document
# ===== LLM Configuration =====
# Choose one LLM provider
OPENROUTER_API_KEY=sk-or-xxx # OpenRouter (recommended, multi-model)
# or
OPENAI_API_KEY=sk-xxx # OpenAI
# or
ANTHROPIC_API_KEY=sk-ant-xxx # Claude
# ===== RAGFlow Configuration (optional) =====
RAGFLOW_API_KEY=ragflow-xxx
RAGFLOW_BASE_URL=http://localhost:9380
# ===== Messaging Platform Configuration (optional) =====
TELEGRAM_BOT_TOKEN=123456:ABC-xxx
DISCORD_BOT_TOKEN=xxx
SLACK_BOT_TOKEN=xoxb-xxxagent:
# Enable presales features
presales_enabled: true
# State machine configuration
presales_state_machine_enabled: true
presales_answer_gate_enabled: true
# Slot assessment mode
presales_slot_assessment_mode: "llm_structured" # llm_structured | heuristic
# Knowledge base configuration
ragflow_hybrid_mode: "on" # on | off | always
ragflow_single_retrieval_mode: true
ragflow_max_calls_per_turn: 1
# Quality gate
confidence_thresholds:
high_slot_coverage: 0.8
medium_slot_coverage: 0.5- Information collection: < 2 seconds
- Summary generation: < 3 seconds
- Proposal generation: < 30 seconds (including knowledge base retrieval)
- Slot identification accuracy: > 90%
- Intent recognition accuracy: > 85%
- Knowledge retrieval relevance: > 80%
- Single instance supports: 100+ concurrent sessions
- Horizontal scaling: unlimited
# Run all tests
./scripts/run_tests.sh
# Run presales business tests
./scripts/run_tests.sh tests/agent/test_presales_*.py
# Run state machine tests
./scripts/run_tests.sh tests/agent/test_presales_state_machine.py
# Run knowledge base tool tests
./scripts/run_tests.sh tests/tools/test_ragflow_tool.pyTest Coverage:
- State machine: 100%
- Slot management: 95%
- Template rendering: 90%
- Overall: 85%+
This project is built upon the following open source projects:
- License: MIT License
- Repository: https://github.com/NousResearch/hermes-agent
- Usage: AI Agent base framework
- Copyright: Copyright (c) 2025 Nous Research
- License: Apache 2.0 License
- Repository: https://github.com/infiniflow/ragflow
- Usage: RAG retrieval-augmented generation engine
- Copyright: Copyright (c) InfiniFlow, Inc.
Full open source licenses can be found in the LICENSES/ directory.
The business logic code (presales module and related configurations) of SmartSales AI is under proprietary license.
The base framework components follow the original projects' open source licenses (MIT and Apache 2.0).
For commercial use, please contact us for licensing.
- โ Private deployment
- โ Custom development
- โ Technical support (7x24)
- โ Training services
- โ SLA guarantee
- AI presales system setup training
- Template design best practices
- Knowledge base management training
- Industry-specific solutions
- System integration (CRM/ERP)
- Special feature development
-
๐ฎ Email: aaronwander1994@gmail.com
-
๐ฆ X (Twitter): https://x.com/Aaron_Wander
-
๐ Bug Reports: GitHub Issues
-
๐ก Feature Requests: GitHub Discussions
If this project helps you, please give us a โญ๏ธ Star!
SmartSales AI - Smarter Presales ๐ฆฆ
Built with โค๏ธ by AaronWander
