This repository demonstrates how to build chatbots with different levels of memory capabilities using LangChain, Pinecone, and Streamlit. The project shows the evolution from a stateless chatbot to one with permanent memory storage.
Before you begin, ensure you have:
git clone https://github.com/spandan114/building-intelligent-chatbots.git
cd building-intelligent-chatbotsOn Windows:
# Create virtual environment
python -m venv chatbotenv
# Activate virtual environment
chatbotenvScriptsactivateOn macOS/Linux:
# Create virtual environment
python -m venv chatbotenv
# Activate virtual environment
source chatbotenv/bin/activatepip install -r requirements.txtCreate a .env file in the project root:
PINECONE_API_KEY=your_pinecone_api_key_here
OPENAI_API_KEY=your_openai_api_key_here
GROQ_API_KEY=your_groq_api_key_herestreamlit run app.pyThe application will be available at http://localhost:8501
deactivatebuilding-intelligent-chatbots/
├── bot_with_pinecone_memory.py # Main application with Pinecone
├── bot_without_memory.py # Basic bot implementation
├── bot_with_temporary_memory.py # Bot with session state memory
├── requirements.txt # Project dependencies
├── .env # Environment variables (create this)
└── README.md # This file
Basic Bot (bot_without_memory.py):
streamlit run bot_without_memory.pyTemporary Memory Bot (bot_with_temporary_memory.py):
streamlit run bot_with_temporary_memory.pyPermanent Memory Bot (bot_with_pinecone_memory.py):
streamlit run bot_with_pinecone_memory.pylangchain
langchain-groq
langchain-pinecone
langchain-huggingface
langchain-postgres
langchain-community
langchain-core
streamlit
python-dotenv
pinecone-client
psycopg2-binary
sentence-transformers
openai
tiktoken
ModuleNotFoundError:
pip install -r requirements.txtAPI Key Errors:
.env file exists and contains valid API keysPinecone Errors:
If you found this project helpful, please consider giving it a star! It helps others discover the project and motivates us to create more content.
For questions and feedback, please open an issue in the GitHub repository.
Happy coding!