A web-based AI chatbot application built with Flask and the LangChain framework. This application provides a conversational interface where users can interact with an AI assistant through a clean and responsive web interface.
- Interactive chat interface
- Support for multiple language models
- Customizable chatbot behavior
- API endpoints for integration with other applications
- Session management for multiple users
- Markdown rendering in responses
- Installation
- Configuration
- Usage
- Project Structure
- API Documentation
- Development
- Deployment
- Contributing
- License
- Python 3.8 or higher
- pip (Python package installer)
- API key for your chosen language model (OpenAI, Anthropic, etc.)
-
Clone the repository:
git clone https://github.com/yourusername/flask-langchain-chatbot.git cd flask-langchain-chatbot -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
The application can be configured through the .env file:
# API Keys
LLM_API_KEY=your_api_key_here
LLM_PROVIDER=openai # Options: openai, anthropic, etc.
-
Start the application:
python app.py
Or for development mode:
flask run --debug
-
Start chatting with the AI assistant through the web interface
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit your changes:
git commit -m 'Add some feature' - Push to the branch:
git push origin feature-name - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.