Этот репозиторий демонстрирует, как создавать чат -ботов с различными уровнями возможностей памяти, используя Langchain, Pinecone и Streamlit. Проект показывает эволюцию от нерянного чат -бота до одного с постоянным хранилищем памяти.
Прежде чем начать, убедитесь, что у вас есть:
git clone https://github.com/spandan114/building-intelligent-chatbots.git
cd building-intelligent-chatbotsВ окнах:
# Create virtual environment
python -m venv chatbotenv
# Activate virtual environment
chatbotenv S cripts a ctivateНа MacOS/Linux:
# Create virtual environment
python -m venv chatbotenv
# Activate virtual environment
source chatbotenv/bin/activatepip install -r requirements.txt Создайте файл .env в корне проекта:
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.py Приложение будет доступно по адресу http://localhost:8501
deactivate building-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.py Временная память ( bot_with_temporary_memory.py ):
streamlit run bot_with_temporary_memory.py Постоянная память ( bot_with_pinecone_memory.py ):
streamlit run bot_with_pinecone_memory.py langchain
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.txtОшибки ключей API :
.env и содержит действительные клавиши APIОшибки Pinecone :
Если вы нашли этот проект полезным, пожалуйста, подумайте о том, чтобы дать ему звезду! Это помогает другим открыть проект и мотивирует нас создавать больше контента.
Для вопросов и обратной связи, пожалуйста, откройте проблему в репозитории GitHub.
Счастливого кодирования!