Skip to content

lsbnb/NetMedEx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

90 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

NetMedEx

Python package Doc

NetMedEx is an AI-powered knowledge discovery platform designed to transform biomedical literature into actionable insights. Unlike traditional tools that merely extract entities, NetMedEx leverages Hybrid Retrieval-Augmented Generation (Hybrid RAG) to synthesize structured co-mention networks with unstructured text, providing a holistic understanding of biological relationships.

๐ŸŒŸ Core Philosophy: Scaffolding for Discovery

In NetMedEx, the Co-Mention Network serves as a structural "scaffolding." While the network visualizes the landscape of bio-concepts (genes, diseases, chemicals, etc.), the AI-driven Semantic Layer breathes life into these connections by extracting evidence, identifying relationship types, and answering complex natural language queries.


๐Ÿš€ Getting Started

NetMedEx offers flexible ways to interact with the platform:

  1. Web Application (via Docker) - Recommended
  2. Web Application (Local)
  3. Command-Line Interface (CLI)
  4. Python API

๐Ÿณ Web Application (via Docker)

The easiest way to start is using Docker. Run the command below (adding -d to run in background) and open localhost:8050 in your browser:

docker run -d -p 8050:8050 --rm lsbnb/netmedex

๐Ÿ“ฆ Installation

Alternatively, install via PyPI for local hosting or CLI access:

pip install netmedex

Recommended: Python >= 3.11

๐Ÿ’ป Web Application (Local)

Launch the interactive dashboard locally:

netmedex run

๐Ÿค– Hybrid RAG-Powered Discovery

NetMedEx features an interactive Chat Panel driven by Hybrid RAG, which combines the power of large language models (LLMs) with specialized bio-medical knowledge graphs.

NetMedEx Architecture
Figure 1: NetMedEx Hybrid RAG Architecture combining Text and Graph RAG for chatting with biomedical knowledge.

Key Capabilities

  • Hybrid RAG Chat: Synthesizes unstructured text (abstracts) and structured graph knowledge (paths and neighbors).
  • Natural Language & Universal Translation: Ask in English, Japanese, Chinese, or Korean! NetMedEx automatically translates non-English queries to optimized standard PubTator3 English syntax before searching.
  • ChatGPT-Style Chat Experience: Features an intuitive, auto-scrolling Chat Panel that perfectly mimics modern AI layouts (user queries on the right, AI responses on the left), preventing the need for manual scrolling.
  • Semantic Evidence Extraction: Automatically identifies relationship types (e.g., treats, inhibits) and confidence scores.
  • Contextual Reasoning: Identifies shortest paths and relevant subgraphs to explain hidden connections between entities.

Setup AI Engine

  1. Obtain an API key from OpenAI or set up a local LLM endpoint (e.g., Ollama).
  2. Configure via "Advanced Settings" in the web interface or via .env file.

Tip

Connecting to Local LLMs (Ollama/LM Studio):

  • Linux/Docker: Use your host IP (e.g., http://192.168.1.100:11434).
  • Windows/macOS (Docker): Use http://host.docker.internal:[PORT].

๐Ÿ–ผ๏ธ Interface & Quick Tour

The workspace follows a logical discovery workflow across three main operational panels.

1. Search & Configuration (The Entry Point)

The Search Panel is where you define your research scope and configure the AI engine.

Search Panel
Figure 2: The Search Panel for keyword and natural language querying.

Expand Advanced Settings to configure your LLM provider. This is a crucial first step for enabling semantic analysis.

Advanced Settings
Figure 3: Configuring the AI Engine (OpenAI or Local) in Advanced Settings.

LLM Dropdown Selection
Figure 4: Selecting a specific model for local AI processing via the dropdown menu.

Users can also upload previously downloaded PubTator format files for re-analysis, or restore a previously exported Graph File (.pkl) to skip re-processing entirely.

PubTator Search
Figure 5: Uploading PubTator files for re-analysis, or a Graph File (.pkl) to instantly restore a saved session.

Tip

Graph File Restore: After a time-consuming Semantic Analysis run, export the result as a Graph (.pkl) from the Graph Panel, then reload it later via Search Panel โ†’ Source: Graph File (.pkl). The full graph state โ€” including all semantic edges, node metadata, and article abstracts โ€” is restored instantly, allowing you to continue adjusting the network and using the Chat Panel without re-running any analysis.

2. Graph & Scaffolding (Structural View)

The Graph Panel visualizes the co-mention/semantic analyzed network, providing the visualization of search results for your research. Using the shift key to select sub-network, those selected nodes and edges will be highlighted as the base for chat in next step. Users can visualize the network using different layouts and community detection algorithms. Users also can export the network in several formats:

Export Format Description Re-importable?
HTML Interactive visualization for browsers (example) โŒ
XGMML Network file for Cytoscape Desktop โŒ
PubTator Raw annotation file โœ… Re-upload in Search Panel
Graph (.pkl) Full graph state including semantic analysis results and article abstracts โœ… Restore in Search Panel โ†’ "Graph File"

Graph Panel
Figure 6: Interactive Knowledge Graph showing Bio-Concept connections.

Full Graph Panel
Figure 7: High-resolution view of the Graph Panel interface.There are several options in the top right corner of the graph panel, including layout, community detection, and save.

Sarcopenia Graph
Figure 8: Case study: Visualizing the Sarcopenia-related network using NetMedEx to depict the relationships in semantic level between genes, diseases, chemicals, and species.

  • Nodes: Genes, Diseases, Chemicals, and Species.
  • Edges: Literature co-occurrence. Thicker edges indicate higher frequency.
  • Clusters: Use the Community Detection feature to group related concepts automatically.

Community Clusters
Figure 9: Automated community detection for functional clustering.

Graph Selection
Figure 10: Selecting a sub-network by holding the Shift key to isolate relevant nodes and edges as the base for hybridRAG to chat with.

3. Chat & Semantic Insights (Interpretation)

The Chat Panel provides the deep semantic layer, interpreting the graph using LLMs.

Chat Panel
Figure 11: Hybrid RAG Chat for natural language reasoning over the network.

Chat Layout Selection
Figure 12(A): Press the "Analyze Selection" button to construct RAGs for communications with the selected sub-network.

RAG Processing
Figure 12(B): RAG generating to prepare the chat later.

Chat History Panel
Figure 13: The Chat History panel for managing and reviewing previous discovery sessions.

miRNA Relationship Table
Figure 14: Tabular representation of semantic analysis results (e.g., miRNA relationships).

โš™๏ธ Batch Processing vs. Interactive Discovery

While the Web Interface provides a full "Interactive Discovery" workflowโ€”including dynamic sub-network selection (Shift+Select) and real-time Hybrid RAG chatโ€”the CLI and API are designed for automated batch processing and static graph construction.

  • Interactive Discovery (Web Only): Real-time interaction, dynamic graph filtering, and context-aware chat.
  • Batch Processing (CLI/API): Static semantic analysis and high-throughput network generation.

๐Ÿ› ๏ธ Command-Line Interface (CLI)

For high-throughput analysis, use the NetMedEx CLI.

Step 1: Search PubMed

# Search articles by keywords
netmedex search -q '"N-dimethylnitrosamine" AND "Metformin"' --sort score

Step 2: Build the Network

# Generate HTML network from annotations
netmedex network -i annotations.pubtator -o network.html -w 2 --community

๐Ÿ Package API

NetMedEx can be integrated directly into your Python pipelines as a library.

# Programmatic Access (API)
from netmedex import search, network

ยฉ 2026 LSBNB Lab@ IIS, Academia Sinica, TAIWAN. Refer to LICENSE for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors