An advanced, ultra-fast AI Agent Chatbot built with Python (Streamlit) and client-side JavaScript (HTML/CSS), running on Groq's LPU inference engine.
This is a true agentic application that features autonomous tool-calling (function calling) in both the Python server-side application and the browser client-side application. The agent can dynamically decide to query Wikipedia, execute math expressions, check system local time, or scrape webpage links to retrieve answer context.
Try the static web version of the chatbot directly in your browser — zero installation and serverless:
👉 https://rahman-pro.github.io/ai-chatbot-python/
🔒 Your API key stays in your browser's local storage and is sent directly to Groq. It never touches any third-party servers.
When a user asks a query, the AI does not just predict text; it is equipped with tools that it calls autonomously:
- Wikipedia Lookup (
search_wikipedia): Queries the Wikipedia REST API (fully supported client-side with CORS) to extract introductory summaries on people, science, history, and concepts. - Safe Math Calculator (
calculate): Safely computes basic mathematical equations using arithmetic operations, avoiding LLM math errors. - Web Scraping (
fetch_webpage- Python): Fetches the DOM and parses plain-text content of external webpages to gather real-time context. - Local Time Clock (
get_current_time): Returns the user's local date and time.
- Collapsible Thought Process Logs: Visual logs showing the agent's thought process, what tools it is executing, what arguments it is passing, and the raw tool output.
- Dual Mode Implementation: Includes both a Streamlit Python console and a static HTML/JS web interface.
- Multi-Model Select: Supports top-tier models like Llama 3.3 70B, Llama 3.1 8B, Gemma 2, and Mixtral.
- Interactive Tabs (Streamlit Tutor Console):
💬 AI Agent Chat— The core tool-calling conversation assistant.✏️ English Tutor / Grammar Checker— Analyzes grammar mistakes and provides detailed feedback.📖 Dictionary— Detailed vocabulary definition details, example sentences, and synonyms.🌐 Context Translator— Context-aware translation that explains structural sentence rules.
git clone https://github.com/rahman-pro/ai-chatbot-python.git
cd ai-chatbot-pythonMake sure you install the updated dependencies which include the groq SDK and beautifulsoup4 for web scraping:
pip install -r requirements.txt- Go to console.groq.com
- Sign up/Login (free, no credit card needed)
- Create an API Key
streamlit run app.pyThe console will open at http://localhost:8501 🎉
Simply open index.html directly in your browser or run a simple local web server:
# Python 3
python -m http.server 8000Then visit http://localhost:8000 in your web browser.
- Push this repository to your GitHub account.
- Visit share.streamlit.io.
- Connect your GitHub repository.
- Select
app.pyas the main path and click Deploy. ✅
ai-chatbot-python/
├── index.html # Static web client template
├── style.css # Custom CSS for theme & Agent Thought indicators
├── app.js # Web interface agent & tool calling logic
├── app.py # Streamlit application (Tutor tabs & Agent loop)
├── requirements.txt # Python dependencies (Streamlit, Groq, BeautifulSoup)
└── README.md # Documentation
| Technology | Purpose |
|---|---|
| Python 3.9+ | Core server-side language |
| Streamlit | Dashboard and chat UI layout |
| Groq SDK | Quick LLM inference and function-calling orchestration |
| BeautifulSoup4 | Web scraping tool parser |
| HTML/CSS/JS | Client-side static agent runner |
Built with ❤️ by Atiqur Rahman
⭐ Star this repo if you find it useful!