A simple, working AI-powered customer support chatbot built with Python, the Anthropic SDK, and Streamlit. Clone it, add your API key, and have it running in under 20 minutes.
Blog Post: Build an AI Customer Support Chatbot in 20 Minutes
- Answers customer questions based on your business knowledge base
- Maintains conversation history for multi-turn support conversations
- Knows when to say "I don't know" and routes to human support
- Uses Claude Sonnet 4.6 via the Anthropic API
- Python 3.10 or higher
- An Anthropic API key (get one here)
-
Clone the repo
git clone https://github.com/ashkankardan/ai-support-chatbot.git cd ai-support-chatbot -
Create a virtual environment (recommended)
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies
pip install -r requirements.txt
-
Add your API key
cp .env.example .env
Open
.envand replaceyour-api-key-herewith your actual Anthropic API key. -
Run the app
streamlit run app.py
The app will open in your browser at http://localhost:8501.
The chatbot's knowledge comes from knowledge_base.md. To make it your own:
- Open
knowledge_base.md - Replace the sample content with your business info (products, policies, FAQs, etc.)
- Restart the app
That's it. The chatbot will now answer questions based on your content.
The architecture is intentionally simple:
- Your business knowledge is loaded from a Markdown file
- It is injected into Claude's system prompt as context
- Claude answers questions grounded in that context only
- If the answer is not in the knowledge base, Claude says so and suggests contacting support
No vector database, no embeddings, no RAG pipeline. Just a knowledge file, a system prompt, and an API call. For most small-to-medium businesses with a manageable knowledge base (under roughly 50 pages), this approach works surprisingly well.
Claude Sonnet 4.6 costs $3 per million input tokens and $15 per million output tokens. A typical support conversation costs about $0.002-0.005. At 1,000 conversations per month, that is roughly $2-5 per month in API costs.
ai-support-chatbot/
├── app.py # Streamlit chat application
├── knowledge_base.md # Your business knowledge (edit this!)
├── requirements.txt # Python dependencies
├── .env.example # API key template
├── .gitignore
└── README.md
- Anthropic Python SDK - Claude API client
- Streamlit - Chat UI framework
- Claude Sonnet 4.6 - AI model
MIT
Built by Ashkan Kardan - AI Software Engineer