Drug Discovery & Pharmaceutical Research with Hermes Agent
Pharmaceutical research assistant for drug discovery workflows. Search bioactive compounds on ChEMBL, calculate drug-likeness (Lipinski Ro5, QED, TPSA, synthetic accessibility), look up drug-drug interactions via OpenFDA, interpret ADMET profiles, and assist with lead optimization. Use for medicinal chemistry questions, molecule property analysis, clinical pharmacology, and open-science drug research.
Written by Neura Market from the official Hermes Agent documentation for Drug Discovery. Commands, paths, and version numbers are reproduced from the source unchanged.
Read the official documentationThis skill turns Hermes Agent into a pharmaceutical research assistant for drug discovery workflows. It searches bioactive compounds on ChEMBL, calculates drug-likeness (Lipinski Ro5, QED, TPSA, synthetic accessibility), looks up drug-drug interactions via OpenFDA, interprets ADMET profiles, and assists with lead optimization. Use it for medicinal chemistry questions, molecule property analysis, clinical pharmacology, and open-science drug research.
What it does
You get a set of command-line workflows that hit public, free APIs (ChEMBL, PubChem, OpenFDA, OpenTargets) to answer real drug discovery questions. No API keys, no paid subscriptions. The skill is designed for a medicinal chemist or pharmacologist who wants to script routine lookups: find a target, pull bioactivity data, check a molecule's drug-likeness, look up interactions, and connect genes to diseases. Each workflow returns structured data you can pipe into further analysis or a report.
Before you start
- The skill is optional and installed on demand. The skill path is
optional-skills/research/drug-discovery. - Version 1.0.0, author bennytimz, MIT license.
- Works on Linux, macOS, and Windows.
- You need
python3andcurlon your PATH. The Python scripts use only the standard library (json, sys, urllib.parse), so no pip installs are required. - All APIs are free and public. No authentication is needed.
- ChEMBL rate limits apply: add
sleep 1between batch requests.
Core Workflows
1, Bioactive Compound Search (ChEMBL)
Search ChEMBL (the world's largest open bioactivity database) for compounds by target, activity, or molecule name. No API key required.
# Search compounds by target name (e.g. "EGFR", "COX-2", "ACE")
TARGET="$1"
ENCODED=$(python3 -c "import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))" "$TARGET")
curl -s "https://www.ebi.ac.uk/chembl/api/data/target/search?q=${ENCODED}&format=json" \
| python3 -c "
import json,sys
data=json.load(sys.stdin)
targets=data.get('targets',[])[:5]
for t in targets:
print(f\"ChEMBL ID : {t.get('target_chembl_id')}\")
print(f\"Name : {t.get('pref_name')}\")
print(f\"Type : {t.get('target_type')}\")
print()
"
This command takes a target name (like EGFR or COX-2), URL-encodes it, and queries the ChEMBL target search API. It prints the top five matching targets with their ChEMBL ID, preferred name, and target type. You use this when you have a protein name and need the official ChEMBL ID to pull bioactivity data.
# Get bioactivity data for a ChEMBL target ID
TARGET_ID="$1" # e.g. CHEMBL203
curl -s "https://www.ebi.ac.uk/chembl/api/data/activity?target_chembl_id=${TARGET_ID}&pchembl_value__gte=6&limit=10&format=json" \
| python3 -c "
import json,sys
data=json.load(sys.stdin)
acts=data.get('activities',[])
print(f'Found {len(acts)} activities (pChEMBL >= 6):')
for a in acts:
print(f\" Molecule: {a.get('molecule_chembl_id')} | {a.get('standard_type')}: {a.get('standard_value')} {a.get('standard_units')} | pChEMBL: {a.get('pchembl_value')}\")
"
Once you have a ChEMBL target ID, this command fetches up to ten activities with a pChEMBL value of 6 or higher (roughly 1 µM or better). It prints the molecule ID, the assay type, the measured value, and the pChEMBL score. This is your go-to for finding potent compounds against a target.
# Look up a specific molecule by ChEMBL ID
MOL_ID="$1" # e.g. CHEMBL25 (aspirin)
curl -s "https://www.ebi.ac.uk/chembl/api/data/molecule/${MOL_ID}?format=json" \
| python3 -c "
import json,sys
m=json.load(sys.stdin)
props=m.get('molecule_properties',{}) or {}
print(f\"Name : {m.get('pref_name','N/A')}\")
print(f\"SMILES : {m.get('molecule_structures',{}).get('canonical_smiles','N/A') if m.get('molecule_structures') else 'N/A'}\")
print(f\"MW : {props.get('full_mwt','N/A')} Da\")
print(f\"LogP : {props.get('alogp','N/A')}\")
print(f\"HBD : {props.get('hbd','N/A')}\")
print(f\"HBA : {props.get('hba','N/A')}\")
print(f\"TPSA : {props.get('psa','N/A')} Ų\")
print(f\"Ro5 violations: {props.get('num_ro5_violations','N/A')}\")
print(f\"QED : {props.get('qed_weighted','N/A')}\")
"
Given a ChEMBL molecule ID (like CHEMBL25 for aspirin), this command returns the molecule's name, canonical SMILES, molecular weight, LogP, hydrogen bond donors and acceptors, TPSA, Lipinski Rule of Five violations, and the quantitative estimate of drug-likeness (QED). It's a quick way to get a drug-likeness profile without installing RDKit.
2, Drug-Likeness Calculation (Lipinski Ro5 + Veber)
Assess any molecule against established oral bioavailability rules using PubChem's free property API, no RDKit install needed.
COMPOUND="$1"
ENCODED=$(python3 -c "import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))" "$COMPOUND")
curl -s "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/${ENCODED}/property/MolecularWeight,XLogP,HBondDonorCount,HBondAcceptorCount,RotatableBondCount,TPSA,InChIKey/JSON" \
| python3 -c "
import json,sys
data=json.load(sys.stdin)
props=data['PropertyTable']['Properties'][0]
mw = float(props.get('MolecularWeight', 0))
logp = float(props.get('XLogP', 0))
hbd = int(props.get('HBondDonorCount', 0))
hba = int(props.get('HBondAcceptorCount', 0))
rot = int(props.get('RotatableBondCount', 0))
tpsa = float(props.get('TPSA', 0))
print('=== Lipinski Rule of Five (Ro5) ===')
print(f' MW {mw:.1f} Da {\"✓\" if mw<=500 else \"✗ VIOLATION (>500)\"}')
print(f' LogP {logp:.2f} {\"✓\" if logp<=5 else \"✗ VIOLATION (>5)\"}')
print(f' HBD {hbd} {\"✓\" if hbd<=5 else \"✗ VIOLATION (>5)\"}')
print(f' HBA {hba} {\"✓\" if hba<=10 else \"✗ VIOLATION (>10)\"}')
viol = sum([mw>500, logp>5, hbd>5, hba>10])
print(f' Violations: {viol}/4 {\"→ Likely orally bioavailable\" if viol<=1 else \"→ Poor oral bioavailability predicted\"}')
print()
print('=== Veber Oral Bioavailability Rules ===')
print(f' TPSA {tpsa:.1f} Ų {\"✓\" if tpsa<=140 else \"✗ VIOLATION (>140)\"}')
print(f' Rot. bonds {rot} {\"✓\" if rot<=10 else \"✗ VIOLATION (>10)\"}')
print(f' Both rules met: {\"Yes → good oral absorption predicted\" if tpsa<=140 and rot<=10 else \"No → reduced oral absorption\"}')
"
This workflow takes a compound name (like "aspirin" or "ibuprofen"), fetches its properties from PubChem, and evaluates Lipinski's Rule of Five and Veber's rules. It prints each property, marks violations, and gives a summary prediction for oral bioavailability. Use this when you have a molecule name and want a quick drug-likeness assessment.
3, Drug Interaction & Safety Lookup (OpenFDA)
DRUG="$1"
ENCODED=$(python3 -c "import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))" "$DRUG")
curl -s "https://api.fda.gov/drug/label.json?search=drug_interactions:\"${ENCODED}\"&limit=3" \
| python3 -c "
import json,sys
data=json.load(sys.stdin)
results=data.get('results',[])
if not results:
print('No interaction data found in FDA labels.')
sys.exit()
for r in results[:2]:
brand=r.get('openfda',{}).get('brand_name',['Unknown'])[0]
generic=r.get('openfda',{}).get('generic_name',['Unknown'])[0]
interactions=r.get('drug_interactions',['N/A'])[0]
print(f'--- {brand} ({generic}) ---')
print(interactions[:800])
print()
"
This command searches the OpenFDA drug label endpoint for drug interaction information. It returns the brand name, generic name, and the first 800 characters of the drug interactions section from up to two labels. Use this when you need to check what a drug's label says about interactions with other drugs.
DRUG="$1"
ENCODED=$(python3 -c "import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))" "$DRUG")
curl -s "https://api.fda.gov/drug/event.json?search=patient.drug.medicinalproduct:\"${ENCODED}\"&count=patient.reaction.reactionmeddrapt.exact&limit=10" \
| python3 -c "
import json,sys
data=json.load(sys.stdin)
results=data.get('results',[])
if not results:
print('No adverse event data found.')
sys.exit()
print(f'Top adverse events reported:')
for r in results[:10]:
print(f\" {r['count']:>5}x {r['term']}\")
"
This command queries the OpenFDA adverse event reporting system (FAERS) for a drug and returns the top ten reported adverse reactions, sorted by count. It's useful for getting a quick signal on safety concerns, but remember that these are reported events, not necessarily causal.
4, PubChem Compound Search
COMPOUND="$1"
ENCODED=$(python3 -c "import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1]))" "$COMPOUND")
CID=$(curl -s "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/name/${ENCODED}/cids/TXT" | head -1 | tr -d '[:space:]')
echo "PubChem CID: $CID"
curl -s "https://pubchem.ncbi.nlm.nih.gov/rest/pug/compound/cid/${CID}/property/IsomericSMILES,InChIKey,IUPACName/JSON" \
| python3 -c "
import json,sys
p=json.load(sys.stdin)['PropertyTable']['Properties'][0]
print(f\"IUPAC Name : {p.get('IUPACName','N/A')}\")
print(f\"SMILES : {p.get('IsomericSMILES','N/A')}\")
print(f\"InChIKey : {p.get('InChIKey','N/A')}\")
"
This workflow takes a compound name, resolves it to a PubChem CID, then fetches the IUPAC name, isomeric SMILES, and InChIKey. Use this when you have a common name and need the standard chemical identifiers for database searches or reporting.
5, Target & Disease Literature (OpenTargets)
GENE="$1"
curl -s -X POST "https://api.platform.opentargets.org/api/v4/graphql" \
-H "Content-Type: application/json" \
-d "{\"query\":\"{ search(queryString: \\\"${GENE}\\\", entityNames: [\\\"target\\\"], page: {index: 0, size: 1}) { hits { id score object { ... on Target { id approvedSymbol approvedName associatedDiseases(page: {index: 0, size: 5}) { count rows { score disease { id name } } } } } } } }\"}" \
| python3 -c "
import json,sys
data=json.load(sys.stdin)
hits=data.get('data',{}).get('search',{}).get('hits',[])
if not hits:
print('Target not found.')
sys.exit()
obj=hits[0]['object']
print(f\"Target: {obj.get('approvedSymbol')} — {obj.get('approvedName')}\")
assoc=obj.get('associatedDiseases',{})
print(f\"Associated with {assoc.get('count',0)} diseases. Top associations:\")
for row in assoc.get('rows',[]):
print(f\" Score {row['score']:.3f} | {row['disease']['name']}\")
"
This command sends a GraphQL query to OpenTargets to find a gene target and its top five associated diseases, ranked by association score. Use this when you want to connect a gene to diseases it's implicated in, for target validation or literature review.
Reasoning Guidelines
When analysing drug-likeness or molecular properties, always:
- State raw values first, MW, LogP, HBD, HBA, TPSA, RotBonds
- Apply rule sets, Ro5 (Lipinski), Veber, Ghose filter where relevant
- Flag liabilities, metabolic hotspots, hERG risk, high TPSA for CNS penetration
- Suggest optimizations, bioisosteric replacements, prodrug strategies, ring truncation
- Cite the source API, ChEMBL, PubChem, OpenFDA, or OpenTargets
For ADMET questions, reason through Absorption, Distribution, Metabolism, Excretion, Toxicity systematically. See references/ADMET_REFERENCE.md for detailed guidance.
Important Notes
- All APIs are free, public, require no authentication
- ChEMBL rate limits: add sleep 1 between batch requests
- FDA data reflects reported adverse events, not necessarily causation
- Always recommend consulting a licensed pharmacist or physician for clinical decisions
Quick Reference
| Task | API | Endpoint |
|---|---|---|
| Find target | ChEMBL | /api/data/target/search?q= |
| Get bioactivity | ChEMBL | /api/data/activity?target_chembl_id= |
| Molecule properties | PubChem | /rest/pug/compound/name/{name}/property/ |
| Drug interactions | OpenFDA | /drug/label.json?search=drug_interactions: |
| Adverse events | OpenFDA | /drug/event.json?search=...&count=reaction |
| Gene-disease | OpenTargets | GraphQL POST /api/v4/graphql |