A chatbot made using mainly Streamlit and Langchain.
This repository contains a conversational chatbot built using the LangChain framework, designed to handle a variety of natural language processing (NLP) tasks efficiently.
- Conversational AI: The chatbot leverages LangChain to handle dynamic, multi-turn conversations with a memory-augmented model.
- Customizable Chain: Easily modify or extend the chain logic to integrate different models, databases, or workflows.
- Pre-built Language Models: Supports various language models like OpenAI GPT, allowing for high-quality text generation.
- Retrieval-Augmented Generation (RAG): The chatbot can perform RAG-style interactions, pulling information from external knowledge sources (e.g., Pinecone, Elasticsearch).
- OpenAI Integration: Seamlessly integrates with OpenAI's language models for flexible and intelligent responses.
- Tool Support: Can utilize external APIs or tools (like search engines or knowledge bases) to enhance conversation.
- LangChain: Core library that enables chain-based workflows for NLP applications.
- OpenAI GPT API: For advanced language understanding and generation.
- Pinecone/FAISS/Elasticsearch (Optional): Retrieval-based augmentation for improved response relevance.
- Python: Core programming language used for chatbot logic.
- Streamlit : For deploying a user-friendly interface for the chatbot.
-
Clone the repository:
git clone https://github.com/snehaapratap/AI-based-Chatbot-using-Langchain.git cd langchain-chatbot
-
Install required dependencies:
pip install -r requirements.txt
-
Set up environment variables for API keys (e.g., OpenAI API, Pinecone):
export OPENAI_API_KEY=your-openai-api-key
-
Run the chatbot:
streamlit run main.py
You can modify the chatbot's behavior by editing the chain logic within the chatbot.py
file. Some areas for customization include:
- Changing the language model.
- Modifying how the chatbot handles memory or retrieval.
- Adding new tools or APIs to expand capabilities.
Once the chatbot is up and running, you can interact with it via the terminal or through a web interface (if integrated with Streamlit). The chatbot is designed to:
- Hold meaningful, multi-turn conversations.
- Fetch relevant information when prompted.
- Assist with tasks such as question answering, summarization, and more.
- Improved Memory Handling: Implementing long-term memory to track context over extended sessions.
- Fine-Tuning: Training on custom datasets to improve domain-specific performance.
- Expanded Tool Integration: Adding more external APIs for enhanced conversational capabilities.
Feel free to open issues or pull requests if you'd like to contribute to improving the chatbot!!