AI/ML · Production engineering
How to Build a Production AI Sales Agent System (Step-by-Step)
·~12 min read
A single generic chatbot is not a sales system. Production needs routing, memory, cost control, and a path from conversation to qualified lead.
1. Start from the business outcome
Define what “success” is before prompts: faster first response, higher qualified lead rate, lower cost per conversation, or fewer missed handoffs to humans. Those metrics decide architecture.
2. Use multiple specialized agents
Split responsibilities: greeting, discovery, expertise, objections, pricing, portfolio proof, closing, and safety/guardrails. Specialized flows are easier to test, tune, and observe than one mega-prompt.
3. Add RAG for grounded answers
Give the system a retrieval layer (e.g. vector DB) over FAQs, services, and real project write-ups so answers cite internal truth instead of inventing specs. Chunking, metadata, and refresh strategy matter as much as the embedding model.
4. Route models by difficulty (cost control)
Use cheap models and deterministic rules for the bulk of turns; escalate to stronger models only when intent or revenue risk warrants it. Summarize long threads before expensive calls. This is how you get large savings without trashing quality.
5. Classify intent and score leads
Map utterances to intents and conversation phase (discovery → evaluation → conversion). Combine rules + LLM where needed. Emit structured lead records (e.g. HOT/WARM/COLD) and notify humans over email or CRM webhooks.
6. Ship operator tools
Production means prompts change, knowledge updates, and cost monitoring. Plan for an internal dashboard or at least versioned prompts, basic analytics, and replay of conversations for QA.
7. Deploy like any critical service
Health checks, structured logging, rate limits, secrets management, and staged rollouts. Treat the agent API as part of your product surface — not a side script.
See the real build
This guide mirrors how I shipped an 8-agent LangGraph system with RAG, tiered Claude routing, and production dashboards — full challenge, solution, and results on the case study page.
Ramy — AI agent system (case study) →