Este repositorio demuestra cómo construir chatbots con diferentes niveles de capacidades de memoria utilizando langchain, pinecone y simpiltlit. El proyecto muestra la evolución de un chatbot sin estado a uno con almacenamiento de memoria permanente.
Antes de comenzar, asegúrese de tener:
git clone https://github.com/spandan114/building-intelligent-chatbots.git
cd building-intelligent-chatbotsEn Windows:
# Create virtual environment
python -m venv chatbotenv
# Activate virtual environment
chatbotenv S cripts a ctivateEn macOS/Linux:
# Create virtual environment
python -m venv chatbotenv
# Activate virtual environment
source chatbotenv/bin/activatepip install -r requirements.txt Cree un archivo .env en la raíz del proyecto:
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 La aplicación estará disponible en 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
Bot Bot ( bot_without_memory.py ):
streamlit run bot_without_memory.py Bot de memoria temporal ( bot_with_temporary_memory.py ):
streamlit run bot_with_temporary_memory.py Bot de memoria permanente ( 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.txtErrores de clave API :
.env existe y contiene claves API válidasErrores de Pinecone :
Si encontró útil este proyecto, ¡considere darle una estrella! Ayuda a otros a descubrir el proyecto y nos motiva a crear más contenido.
Para preguntas y comentarios, abra un problema en el repositorio de GitHub.
¡Feliz codificación!