AutoPharma AI is an intelligent drug research assistant powered by Google Gemini 2.0 and DuckDuckGo Search. It automates the process of gathering medical information, providing structured, professional summaries for researchers and healthcare professionals.
🚀 Live Demo: Check out the App
- 🔍 Real-time Web Search: Fetches the latest drug information, side effects, and news using DuckDuckGo.
- 🧠 AI Powered Summaries: Uses Gemini 2.0 Flash to synthesize disparate search results into a clean, readable report.
- 📝 Research History: Automatically tracks your search queries in the sidebar for easy reference.
- ⚙️ Model Selection: Switch between different Gemini models (e.g.,
gemini-2.0-flash-exp,gemini-2.0-flash) directly from the UI. - 🔒 Secure: API keys are handled securely via Streamlit secrets.
AutoPharma doesn't just search the web; it uses an autonomous reasoning loop to determine which clinical data points are missing, executes targeted searches via DuckDuckGo, and synthesizes the findings into a medical-grade report using Gemini 2.0 Flash.

- Python 3.8+
- A Google Gemini API Key (Get one here)
-
Clone the repository (if applicable) or download the source code.
-
Create a virtual environment:
python -m venv venv # Windows .\venv\Scripts\activate # Mac/Linux source venv/bin/activate
-
Install dependencies:
pip install -r requirements.txt
-
Configure API Key: Create a file named
.streamlit/secrets.tomlin the project root:# .streamlit/secrets.toml GOOGLE_API_KEY = "YOUR_API_KEY_HERE"
streamlit run app.pyThe application will launch in your default web browser at http://localhost:8501.
- Enter Drug Name: Type the name of a drug (e.g., Metformin, Atorvastatin) in the main input field.
- Select Model: (Optional) Choose a specific Gemini model from the sidebar.
- Start Research: Click the "Start Research" button.
- Review Report: Read the generated summary covering overview, mechanism of action, side effects, and recent news.
- Check History: Previous searches are saved in the sidebar for quick access.
- Frontend: Streamlit
- LLM: Google Gemini API (
google-generativeai) - Search: DuckDuckGo Search (
duckduckgo-search)
This project is open-source and available under the MIT License.