Biolab is a small, local-first research workspace for finding papers, saving evidence, parsing selected papers, and asking questions over a paper-specific RAG index.
It keeps source responses, retrieval IDs, parser blocks, citations, and review decisions so results can be inspected later. It is a research tool, not medical advice or proof that a scientific claim is true.
Live demo: biolab-a2a.vercel.app
- Python 3.11+, Starlette, Typer, and MCP
- SQLite/libSQL for local project and provenance data
- Neon Postgres with
pgvectorfor hosted RAG vectors - NVIDIA NIM hosted embeddings (
nemotron-3.5-embed-1b) with a free offline fallback - PubMed, bioRxiv, medRxiv, and ClinicalTrials.gov connectors
- Vercel serverless deployment
- Search PubMed and other life-science sources.
- Create a project and select papers for it.
- Parse a selected paper into page-aware blocks.
- Review blocks and index accepted blocks in pgvector.
- Search the project RAG and save notes with citations.
- Download the full open-access paper, one answer with its sources, or the parsed passages as JSON.
- Audit the selected project's hash-chained history.
The browser has two main pages:
/— search, ranked results, paper selection, and project creation./projects/<project_id>— one project’s papers, parsing and review, questions and notes, knowledge graph, history, and downloads.
Requirements: Python 3.11+ and Git.
git clone https://github.com/srikarjy/biolab-mcp-server.git
cd biolab-mcp-server
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"Start the dashboard and REST API:
biolab webOpen http://127.0.0.1:8000.
Start the MCP server instead:
python -m biolab.serverThe MCP endpoint is http://127.0.0.1:8000/mcp.
For ChatGPT, Claude, and other research-client connection instructions, see External AI integrations.
Search for papers:
biolab search "BRCA1 pancreatic cancer" --max 5Or search on the main page, select papers, and create a project. The project page then lets you parse them, review passages, ask questions, save notes, and download papers, answers, or parsed passages.
Useful REST routes:
POST /v1/evidence/search
POST /v1/projects
GET /v1/projects/{project_id}/report
POST /v1/projects/{project_id}/retrievals
POST /v1/projects/{project_id}/retrievals/{retrieval_id}/parse
GET /v1/projects/{project_id}/parser-runs
POST /v1/projects/{project_id}/rag/search
GET /v1/projects/{project_id}/audit
GET /v1/parser/runs/{parser_run_id}/download
POST /v1/projects/{project_id}/rag/notes
The download route returns an attachment such as paper.parsed.json. It
contains parsed blocks and metadata. The original PDF is not retained by the
parser endpoint.
The main page searches, ranks the results, and lets you select papers from the ranked list. Name a new project (or pick an existing one) and the selected papers appear on its project page. There you can parse them, review their blocks, accept only useful blocks for RAG, and query the resulting paper-specific index.
The project page stores exact questions and successful RAG results in a small
project-scoped cache. Repeating the same question with the same sections and
result limit returns the cached evidence and is marked cached: true.
Ranking review states, saving reviewed candidates and grounded insights are available through the REST API and MCP tools, not the web pages.
The architecture is:
MCP/source connectors -> retrieval ledger -> project selection
-> parser blocks -> human review -> NVIDIA embeddings
-> Neon pgvector -> similarity search -> cached cited passages/notes
ChatGPT does not permanently learn the papers. When connected to this MCP server, it can call the exposed tools, retrieve the selected project's evidence, and receive the cited passages. The project database and audit history preserve what was queried and used for later review.
The free path runs embeddings on your computer with BGE-small. It does not need an OpenAI, DeepSeek, or paid embedding key.
Install the optional packages:
pip install -e ".[pgvector,local-embeddings]"Start local pgvector:
export POSTGRES_PASSWORD=localtest
docker compose -f docker-compose.rag.yml up -dEnable local embeddings:
export BIOLAB_LOCAL_EMBEDDINGS=1
export BIOLAB_LOCAL_EMBEDDING_MODEL=BAAI/bge-small-en-v1.5
export BIOLAB_EMBEDDING_DIMENSION=384
export PGVECTOR_DATABASE_URL=postgresql://biolab:localtest@127.0.0.1:54329/biolabRun the vector integration test:
BIOLAB_PGVECTOR_INTEGRATION=1 \
pytest tests/test_rag_pgvector.py -m integration -vStop the local database when finished:
docker compose -f docker-compose.rag.yml downOnly blocks marked accepted are added to the project index. Search is scoped
to the selected project and can be filtered by sections such as methods or
results.
The hosted demo can use biolab-feature-hash-v1, a deterministic lexical
baseline that requires no model download or API key. Set
BIOLAB_FREE_EMBEDDINGS=1 with PGVECTOR_DATABASE_URL. This is for workflow
demonstrations, not a validated scientific embedding model. For better local
semantic retrieval, use BGE-small as shown above.
To use Baidu's 384-dimensional Embedding-V1 model, set the API key in the
deployment environment. The client batches requests in groups of 16 to match
Qianfan's documented limit:
export BIOLAB_EMBEDDING_PROVIDER=baidu
export BAIDU_QIANFAN_API_KEY="your-qianfan-api-key"
export BAIDU_QIANFAN_EMBEDDING_MODEL=embedding-v1
export BIOLAB_EMBEDDING_DIMENSION=384After switching providers, rebuild the project indexes; vectors from different embedding models must not be mixed. Keep the key out of Git and browser code.
NVIDIA's free Build endpoint supports nvidia/nemotron-3.5-embed-1b for
multilingual text and document retrieval. The hosted model returns normalized
2048-dimensional vectors through an OpenAI-compatible endpoint:
export BIOLAB_EMBEDDING_PROVIDER=nvidia
export NVIDIA_API_KEY="your-build-nvidia-key"
export NVIDIA_EMBEDDING_MODEL=nvidia/nemotron-3.5-embed-1b
export NVIDIA_EMBEDDING_DIMENSION=2048After switching from another provider, rebuild the project indexes. NVIDIA lists this as a free endpoint, but access is still subject to its API trial terms and quotas.
If the NVIDIA key is not configured, the hosted demo uses the deterministic feature-hash fallback so the complete project workflow remains demonstrable.
The server exposes 65 MCP tools. The offline suite (-m "not live and not benchmark", as in CI) has 292 passing tests and 3 skipped.
Run the normal test suite:
pytest -qRun the RAG-focused tests:
pytest tests/test_rag.py tests/test_document_parser.py tests/test_inference.py tests/test_web.py -qRun checks used by CI:
ruff check app.py biolab tests
mypy biolabLocal data is stored in biolab.db by default. Hosted and standalone APIs
require authentication by default. Anonymous access is only for an explicit,
isolated demo:
biolab web --allow-anonymousThe retrieval log is hash-chained for tamper evidence. It is not an immutable ledger and does not replace backups, access control, or scientific review.
Each project page also has a History tab with Verify project audit. It verifies and displays project events such as paper selection, parsing, parser review, RAG queries, index rebuilds, and saved notes.
To detect truncation or rewriting across a backup, create a signed checkpoint with a secret that is not stored in the database:
export BIOLAB_ANCHOR_KEY="$(openssl rand -hex 32)"
biolab anchor retrievals.anchor.json --chain retrievals
biolab verify-anchor retrievals.anchor.json --chain retrievalsKeep the anchor file and BIOLAB_ANCHOR_KEY in separate protected storage. A
valid chain means the stored records are internally consistent; it does not
prove that a paper is scientifically correct.
For production deployments, configure a durable database and keep API keys in the deployment environment. Never commit credentials to this repository.