Skip to content

Dark1920/Pharma-AI

Repository files navigation

Pharma-AI - Biomedical Pharmacognosy Agent

An AI-powered biomedical agent specialized in pharmacognosy.


What is Pharma-AI?

Pharma-AI is an intelligent biomedical assistant that helps researchers, pharmacists, and healthcare professionals explore medicinal plants, their active compounds, and potential drug interactions. It combines retrieval-augmented generation (RAG) with a specialized LLM to provide evidence-based answers grounded in scientific literature.

Core use case: type the name of a medicinal plant and get active compounds, mechanisms of action, scientific references, and drug interaction warnings.



Features

  • AI Agent (RAG + Llama 3) for biomedical Q&A
  • Drug Interaction Checker (plant-drug and plant-plant)
  • Scientific grounding with PubChem and PubMed/NCBI data
  • Streamlit web interface for practical exploration

Project Structure

Pharma-AI/
|-- pubchem_data.py        # Fetches active compounds from PubChem API
|-- pubmed_data.py         # Fetches scientific articles from PubMed/NCBI
|-- rag_knowledge.py       # Builds the FAISS vector knowledge base
|-- interactions_db.py     # Database of known plant-drug interactions
|-- interactions.py        # Interaction detection engine
|-- agent.py               # RAG agent via Groq API
|-- app.py                 # Streamlit web interface
|-- .env                   # API keys (never commit)
|-- .gitignore
`-- requirements.txt

Quick Start

1. Clone the repository

git clone https://github.com/your-username/Pharma-AI.git
cd Pharma-AI

2. Create virtual environment

python -m venv .venv

# Windows
.venv\Scripts\activate

# Mac / Linux
source .venv/bin/activate

3. Install dependencies

pip install -r requirements.txt

4. Configure environment variables

Create a .env file at the project root:

GROQ_API_KEY=your_groq_api_key_here
ADMIN_EMAIL=your_admin_email
ADMIN_PASSWORD=your_admin_password
SESSION_SECRET=a_long_random_secret

Get a free Groq API key at console.groq.com.

5. Build the knowledge base

python pubchem_data.py
python pubmed_data.py
python rag_knowledge.py

6. Launch the app

streamlit run app.py

Open http://localhost:8501 in your browser.


Requirements

  • langchain
  • langchain-community
  • langchain-groq
  • langchain-huggingface
  • langchain-text-splitters
  • faiss-cpu
  • sentence-transformers
  • streamlit
  • requests
  • pandas
  • biopython
  • python-dotenv
  • groq

Data Sources


Security

  • Never commit your .env file.
  • If a key is exposed, revoke it immediately.
  • Use Streamlit Secrets for production deployments.

License

MIT License.

About

Pharma AI is a biomedical AI agent specializing in pharmacognosy , identifies active compounds in medicinal plants, predicts drug-plant interactions, and generates sourced responses via RAG. Built with LangChain, FAISS, and PyTorch, optimized for AMD GPUs (ROCm). AMD Hackathon.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages