A simple yet powerful knowledge-based chatbot for small business websites. This solution allows you to quickly set up automated customer support using your business information stored in simple text files. Powered by Gemma 2 9B LLM through Ollama, it provides natural and accurate responses to customer queries without requiring constant human supervision.
- Easy Setup: Just add your business information in simple text files
- No Programming Required: Basic installation and text file editing is all you need
- Cost-Effective: Run without expensive API costs or monthly fees
- 24/7 Customer Support: Automate responses to common customer questions
- Time-Saving: Reduce time spent on repetitive customer inquiries
Copy the chatbot
folder to your website root:
chatbot/
βββ chatbot.py
βββ server.py
βββ knowledge_loader.py
βββ install_ollama.sh
βββ knowledge/
β βββ about.txt
β βββ delivery.txt
β βββ contacts.txt
βββ templates/
# Make script executable
chmod +x install_ollama.sh
# Run installation
./install_ollama.sh
pip3 install fastapi uvicorn chromadb sentence-transformers pydantic jinja2
Edit the knowledge/company.txt
file:
# About Company
[Your company description]
# Working Hours
[Business hours]
# Services
[Your services]
# Contacts
[Contact information]
# Run in background
python3 server.py &
Insert before </body>
:
<script>
(function() {
var script = document.createElement('script');
script.src = '/chatbot/static/chat-widget.js';
script.async = true;
document.head.appendChild(script);
script.onload = function() {
ChatWidget.init({
botName: 'Assistant',
apiUrl: '/chatbot/chat'
});
};
})();
</script>
Customize appearance:
ChatWidget.init({
botName: 'Your title',
position: 'right', // right or left
width: '350px', // window width
height: '500px' // window height
});
- Python 3.8+
- 2 GB free memory
- Python support on hosting
Email: [email protected]