GenScAI is a hands-on toolkit for applying large language models to scientific workflows, with a focus on infectious disease research and modeling. It pairs a reusable Python package with runnable notebooks and example applications so researchers can retrieve literature, extract structured information, classify and cluster papers, build knowledge graphs, and prototype LLM agents using local or hosted models.
- Literature retrieval from sources such as medRxiv and configurable APIs.
- Information extraction recipes using OpenAI, LangChain, and LangExtract.
- Embeddings and clustering with general-purpose and science-specific models (SPECTER, SPECTER2, NV-Embed).
- Document classification with training, evaluation, and cross-model validation pipelines.
- Knowledge graph construction via GraphRAG and LangChain.
- Agents and tools built on
smolagentsand the Model Context Protocol (MCP). - Relevance-gated research corpus (
genscai.corpus.Corpus): search → relevance-gate → persist → read as ready-made AIMU agent tools over a vector store. - Local model support through Ollama, Hugging Face Transformers, and quantization recipes.
- Example chatbot (streamlit/genscai_chatbot.py) for exploring infectious disease modeling frameworks (LASER, Starsim) and the research literature.
- Python 3.10+
- Ollama (optional, for running LLMs locally)
- An NVIDIA GPU and CUDA drivers (optional, for accelerated local inference)
With uv (recommended)
uv venv
source .venv/bin/activate
uv sync --all-extras--all-extras installs the main, development, notebook, and CUDA dependency groups. To install only the dependencies you need:
uv pip install -e . # core package
uv pip install -e '.[dev]' # ruff, pytest
uv pip install -e '.[notebooks]' # ipykernel, ipywidgets
uv pip install -e '.[cuda]' # NVIDIA GPU supportpython3 -m venv .venv
source .venv/bin/activate
pip install -e . # add '[dev]', '[notebooks]', or '[cuda]' as neededOpen the notebooks (each use-case folder has a notebooks/ and/or scripts/ subdir):
jupyter labNew here? Start with 00 - getting started/notebooks/01 - Environment Setup.ipynb, then work through the use-case folders in order.
To preview a chatbot wired to the project's scientific tools (research-article search, disease-modeling framework docs), launch the example Streamlit app instead:
streamlit run streamlit/genscai_chatbot.pyEach scientific use case is a top-level folder containing its own notebooks/ and/or scripts/. The
reusable Python package, datasets, generated artifacts, and tests are shared at the root.
genscai/
├── genscai/ Reusable Python package (retrieval, classification, research, corpus, knowledge_base, simulation, tools)
├── 00 - getting started/ Environment setup
├── 01 - data collection/ Retrieve abstracts/articles (MIDAS, medRxiv, arXiv)
├── 02 - text analysis/ Information extraction, embeddings, classification
├── 03 - knowledge graphs/ Knowledge-graph construction and querying (GraphRAG, LangChain)
├── 04 - semantic search/ medRxiv vector index + retrieval-augmented generation (RAG)
├── 05 - model optimization/ Quantization and fine-tuning
├── 06 - agents/ Agent + MCP tool demos
├── 07 - literature research/ Agentic literature research across six frameworks
├── 08 - disease simulation/ Compartmental-model intervention-planning agent
├── 09 - evaluation/ Benchmarking
├── streamlit/ Example Streamlit applications (the GenScAI chatbot)
├── data/ Sample and training datasets
├── output/ Generated artifacts (vector DB, model weights)
├── tests/ Package tests
└── pyproject.toml
Each top-level folder is a use case with its own README listing its notebooks and scripts.
- 00 - getting started: Environment setup
- 01 - data collection: Retrieve abstracts/articles (MIDAS, medRxiv, arXiv)
- 02 - text analysis: Information extraction, embeddings, classification
- 03 - knowledge graphs: Knowledge-graph construction and querying (GraphRAG, LangChain)
- 04 - semantic search: medRxiv vector index and retrieval-augmented generation (RAG)
- 05 - model optimization: Quantization and fine-tuning
- 06 - agents: Tool-using agents (MCP, smolagents, AIMU workflows)
- 07 - literature research: Agentic literature research across six frameworks + a
genscai.corpusbuild - 08 - disease simulation: Compartmental-model intervention-planning agent
- 09 - evaluation: Benchmarking models and agent configurations
Within a folder, notebooks are numbered from 01 and meant to be worked through in order.
The 07 - literature research/ folder implements one identical use case — agentic
literature research over medRxiv/bioRxiv with a relevance-gated local document store and a critic
feedback loop — six ways across agent frameworks plus a "batteries-included" build from the
project's own genscai.corpus.Corpus helper (on AIMU), all on local Ollama
models. Read them side by side. Requires uv sync --all-extras. See its
README.
- 01: AIMU
- 02: genscai (
genscai.corpus.Corpus, on AIMU) - 03: smolagents
- 04: LangGraph
- 05: PydanticAI
- 06: CrewAI
- 07: LlamaIndex
The 08 - disease simulation/ folder holds an adaptive intervention-planning agent
(scripts/01_intervention_agent.py) that drives
the compartmental model in genscai/simulation.py.
Run linting and tests:
ruff check .
pytestReleased under the Apache License 2.0.
- MIDAS Network paper abstracts: https://midasnetwork.us/papers/
- LASER disease modeling framework: https://github.com/InstituteforDiseaseModeling/laser
- Starsim disease modeling framework: https://github.com/starsimhub/starsim