This guide will walk you through how to use your new AI Chat application. It's designed to be easy to use, helping you chat with an intelligent AI, organize your conversations, and even get summaries or question suggestions!
1. Getting Started: Setting Up Your User ID
When you first open the app, you'll see a pop-up window called the Welcome Modal. This is where you set up your identity for the chat.
- Choose Your User ID: Think of this as your nickname or a label for your chats. For example, you could use "Alice", "My_Work_ID", or "Family_Chatter". This ID helps the app keep your conversations organized on your device.
- Why a User ID? It's not a secure login like an email and password (we'll get to that later!), but it's super helpful for finding your old chats if you share the app with others on the same computer, or if you come back to it later.
- Guest Mode (Optional): If you prefer not to enter a specific ID, don't worry! The app can automatically create a temporary "Guest ID" for you. Your chats will still be saved, but they'll be associated with that random guest name.
- Start Chatting! Once you've entered your preferred User ID (or decided to go with a Guest ID), click the "Start Chatting" button.
- Your ID Display: After setting your ID, you'll see it displayed at the bottom of the left sidebar. It will show a short version of your "Firebase UID" (a technical ID the app uses) and your chosen "Your ID" (your display name). This helps you confirm who is logged in.
2. Basic Chatting: Talking to the AI
Now that you're set up, let's start a conversation!
- Look for the text box at the very bottom of the main chat area. This is your input field.
- Type whatever you want to ask or tell the AI.
- Once you're done typing, simply press the Enter key on your keyboard or click the "Send" button next to the input box.

- Understanding AI Responses:
- The AI will process your message and send back a response.
- Formatted for Readability: Unlike a simple text blob, the AI's responses are designed to be easy to read. They use Markdown, which means you'll see:

- Headings (like this one!) for main topics.
- Paragraphs for clear blocks of text.
- Bold text (**like this**) for important words.
- Italic text (*like this*) for emphasis.
- Lists (like bullet points or numbered lists) are for organized information.
- Code blocks for technical examples or snippets.
- "AI is thinking..." Indicator: When the AI generates its response, you'll see a small "AI is thinking..." message with a spinning icon. This lets you know the app is working and to expect a reply soon.
3. Organizing Your Conversations: Chat Sessions
Your chat application helps you keep your conversations organized into separate sessions.
3.1. Your Chat History (Sidebar)
You'll find the Chat History sidebar on the left side of your screen. This is where all your past conversations are listed.
- Viewing Past Chats: To revisit an old conversation, simply click on its title in the sidebar. The entire chat will load into the main area, just as you left it.
- Active Chat Highlight: The chat you are currently viewing or interacting with will be highlighted, making it easy to see which conversation you're in.
- Automatic Chat Titles: When you start a brand new chat, the AI will automatically create a short, descriptive title for it based on your very first message. This helps you quickly identify your conversations later.
3.2. Starting a Brand New Chat
- "New Chat" Button: At the top of the sidebar, click the "New Chat" button. This will clear the current conversation in the main area and prepare a fresh canvas for a new discussion. A new entry will appear in your chat history, initially titled "New Chat," which will update once you send your first message.

3.3. Deleting Individual Chats (BETA)
Sometimes you might want to remove a conversation. You can now delete individual chat sessions.
- Trash Can Icon: Next to each chat title in the sidebar, you'll see a small trash can icon.
- How to Delete: Click this trash can icon.
- Confirmation: A pop-up will appear, asking you to confirm if you want to delete that specific chat. This is a safety measure because deleting a chat is permanent and cannot be undone.
- Final Step: Click "Confirm" in the pop-up to permanently remove all messages and the chat instance from your history. If the chat you deleted was the one you were currently viewing, the app will automatically switch to your most recent remaining chat or start a new one if no others exist.
4. Account Management: The Settings Menu
The "Settings" button, located at the bottom of the sidebar, opens a modal window with options for managing your account and data.
- Accessing Settings: Click the "Settings" button to open the modal.
- Closing Settings: Click the 'X' button in the top right corner or click anywhere outside the modal to close it.
4.1. Create a Password for Your Account
This is an important feature if you want to keep your chats safe and access them from different devices, even if you clear your browser's data.
- Purpose: It links your current anonymous chat session to a real email address and a password you choose.
- How to Use:
- Click the "Create Password" button in the Settings menu.
- Enter your email address.
- Choose a new password (it must be at least 6 characters long for security).
- Click the "Create Password" button in this new model.
- If the email you entered is already being used for another account, the app will let you know.
- Once created, your chats will be securely tied to this email and password.
4.2. Log Out
- Purpose: To sign out of your current session. This is useful if you're using a shared computer or want to start fresh with a different User ID.
- How to Use: Click the "Log Out" button in the Settings menu.
- Effect: Your local User ID will be cleared, and the application will reload, bringing you back to the Welcome Modal to enter a new User ID or log in with an existing password.
4.3. Delete All My Chats & Account
🚨 WARNING: This is a permanent and irreversible action! 🚨
- What it Does: Clicking this button will completely wipe out all your chat history, all messages within those chats, your user profile data stored in the app's database (Firebase), and even your Firebase user account itself.

