Chat Builder is a private AI chat platform that lets you create lifelike chatbots trained on real chat histories, like WhatsApp or Instagram exports. Upload your chats, name your bot, and talk to an AI version of that person powered by Google Gemini.
Custom login system (Firebase Firestore)
Create custom bots from your chat files (.txt)
FAISS-based memory for realistic context recall
Gemini-powered chat responses (no local LLMs required)
Manage bots: rename, delete, clear chat history
Offline storage for bots and chat history (/bots, /chats)
Download chat history in .txt or .json
| Component | Technology |
|---|---|
| Frontend | Streamlit |
| Vector Memory | FAISS |
| Embeddings | Sentence Transformers (all-MiniLM-L6-v2) |
| LLM | Gemini via google-genai |
| Auth & Data | Firebase Firestore |
| Language | Python 3.10+ |
ChatBuilder/
│
├── app.py # Main Streamlit app
├── firebase_config.py # Firebase setup
├── firebase_db.py # User & bot Firestore logic
│
├── bots/ # Local bot chat files (.txt)
│ └── <user>_chat_<bot>.txt
│
├── chats/ # Local chat history (per user)
│ └── <username>/<bot>.json
│
├── requirements.txt
└── .streamlit/
└── secrets.toml # API keys & Firebase config
git clone https://github.com/justme-vivek/ChatBuilder.git
cd ChatBuilder
pip install -r requirements.txt
Make sure your requirements.txt includes:
streamlit
faiss-cpu
sentence-transformers
numpy
firebase-admin
bcrypt
google-genai
torch
-
Create a Firebase project at Firebase Console .
-
Enable Firestore Database (for user data).
-
Create a Service Account Key (⚙️ → Project Settings → Service Accounts → Generate New Key).
-
Save the JSON key, or better — paste its contents into Streamlit secrets.
Create a .streamlit/secrets.toml file:
GEMINI_API_KEY = "your_gemini_api_key_here"
[firebase_service_account]
type = "service_account"
project_id = "your_project_id"
private_key_id = "your_private_key_id"
private_key = "-----BEGIN PRIVATE KEY-----\nYOURKEY\n-----END PRIVATE KEY-----\n"
client_email = "firebase-adminsdk@your_project_id.iam.gserviceaccount.com"
client_id = "12345678901234567890"
auth_uri = "https://accounts.google.com/o/oauth2/auth"
token_uri = "https://oauth2.googleapis.com/token"
auth_provider_x509_cert_url = "https://www.googleapis.com/oauth2/v1/certs"
client_x509_cert_url = "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk"
streamlit run app.py
Then open http://localhost:8501 in your browser.
-
User Registration / Login Credentials are stored securely (hashed) in Firestore.
-
Bot Creation Upload a .txt chat file. The file is saved locally in /bots/. A bot entry is added to your Firestore profile.
-
Memory Embedding FAISS + Sentence Transformers embed every chat line for semantic search.
-
Chatting When you send a message: FAISS retrieves the top 20 most relevant past messages. Gemini receives the context and generates a realistic reply.
-
Chat History Each user’s conversations are stored in
/chats/<username>/<bot>.json
Each line of your uploaded .txt file should look like this:
You: hey what’s up?
John: nothing much bro
You: let’s meet tomorrow
John: sure, same place?
Avoid timestamps or system messages for best results.
Optional Firebase Storage for cloud chat files
Multi-device sync for chat history
Fine-tuning mode for stronger personality capture
Real-time streaming responses from Gemini
MIT — Free to use and modify.
I'm actively building AI, automation & networking tools.
Reach out if you’d like to collaborate or contribute.
Open an issue or start a discussion — PRs welcome ⚡