AskMeBot

πŸ¦‡ AskMeBot - AI-Powered Chat Assistant

GitHub Pages Python FastAPI License

A modern, AI-powered chat assistant built with FastAPI and Groq’s LLM models. Features a sleek Batman-themed UI, real-time chat functionality, and intelligent conversation management.

✨ Features

πŸ€– AI Chat Capabilities

πŸ’¬ Chat Management

🎨 Modern UI/UX

βš™οΈ Advanced Features

πŸš€ Live Demo

Try AskMeBot now: https://nvdpsingh.github.io/AskMeBot/

πŸ“‹ Prerequisites

πŸ› οΈ Installation

1. Clone the Repository

git clone https://github.com/nvdpsingh/AskMeBot.git
cd AskMeBot

2. Create Virtual Environment

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

4. Environment Setup

Create a .env file in the root directory:

GROQ_API_KEY=your_groq_api_key_here

5. Run the Application

uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

Visit http://localhost:8000 to access the application.

πŸ—οΈ Project Structure

AskMeBot/
β”œβ”€β”€ app/                    # Backend application
β”‚   β”œβ”€β”€ main.py            # FastAPI application and endpoints
β”‚   β”œβ”€β”€ groq_router.py     # LLM integration and routing
β”‚   β”œβ”€β”€ chat_parser.py     # Markdown parsing and response formatting
β”‚   β”œβ”€β”€ context_manager.py # Context management utilities
β”‚   β”œβ”€β”€ doc_parser.py      # Document parsing utilities
β”‚   β”œβ”€β”€ memory_builder.py  # Memory and context building
β”‚   └── utils.py           # General utilities
β”œβ”€β”€ static/                # Frontend assets
β”‚   └── index.html         # Main HTML file with embedded CSS/JS
β”œβ”€β”€ .github/               # GitHub Actions workflows
β”‚   └── workflows/
β”‚       └── deploy.yml     # CI/CD pipeline for GitHub Pages
β”œβ”€β”€ requirements.txt       # Python dependencies
β”œβ”€β”€ pyproject.toml        # Project configuration
β”œβ”€β”€ README.md             # This file
└── .env.example          # Environment variables template

πŸ”§ API Endpoints

Core Endpoints

Request/Response Examples

Chat Request

{
  "prompt": "Hello, how are you?",
  "model": "openai/gpt-oss-20b"
}

Chat Response

{
  "model": "openai/gpt-oss-20b",
  "response": "Hello! I'm doing well, thank you for asking. How can I assist you today?",
  "error": false
}

🎯 Usage Guide

Basic Chat

  1. Open the application in your browser
  2. Type your message in the input field
  3. Press Enter or click Send
  4. View the AI response with markdown formatting

Chat Management

Keyboard Shortcuts

πŸ” Environment Variables

Variable Description Required
GROQ_API_KEY Your Groq API key for LLM access Yes

πŸš€ Deployment

GitHub Pages (Automatic)

The application is automatically deployed to GitHub Pages using GitHub Actions:

  1. Push to main branch triggers the deployment
  2. GitHub Actions builds and deploys the application
  3. Live site available at https://nvdpsingh.github.io/FastAPITut/

Manual Deployment

For other platforms:

# Build the application
pip install -r requirements.txt

# Run with production settings
uvicorn app.main:app --host 0.0.0.0 --port 8000

πŸ§ͺ Testing

Health Check

curl http://localhost:8000/health

Chat API Test

curl -X POST "http://localhost:8000/chat" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Hello, world!", "model": "openai/gpt-oss-20b"}'

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ Development

Adding New Features

  1. Update the backend in app/ directory
  2. Modify the frontend in static/index.html
  3. Test locally with uvicorn app.main:app --reload
  4. Update documentation as needed

Code Style

πŸ› Troubleshooting

Common Issues

API Key Not Working

Chat Not Loading

Styling Issues

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“ž Support


Made with ❀️ and β˜• by Navdeep Singh

🌐 Live Demo β€’ πŸ› Report Bug β€’ πŸ’¬ Request Feature