Este repositório demonstra como criar chatbots com diferentes níveis de recursos de memória usando Langchain, Pinecone e Streamlit. O projeto mostra a evolução de um chatbot sem estado para um com armazenamento permanente de memória.
Antes de começar, certifique -se de ter:
git clone https://github.com/spandan114/building-intelligent-chatbots.git
cd building-intelligent-chatbotsNo Windows:
# Create virtual environment
python -m venv chatbotenv
# Activate virtual environment
chatbotenv S cripts a ctivateNo macOS/Linux:
# Create virtual environment
python -m venv chatbotenv
# Activate virtual environment
source chatbotenv/bin/activatepip install -r requirements.txt Crie um arquivo .env na raiz do projeto:
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 O aplicativo estará disponível em 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 básico ( bot_without_memory.py ):
streamlit run bot_without_memory.py Bot de memória temporária ( bot_with_temporary_memory.py ):
streamlit run bot_with_temporary_memory.py Bot de memória 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.txtErros de chave da API :
.env existe e contém chaves de API válidasErros de Pinecone :
Se você achou este projeto útil, considere dar -lhe uma estrela! Ajuda os outros a descobrir o projeto e nos motiva a criar mais conteúdo.
Para perguntas e feedback, abra um problema no repositório do GitHub.
Codificação feliz!