aiva-agent
A standalone clinical-genomics agent. Ask natural-language questions about a local pre-annotated VCF, gather variant annotations, search literature, find clinical trials, prioritize genes from HPO phenotypes, and run ACMG/AMP variant classification — using any OpenAI-compatible provider (OpenAI, Anthropic, xAI Grok, Together, Fireworks, OpenRouter, etc.).
export LLM_MODEL=gpt-6.1-sol
export LLM_BASE_URL=https://api.openai.com/v1
export LLM_API_KEY=sk-...
aiva_agent --vcf data/test.vcf.gz \
--prompt "3yo female with developmental regression, hand stereotypies, and acquired microcephaly. Find candidate variants and propose the most likely diagnosis with supporting evidence."
Contents
- What it does
- Prerequisites
- Quickstart
- Web UI
- Examples
- Notebook usage
- Classify a single variant
- Running on HPC
- License
What it does
The agent runs locally over a pre-annotated tabix-indexed VCF and can answer questions about your variants, retrieve supporting literature, surface clinical trials, prioritize candidate genes from phenotype terms, and run ACMG/AMP variant classification.
| Capability | What it does |
|---|---|
| Variant queries | Ask questions about your tabix-indexed .vcf.gz file. |
| Variant annotation | Annotate variants, for human and plant species. |
| Literature search | PubMed / PMC search with gene / disease / variant / chemical entity annotations, plus a per-variant lookup that returns the passages mentioning the variant. |
| Clinical trials | Search by condition, intervention, gene/variant, phase, recruiting status; full-detail retrieval by NCT ID. |
| Gene prioritization | Rank candidate genes for a list of HPO phenotype terms. Can use negative terms to exclude genes. |
| Web research | Web search and clean content extraction from any URL. |
| Variant classification | ACMG/AMP 2015 (germline) and AMP/ASCO/CAP 2017 (somatic) classification, returned as JSON. |
| BAM/CRAM access | Evidence from BAM/CRAM files (--bam): per-allele pileup with strand and indel counts, phase of two nearby variants, the reads in a window (CIGAR, mates, insert sizes) and window coverage. |
| Review and annotations | Flag variants per sample and save classifications to a local database the web UI's review panel reads. |
| File exploration | Look into any file in your working directory (CSV, TSV, Excel, JSON, parquet, plain text) and use whatever tools your environment has on PATH. Scope with --workdir or AIVA_WORKDIR; defaults to the current directory. |
| Task planning | Plans and tracks multi-step work within a single run: creates a todo list up front, marks items in progress, and completes them as it goes. State is per-run (not persisted across sessions). |
| Subagents | Runs subagents in parallel, one per independent unit of work (gene, sample, variant, question). Each subagent works from a self-contained goal and reports evidence, confidence, and caveats that the agent synthesizes. |
Prerequisites
- For
pip install: Python 3.10+ withpip ≥ 24. The package is a compiled wheel; the agent itself doesn't run on Python. The Docker image needs no Python. - htslib tools (
bgzip,tabix) only needed for preparing VCFs (brew install htslibon macOS). - Linux: glibc ≥ 2.28 (Ubuntu ≥ 20.04, RHEL/Rocky ≥ 8, Debian ≥ 10) for the
vcftool. Older hosts can use the container image — see Running on HPC. - A
.envfile with your model settings. Runaiva_agent initto create one with every setting explained in comments, then fill in your key. For all flags runaiva_agent --help(alsoclassify --helpandaiva_agent_serve --help); in Python or a notebook usehelp(aiva_agent).aiva_agent doctorchecks your setup. - Internet connectivity — For HPC/cloud/remote environments/jobs, ensure outbound HTTPS to your LLM provider and to the public APIs the agent queries (NCBI E-utilities, ClinicalTrials.gov, DuckDuckGo, etc.). Behind a corporate proxy, set
HTTPS_PROXY/HTTP_PROXY/NO_PROXY(honored automatically); for MITM proxies, add your org's root certificate to the system trust store. Only the localvcftool runs without network.
Quickstart
1. Install (pick one)
pip — fastest if you have Python 3.10+ on a modern Linux/macOS host:
pip install aiva-agent
Docker — works anywhere a container runs (Docker, Podman, Apptainer/Singularity). Useful when your host can't install Python or has older glibc (see Running on HPC):
docker pull mhspl/aiva-agent:latest
Python import — call from a notebook or script (see Notebook usage):
from aiva_agent import aiva_agent
2. Configure
Run aiva_agent init in your working directory. It creates a .env file with every setting explained in comments (it won't overwrite an existing .env unless you pass --force). Open it, set your model provider details, and uncomment the API key line:
LLM_MODEL=gpt-6.1-sol
LLM_BASE_URL=https://api.openai.com/v1
LLM_API_KEY=sk-...
The agent loads the file automatically on every run and works with any OpenAI-compatible endpoint. CLI flags and exported variables take priority over it, so you can also use them for a one-off run.
Web search works without a key, at lower limits. For heavier use, add WEB_API_KEY to your .env: a Firecrawl key (free tier ≈1,000 page fetches/month). aiva_agent init lists every optional key.
Questions about your VCF need --vcf (or AIVA_VCF); without one, that capability turns itself off.
Security note: prefer .env or export LLM_API_KEY=... over --api-key sk-... so the secret doesn't leak into shell history or ps.
Check the setup with aiva_agent doctor: it loads the VCF/BAM engine (installing its extension the first time) and says which keys are set, never their values.
3. Run
Prepare a tabix-indexed VCF (only once per file):
bgzip -k path/to/sample.vcf
tabix -p vcf path/to/sample.vcf.gz
A plain uncompressed .vcf also works, but region queries need the index, so the bgzip plus tabix form is recommended.
Tip: prefer a pre-annotated VCF. If you've already run your VCF through a variant-effect annotator (VEP, SnpEff, ANNOVAR, …), the agent can read those annotations directly from the file. Pre-annotation is recommended for variant prioritization and classification.
Then ask a question:
aiva_agent --vcf path/to/sample.vcf.gz \
--prompt "List pathogenic variants"
Same invocation with Docker (bind-mount the VCF directory):
docker run --rm --env-file .env -v "$PWD/data:/work" \
mhspl/aiva-agent:latest \
--vcf /work/sample.vcf.gz --prompt "List pathogenic variants"
The same image also serves the browser UI — see Web UI → With Docker.
Web UI
A local browser chat for the same agent — useful when you want to drag-and-drop VCFs, browse multiple chats side-by-side, and read structured tabular results inline instead of as TSV in a terminal. Everything still runs on your machine; no data leaves the host.
Install
The web UI is part of the base install (pip install aiva-agent); there is no separate extra any more.
Run
Point the server at the directory that holds your VCFs / BAMs:
aiva_agent_serve --workdir ./data
Open http://127.0.0.1:8765 in a browser. Then + New chat → pick one or more VCF (and optional BAM) files from --workdir, give it a name, and ask questions.
Make sure to set AIVA_WORKDIR environment variable to the directory that holds your VCFs / BAMs.
Remote VCFs (cloud buckets). VCFs can live in object storage instead of --workdir. Two options:
- Query in place — in the Attach dialog, paste a remote URL (
gs://…,s3://…,https://…) into the "remote VCF URL" field (or pass--vcf gs://…on the CLI). The.tbi/.csiindex must sit next to the file in the bucket, and cloud credentials must be in the server's environment (GCS_OAUTH_TOKENfor GCS — refreshed hourly; the standard AWS chain for S3). No mount required. - Mount the bucket as
--workdir— FUSE-mount the bucket (gcsfuse / mount-s3 / s3fs) at a local path and pass it as--workdir; the picker then lists the bucket's files like any local folder. In this mode you must set--state-dirto local disk, since the.aivaDB can't live on the mount.
With Docker. The published image includes the server, available by overriding the entrypoint. Bind 0.0.0.0 so the container is reachable from the host, publish the port, and let your .env supply the model credentials:
docker run --rm --env-file .env -p 8765:8765 -v "$PWD/data:/work" \
-e AIVA_HOST=0.0.0.0 \
--entrypoint aiva_agent_serve \
mhspl/aiva-agent:latest --workdir /work
Then open http://127.0.0.1:8765. The default entrypoint stays the CLI, so the same image runs either mode — see Quickstart → Run for the CLI form.
The server answers only to localhost/127.0.0.1 and its own --host address. To open it from another machine or through a proxy, add the name or address you browse to with -e AIVA_ALLOWED_HOSTS=aiva.lab.example (the UI has no login, so only do this on a trusted network).
What's different from the CLI
- Per-workdir history. Conversation history lives at
<workdir>/.aiva/aiva.db, so switching workdirs gives you a clean session namespace and you can keep one history per dataset. - Multi-session. Each chat is its own session with its own VCF/BAM bindings — useful for keeping cases separate.
Examples
For an end-to-end walkthrough in a notebook, see the example analysis on Colab:
CLI one-liners:
# All tools are on by default — pass --disable vcf for prompts that don't need
# a local VCF, or set AIVA_DISABLE / AIVA_VCF in .env to make it permanent.
# Variant annotation
aiva_agent --disable vcf --model gpt-6.1-sol \
--prompt "Annotate rs113488022. Report ClinVar significance and population AF."
# Literature search
aiva_agent --disable vcf --model gpt-6.1-sol \
--prompt "Find 3 recent papers on TP53 R175H in lung cancer."
# Clinical trials
aiva_agent --disable vcf --model gpt-6.1-sol \
--prompt "Find phase 2 recruiting BRAF V600E melanoma trials."
# HPO -> genes
aiva_agent --disable vcf --model gpt-6.1-sol \
--prompt "Rank candidate genes for HP:0001250 + HP:0001263."
# Web search + scrape (handles PDFs; WEB_API_KEY raises the limits)
aiva_agent --disable vcf --model gpt-6.1-sol \
--prompt "Find and scrape the latest NCCN melanoma guideline summary."
# ACMG/AMP classification — `classify` subcommand prints JSON (rs113488022 = BRAF V600E)
aiva_agent classify --type amp --assembly GRCh38 \
--rsid rs113488022 --phenotype melanoma
# VCF query + literature (vcf tool turns on automatically once a path is provided)
aiva_agent --vcf data/test.vcf.gz --model gpt-6.1-sol \
--prompt "Find any TP53 variants and pull supporting literature."
Notebook usage
Set env vars in one cell, call aiva_agent(...) in the next; calls within the same kernel automatically share a session, so follow-up questions remember the prior turn.
# cell 1
import os
os.environ["LLM_API_KEY"] = "sk-..."
os.environ["LLM_BASE_URL"] = "https://api.openai.com/v1"
os.environ["LLM_MODEL"] = "gpt-6.1-sol"
os.environ["AIVA_VCF"] = "data/sample.vcf.gz"
# cell 2
from aiva_agent import aiva_agent
print(aiva_agent("List 3 likely-pathogenic variants from vcf."))
print(aiva_agent("Of those, which is in a recessive disease gene?")) # remembers
For every keyword argument, run help(aiva_agent) (or ?aiva_agent in Jupyter). To start a fresh conversation mid-notebook, call reset_session(). To pin a specific ID (e.g. resume across kernel restarts), set AIVA_SESSION_ID in env or pass session_id="my-case" to aiva_agent. Per-call kwargs vcf=, bam=, disable=, model=, base_url=, api_key=, workdir=, state_dir= override the corresponding env vars; stream=True prints tool calls and the answer as they come.
Classify a single variant (for embedding / integrations)
To run just ACMG/AMP classification on one variant — without the conversational agent — call classify(...). It returns the classification as a dict, so other tools can consume it directly.
import asyncio
from aiva_agent import classify
result = asyncio.run(classify(
{"hgvs": "NM_004333.6:c.1799T>A"}, # required: or {"rsid": ...} or {"chrom","pos","ref","alt"}
classification_type="acmg", # required: "acmg" (germline, ACMG/AMP 2015) or "amp" (somatic, AMP/ASCO/CAP 2017)
assembly="GRCh38", # required: "GRCh37" or "GRCh38"
phenotype_terms="melanoma", # optional: disease / phenotype context, e.g. "hereditary breast cancer"
description="42yo, family history of breast cancer", # optional: free-text sample/patient context
additional_context="de novo, confirmed by trio sequencing; heterozygous", # optional: verified clinical context (de novo status, zygosity, segregation, family history); criteria are applied strictly to what's stated here
workdir="./data", # optional: scopes the classifier's shell access (default: current directory). It gets the same tools as the agent, including shell access for evidence gathering, so pass a path to sandbox it
model="gpt-6.1-sol", # optional, falls back to LLM_MODEL
base_url="https://api.openai.com/v1", # optional, falls back to LLM_BASE_URL
api_key="sk-...", # optional, falls back to LLM_API_KEY
))
print(result["classification"], result.get("criteria_met"))
The result is schema-validated through structured output, so it's always a well-formed dict: for acmg it contains input_issue, classification, confidence, acmg_score, criteria_met, evidence_summary (an entry per ACMG criterion), classification_rationale, and sources; for amp it contains input_issue, classification, confidence, criteria_met, evidence_summary, therapeutic_summary, diagnostic_summary, prognostic_summary, and sources. When the variant can't be verified as given (Ensembl rejects it, or no source has a record), classification is "Not classified" and input_issue says why; otherwise input_issue is empty. (Structured output requires a provider that supports it: OpenAI, Anthropic, and OpenAI-compatible endpoints with json_schema response format.)
The same is available from the command line via the classify subcommand, which prints the JSON result to stdout:
aiva_agent classify --type acmg --assembly GRCh38 \
--hgvs "NM_004333.6:c.1799T>A" --phenotype melanoma
Specify the variant with --hgvs, --rsid, or all of --chrom/--pos/--ref/--alt. Optional flags mirror the Python kwargs: --description, --context (verified clinical context; maps to additional_context), --workdir (scopes the classifier's bash tool), and --model/--base-url/--api-key (fall back to the LLM_* env vars).
Running on HPC / older glibc
If your host has glibc < 2.28 (typical on CentOS/RHEL 7-era HPC nodes), the wheel's compiled binaries won't load; use the container image instead. The image (mhspl/aiva-agent:latest) ships with the right binaries pre-baked. Apptainer/Singularity can pull it directly:
apptainer pull aiva-agent.sif docker://mhspl/aiva-agent:latest
apptainer exec --bind "$PWD:/work" aiva-agent.sif \
aiva_agent --vcf /work/sample.vcf.gz --prompt "..."
Submit the job on a node that satisfies the Outbound HTTPS prerequisite — the container doesn't change network requirements.
License
aiva-agent is licensed under the PolyForm Noncommercial License 1.0.0.
- Free for noncommercial use — personal use, academic research, education, and use by charitable, public-research, public-health, and government institutions.
- Commercial use requires a separate license. Contact tarun@mamidi.ai for commercial licensing terms.
Metadata
Release files for aiva-agent 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| aiva_agent-1.0.1-cp310-abi3-manylinux_2_28_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ x86-64 | Details for aiva_agent-1.0.1-cp310-abi3-manylinux_2_28_x86_64.whl |
| aiva_agent-1.0.1-cp310-abi3-manylinux_2_28_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.28+ ARM64 | Details for aiva_agent-1.0.1-cp310-abi3-manylinux_2_28_aarch64.whl |
| aiva_agent-1.0.1-cp310-abi3-macosx_11_0_x86_64.whl | CPython 3.10 | abi3 | macOS 11.0+ x86-64 | Details for aiva_agent-1.0.1-cp310-abi3-macosx_11_0_x86_64.whl |
| aiva_agent-1.0.1-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details for aiva_agent-1.0.1-cp310-abi3-macosx_11_0_arm64.whl |
Total release size: 111.9 MB
Release files / aiva_agent-1.0.1-cp310-abi3-manylinux_2_28_x86_64.whl
| Download URL | aiva_agent-1.0.1-cp310-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 30.5 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
e3fe0a49b69a3a607297cd692ca4258f361dc8381f3b3973a0d0677cd97806e0
|
|
BLAKE2b-256 checksum How to use checksums |
1a82e153aa795477be381a9a1a2a597c91cda0c27fa971ac1c43a2b9d8f9b331
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / aiva_agent-1.0.1-cp310-abi3-manylinux_2_28_aarch64.whl
| Download URL | aiva_agent-1.0.1-cp310-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 27.9 MB |
| Tags | CPython 3.10 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
4777bd773db3fb1ba4a8fed1e4c76e7386b3d9af424b9daab5e08377e1df7495
|
|
BLAKE2b-256 checksum How to use checksums |
2e4bfe3cdea26a932afbf6a52d8d824221bea7b68bb3d32f0045d455cc3d091b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / aiva_agent-1.0.1-cp310-abi3-macosx_11_0_x86_64.whl
| Download URL | aiva_agent-1.0.1-cp310-abi3-macosx_11_0_x86_64.whl |
|---|---|
| Size | 27.5 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
8f62d70da4b992c8ff4c0fbfee7c699dc8b2f1f8a46c3157ee92b989924301f0
|
|
BLAKE2b-256 checksum How to use checksums |
60a13847c6323891b231b01d79342783731ce419c3a3f101aed580a344306ba7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logRelease files / aiva_agent-1.0.1-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | aiva_agent-1.0.1-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 26.0 MB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
3a0930127374ebae0c07481a1184d18bc2792185b2c2ede1ab4dcaf99925e40c
|
|
BLAKE2b-256 checksum How to use checksums |
bc7957f80e7a5ce8504258c7f1603f9ea4fea237480496ce799cd9b5700b84e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logSecurity for aiva-agent 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 4 files in this release have been uploaded with provenance metadata.
Attestation for aiva_agent-1.0.1-cp310-abi3-manylinux_2_28_x86_64.whl
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.