This project is a conversational AI chatbot application built with Streamlit for the frontend, LangChain for AI capabilities, Firebase for user data storage, and Pinecone for vector-based long-term memory. The chatbot maintains conversation history and can recall relevant facts from previous interactions to provide context-aware responses.
- Interactive Chat Interface: User-friendly web interface built with Streamlit.
- GPT-4o-mini Integration.
- Dynamic LLM Tuning: Users can customize LLM parameters in real-time for personalized responses.
- Conversation Memory: Stores and retrieves past conversations for each user using Firebase.
- Long-term Context:
- Fact Extraction: LLM extracts user key facts from a conversation.
- Pinecone Vector Store: Maintains relevant facts about the user in vector store for tailored responses.
- Authentication
- Secure Login: Email/password via Firebase REST API
- User Management:
- Backend: Firebase Admin SDK (create/update users)
- Metadata: Firestore stores last_login, preferences, and LLM settings
- Frontend: Streamlit
- AI Framework: LangChain
- AI model: gpt-4o-mini
- Database:
- Firebase Firestore (user data and conversations)
- Firebase (vector store for long-term memory)
- Authentication: Firebase Authentication
To run the app locally, follow these steps:
-
Clone the repository:
git clone git@github.com:TuringCollegeSubmissions/azhurb-AE.2.5.git cd cd azhurb-AE.2.5/
-
Install Poetry (if you don't have it installed yet):
curl -sSL https://install.python-poetry.org | python3 - -
Install the required dependencies:
poetry install
-
Activate the virtual environment:
poetry env activate
-
Set up Firebase:
- Create a Firebase project at Firebase Console
- Download your service account JSON file, paste its contents as FIREBASE_CREDENTIALS into .streamlit/secrets.toml file
- Enable Firestore Database and Authentication in your Firebase console
-
Set up environment variables
OPENAI_API_KEY=your-api-key FIREBASE_PROJECT_ID=your_firebase_project_id PINECONE_API_KEY=your_api-key
-
Run the Streamlit app:
streamlit run app.py
