PECIM's Chatbot is an interactive application developed to assist graduate students from the Science and Mathematics Education Program (PECIM) at UNICAMP with questions about the course. The system uses generative artificial intelligence (Google Gemini) to answer questions based on information contained on the program's official website.
- Intuitive chat interface built with Streamlit
- Processing and analysis of program PDF documents
- Semantic search to find relevant information
- Detailed answers to student questions
- Multilingual support (Portuguese and English)
- Cache system for frequent answers
- Python 3.7+
- Streamlit for web interface
- Google Generative AI (Gemini 1.5 Flash)
- LangChain for document processing and RAG chain creation
- FAISS for vector storage and search
- PDFPlumber for PDF text extraction
python>=3.7
streamlit
pdfplumber
langchain
langchain-google-genai
faiss-cpu
python-dotenv
google-generativeai
- Clone the repository:
git clone https://github.com/your-username/pecim-chatbot.git
cd pecim-chatbot- Install dependencies:
pip install -r requirements.txt- Configure the
.envfile with your Google API key:
GOOGLE_API_KEY=your_api_key_here
- Add the PECIM PDF file to the project root (default: "database-site-pecim.pdf").
Run the Streamlit application:
streamlit run app.pyThe application will open in your default browser, usually at http://localhost:8501
- When starting the application for the first time, it will process the PDF and create the search index
- Type your questions about PECIM in the text input box at the bottom
- The chatbot will provide answers based on the PDF content
- You can switch between Portuguese and English using the selector in the sidebar
- Use the "Clear conversation history" button to start a new session
- Answers are based only on the provided documents and may not include more recent information not present in the PDF
- Like any AI system, it may generate inaccurate or incomplete answers
- The system does not answer questions unrelated to PECIM
app.py: Main file containing the application codedatabase-site-pecim.pdf: Base document with PECIM informationfaiss_index/: Directory automatically created to store the vector indexresponse_cache.json: Response cache to improve performance
Contributions are welcome! If you find bugs or have suggestions for improvements, please:
- Open an issue describing the problem or suggestion
- Submit a pull request with your changes
For questions and suggestions: r147725@dac.unicamp.br
This is an unofficial application developed by a PECIM student for testing purposes. The information provided by the chatbot may contain inaccuracies and should not replace consulting the program's official sources.