Mednexa is a full-stack platform for pharmaceutical portfolio planning, combining a Python-based agentic backend (LangGraph, Gemini, FastAPI) with a modern Next.js/TypeScript frontend. It orchestrates specialized worker agents, aggregates insights, and generates executive PDF reports.
MedNexa2/
├── app.py # Backend entry point (CLI)
├── api.py # FastAPI backend server
├── pyproject.toml # Python dependencies
├── agents/ # All agent logic (IQVIA, EXIM, Patent, etc)
├── orchestration/ # LangGraph state machine, router, state
├── contracts/ # Pydantic schemas for agent IO
├── data/ # Mock data files (JSON, CSV)
├── reports/ # PDF generation and templates
├── llm/ # Gemini summarizer
├── outputs/ # Generated PDF reports
├── mednexa-frontend/ # Next.js 14 frontend (TypeScript, Tailwind)
│ ├── src/app/ # App Router pages (dashboard, chat, results, etc)
│ ├── components/ # UI, layout, chat, charts
│ ├── lib/ # Utilities
│ └── services/ # API service functions
START
↓
[Parse User Query]
↓
[Master Agent: Query Analysis]
↓
[Rule-Based Router] ← Determines which agents to invoke based on query keywords
↓
├─→ [IQVIA Agent] ──┐
├─→ [EXIM Agent] ────┤
├─→ [Patent Agent] ──┤
├─→ [Clinical Trials Agent] ──┤
├─→ [Internal Knowledge Agent] ──┤
└─→ [Web Intelligence Agent] ──┘
↓
[Aggregator Node] ← Collects all worker outputs into single JSON
↓
[Gemini Summarizer Node] ← **ONLY LLM CALL** (receives aggregated JSON)
↓
[PDF Report Generator]
↓
[END: Print file path]
python app.py "What is the market potential for Drug X in oncology?"python app.py
# Then enter your query when prompteduvicorn api:app --reloadPOST to /analyze with { "query": "..." } for summary and PDF.
GEMINI_API_KEY: Required for Gemini summarization
- PDF reports are saved to
outputs/directory - Console displays processing status and executive summary
Mock data files are in data/:
iqvia_data.json,exim_data.csv,patent_data.json,clinical_trials_data.json,internal_knowledge.json,web_intelligence.json
- Node.js 18+, npm or yarn
cd mednexa-frontend
npm installnpm run dev
# App at http://localhost:5000npm run build
npm startSet backend URL via NEXT_PUBLIC_API_URL or in src/services/api.ts.
- Dashboard → View KPIs and recent queries
- Chat → Ask "Where is the unmet need in oncology?"
- Clarify → Select region or mechanism focus
- Results → Explore detailed agent outputs
- Summary → View executive report with findings
- Download → Generate PDF report
- Worker agents do NOT use LLMs
- Gemini is called exactly ONCE at the end
- All routing is rule-based (keyword matching)
- All inter-agent communication uses structured JSON
- Frontend and backend are fully decoupled (API-driven)
Private - Mednexa