LangGraph AI Chatbot is a powerful chatbot application built using FastAPI, LangGraph, and LangChain. It leverages large language models (LLMs) like Llama3 and Mixtral, integrated with the Tavily search tool, to provide intelligent responses. The frontend is designed with Streamlit for an interactive and sleek user experience.
- FastAPI Backend: Efficient API for handling chat requests.
- LangGraph & LangChain: Enables intelligent conversation processing.
- Multiple LLM Models: Supports
llama3-70b-8192andmixtral-8x7b-32768. - Tavily Search Integration: Fetches relevant search results.
- Streamlit UI: Interactive, customizable, and responsive frontend.
- Docker Support: Easily deploy the application with Docker.
- Custom Themes: Light & Dark mode for enhanced user experience.
https://github.com/ToufiqQureshi/ai-agent-with-langraph.gitpython -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
pip install -r requirements.txtCreate a .env file and add your API keys:
GROQ_API_KEY=your_groq_api_key
TAVILY_API_KEY=your_tavily_api_key
Alternatively, set them in your terminal:
export GROQ_API_KEY=your_groq_api_key
export TAVILY_API_KEY=your_tavily_api_keyuvicorn main:app --host 0.0.0.0 --port 8000 --reloadstreamlit run ui.pydocker build -t langgraph-chatbot .docker run -p 8000:8000 -p 8501:8501 langgraph-chatbotURL: http://127.0.0.1:8000/chat
Request Body:
{
"system_prompt": "Define your AI agent",
"model_name": "llama3-70b-8192",
"messages": ["Hello, how can you help me?"]
}Response:
{
"messages": [
{ "type": "ai", "content": "Hello! How can I assist you today?" }
]
}- Send Messages: Chat with AI.
- Select Model: Choose from
llama3-70b-8192ormixtral-8x7b-32768. - Define AI Behavior: Custom system prompts.
- Dark & Light Themes: Switch between modes for a better experience.
langgraph-chatbot/
│── main.py # FastAPI backend
│── ui.py # Streamlit frontend
│── requirements.txt # Dependencies
│── Dockerfile # Docker setup
│── .env # Environment variables (ignored in Git)
This project is licensed under the MIT License.
For support or inquiries, contact: toufiqqureshi651@gmail.com
Enjoy using LangGraph AI Chatbot! 🎉