Open Source · MIT License

Agentic RAG for Drug Intelligence

A CLI and agent runtime for drug-focused questions, built for evidence-grounded retrieval, reasoning, and source attribution across curated biomedical resources.

70
Curated Resources
57
Implemented Skills
15
Drug Subcategories
3
Reasoning Modes

Built for drug-native intelligence

Most biomedical QA systems stop at "retrieve a few passages and summarize them." Drug questions demand precision, provenance, and multi-hop reasoning.

🧬

Vibe-Coding Retrieval

Each skill ships with its own SKILL.md and example.py. The Code Agent reads both, learns native usage patterns, and generates query code dynamically.

🌳

15-Subcategory Skill Tree

70 curated drug resources organized into a navigable skill tree spanning DTI, ADR, DDI, PGx, repurposing, and more.

🔗

Graph-Based Reasoning

Turn free-form retrieval results into triples, subgraphs, ranked paths, and evidence-aware answers instead of simply stitching excerpts.

🌐

Web Search Fallback

Built-in DuckDuckGo + PubMed search as a supplement for recent literature and external evidence beyond local resources.

💊

Drug-First Scope

Opinionated around drug-native tasks from resource organization to retrieval strategy, reasoning flow, and final answer structure.

🔌

Provider Agnostic

Works with any OpenAI-compatible API: GPT-4o, Azure OpenAI, LLaMA via vLLM, Ollama, Together AI, and more.

Three working modes

Choose the right reasoning depth for your query — from fast retrieval to deep multi-hop graph reasoning.

GRAPH

Multi-Hop Reasoning

Retrieve → Graph Build → Rerank → Respond → Reflect. Full evidence synthesis with optional iterative refinement and web search.

SIMPLE

Direct Retrieval

Retrieve and answer directly. Fast, efficient, and ideal for straightforward drug information queries.

WEB_ONLY

Online Search

Use only online search and literature retrieval. Perfect when you need the latest published evidence.

Architecture

A multi-agent pipeline from query understanding to evidence-grounded answers.

  User Query
       │
       ▼
  Retriever Agent
       ├── navigates the 15-subcategory skill tree
       ├── extracts key entities
       └── selects relevant resources
       │
       ▼
  Code Agent
       ├── reads SKILL.md + example.py
       ├── writes custom query code
       └── executes resource-specific retrieval
       │
       ├──▶ SIMPLE ──▶ Responder ──▶ Final Answer
       │
       └──▶ GRAPH  ──▶ Graph Builder ──▶ Reranker
                        ──▶ Responder ──▶ Reflector
                        ──▶ optional Web Search
                        ──▶ Final Answer

57 Implemented Skills

Organized across 15 drug-specific subcategories for comprehensive coverage.

Category#Skills
DTI10ChEMBL, BindingDB, DGIdb, Open Targets, TTD, STITCH, TarKG, GDKD, Molecular Targets ×2
ADR4FAERS, SIDER, nSIDES, ADReCS
Knowledgebase8UniD3, DrugBank, IUPHAR/BPS, DrugCentral, CPIC, PharmKG, WHO EML, FDA Orange Book
Mechanism1DRUGMECHDB
Labeling3openFDA Human Drug, DailyMed, MedlinePlus Drug Info
Ontology4RxNorm, ChEBI, ATC/DDD, NDF-RT
Repurposing6RepoDB, DRKG, OREGANO, Drug Repurposing Hub, DrugRepoBank, RepurposeDrugs
PGx1PharmGKB
DDI3MecDDI, DDInter, KEGG Drug
Toxicity4UniTox, LiverTox, DILIrank, DILI
Combination2DrugCombDB, DrugComb
Molecular Prop1GDSC
Drug-Disease1SemaTyP
Reviews2WebMD Drug Reviews, Drugs.com Reviews
Drug NLP7DDI Corpus 2013, DrugProt, ADE Corpus, CADEC, PsyTAR, TAC 2017 ADR, PHEE

Quick Start

Follow the default minimal-mode setup path: clone the repo, configure your model, verify the environment, and run a real query.

01

Clone the Repository

git clone https://github.com/QSong-github/DrugClaw
cd DrugClaw
02

Install Dependencies

pip install -e .
03

Create navigator_api_keys.json

# Create navigator_api_keys.json at the repository root
{
  "api_key": "<your-api-key>",
  "base_url": "<your-base-url>",
  "model": "gpt-5.4-mini"
}
04

Verify the Environment

python -m drugclaw doctor
05

Run Your First Query

python -m drugclaw run --query "What are the known drug targets of imatinib?"
Minimal mode is the default. If you need deeper and broader local evidence coverage, download resources_metadata_full.tar.gz from the Hugging Face mirror, extract it at the repository root, then run python -m drugclaw doctor again.

Python API (Optional)

# Call DrugClaw from Python from drugclaw.config import Config from drugclaw.main_system import DrugClawSystem from drugclaw.models import ThinkingMode config = Config(key_file="navigator_api_keys.json") system = DrugClawSystem(config) result = system.query( "What prescribing and safety information is available for metformin?", thinking_mode=ThinkingMode.SIMPLE, resource_filter=["DailyMed", "openFDA Human Drug"], ) print(result["answer"])

Need broader local evidence coverage?

Start with the default repository layout. When you need deeper local coverage, extract the full resource overlay and re-run the environment check.