- Extreme Caution: Only use this if you are sure you want to delete everything associated with your account on this app.
- Confirmation: To prevent accidental deletion, a very strong confirmation message will appear. You must click "Confirm" to proceed with the deletion.
- After Deletion: The application will reload, and you will effectively start as a brand-new user, with no previous chat history.
4.4. View SafeLibrary AI Docs
- Purpose: This button provides a direct link to external documentation related to SafeLibrary AI, which might offer more technical details or broader context about the AI models used.
- How to Use: Click the "View SafeLibrary AI Docs" button. It will open the documentation in a new browser tab.
4.5. More Options (Coming Soon)
This section is a placeholder for future enhancements. Keep an eye out for new features and settings in upcoming updates!
5. Smart AI Features: Leveraging LLMs
Located just above your message input field, you'll find two special buttons that use advanced AI (Large Language Models, or LLMs) to help you with your conversations.
5.1. Summarize Chat ✨
- Purpose: Ever had a long chat and wanted a quick recap? This feature does exactly that! It generates a concise summary of your entire current conversation.
- How to Use: Simply click the "Summarize Chat ✨" button.
- Output: The AI will process your chat and then add its summary as a new message directly into your current conversation. The summary will also be formatted using Markdown for easy reading.
5.2. Suggest Questions ✨
- Purpose: Sometimes you hit a conversational wall, or you're not sure what to ask next. This feature helps by suggesting relevant follow-up questions based on what you've just discussed.
- How to Use: Click the "Suggest Questions ✨" button.
- Output: The AI will analyze the recent messages in your chat and then provide 3-5 potential questions as a new message in your current conversation, presented as a clear Markdown list.
Important Technical Notes (For Developers/Curious Users)
- Firebase Integration: This application uses Google's Firebase platform for user authentication (anonymous sign-in, email/password linking) and for storing your chat data (Firestore database).
- Gemini API Key Security: Your GEMINI_API_KEY is currently included directly in the app's code. For any real-world, public-facing application, this is NOT a secure practice. It's highly recommended to use a secure backend (like Firebase Cloud Functions or Google Cloud Run) to make calls to the Gemini API. This prevents your API key from being exposed to malicious users.
- Firestore Security Rules: The app's ability to save and retrieve your chats depends heavily on the "Firestore Security Rules" configured in your Firebase project. If you encounter "permission-denied" errors, it usually means these rules need adjustment to allow your app to read and write data correctly.
- Responsive Design: The application is built to look good and function well on various screen sizes, from mobile phones to large desktop monitors.
6. Credits & Links
Credits to:
Alex Manochio, Google Firebase, HouseLearning
Links:
HouseLearning https://houselearning.github.io/
HouseLearning SafeLibrary https://houselearning.github.io/safe-library/
Safe-AI https://houselearning.github.io/safe-library/programs/assets/safe-ai.html
Google Docs Documentation Page
https://bit.ly/safe-ai-docs
SafeAI HouseLearning Documentation
https://houselearning.github.io/safe-library/programs/assets/safe-ai-docs
Thank you for using your Firebase AI Chat application! We hope you find it helpful and enjoyable.
With