A sleek, conversational AI chatbot powered by Google Gemini 2.5 Flash and built with Streamlit — featuring full multi-turn memory so it actually remembers what you said.
- 💬 Multi-turn conversations — full chat history passed on every request
- ⚡ Gemini 2.5 Flash — fast, capable, and cutting-edge
- 🧠 Session memory — context is preserved across the entire conversation
- 🖥️ Clean Streamlit UI — zero-fuss chat interface, ready out of the box
- 🔐 Secure API key handling — via
.envandpython-dotenv
git clone https://github.com/your-username/gemini-chatbot.git
cd gemini-chatbotpip install streamlit google-genai python-dotenvCreate a .env file in the project root:
GEMINI_API=your_google_gemini_api_key_hereGet your key at Google AI Studio
streamlit run app.pygemini-chatbot/
├── app.py # Streamlit web chatbot (main UI app)
├── main.py # Terminal chatbot (practice CLI version, no Streamlit)
├── .gitignore
└── README.md
Each time the user sends a message, the full conversation history is formatted and passed to the Gemini API — giving the model complete context for a coherent, memory-aware response.
response = client.models.generate_content(
model="gemini-2.5-flash",
contents=[f"{m['role']}: {m['content']}" for m in st.session_state.messages]
)Never commit your .env file. Add it to .gitignore:
.env
| Tool | Purpose |
|---|---|
| Streamlit | UI framework |
| Google Gemini | LLM backend |
| python-dotenv | Env management |
Amitava Biswas
- GitHub: @AmitavaBiswas