RNA Lab Navigator

Retrieval-augmented research assistant for literature triage in a wet-dry lab

Django React Weaviate BM25 OpenAI GPT-4o Docker RAG
A query (green) and the passages that best match its keywords among the lab’s indexed documents

Laboratory Knowledge Management

RNA Lab Navigator is a retrieval-augmented question-answering app built for an RNA biology lab, where much of what the lab knows is spread across theses, papers, protocols and experimental notes. It was deployed for the lab on the institute network in July 2025.

Questions in plain English go to keyword (BM25) retrieval over a Weaviate index, with an LLM (OpenAI GPT-4o in the lab's code) answering from the top passages; the source documents are listed under each answer. When none of the passages is relevant, the prompt allows a general-knowledge answer that says it is not from the documents.

The demo version, built on 30 openly licensed documents, was tested on 60 questions written in advance: for 45 of the 50 it should answer, the right paper was in the top five search results, and it declined all 10 that its documents don't cover. Answers come back in under ten seconds.

RNA Lab Navigator answering three questions from the lab's papers, with citations, and saying what its documents don't cover.

Question Answering

Plain-English questions answered from the best-matching passages, with up to 3 source documents listed

Sign-in

Sign-in (JWT) for the app's pages, with accounts created by an admin or PI; served only on the institute network in 2025

Lab Document Corpus

PhD theses and papers, split into overlapping passages and indexed for keyword search

Technical Architecture

A React frontend and a Django REST backend, with Weaviate as the document index and Redis as the cache. In the July 2025 local deployment they ran in Docker containers. The details on this page are from the lab's code as of June 2025.

Frontend (React)

  • React 18 single-page app in JavaScript (JSX), built with Vite
  • Tailwind CSS with Headless UI components and Heroicons, and a dark mode
  • Sign-in state and display settings held in React context
  • Each question is one REST request to the backend, answered with one JSON reply

Backend (Django + DRF)

  • Django 4.2 with Django REST Framework
  • JWT sign-in (Simple JWT), with refresh tokens rotated and blacklisted on the server
  • Redis cache: an identical question asked again within an hour is answered from the cache

Retrieval and Answering

  • Weaviate index of the documents' passages, each with its title, author and year
  • Keyword (BM25) search over each passage's text, title and author
  • The 4 best-matching passages, up to 10,000 characters, go into the prompt
  • OpenAI GPT-4o writes the answer from them, capped at 500 tokens
  • Each answer lists up to 3 source documents (title, author, year)

Infrastructure

  • Docker containers on a MacBook, served on the institute network (July 2025)
  • Security and error logging, with each request's response time stored in the app's database

RAG Implementation

The documents are split into passages and indexed once. For each question, passages are retrieved by keyword, and the model answers from them.

1. Document Ingestion

Text extracted from the lab's PDF theses and papers

2. Chunking

400-word passages overlapping by 100 words; theses split by chapter first

3. Indexing

Each passage stored in Weaviate with its document's title, author and year

4. Keyword Retrieval

BM25 search over each passage's text, title and author; the top 4 go to the model

5. Answer

The model answers from those passages, and the app lists up to 3 of their source documents

Access

The app's pages ask lab members to sign in (JWT); accounts are created by an admin or PI, with no self-registration. In 2025 the app was served only on the institute network.

Authentication

  • JWT access tokens that expire after 15 minutes
  • Refresh tokens rotated and blacklisted on the server
  • Brute-force protection (django-axes): a one-hour lockout after 5 failed sign-ins

Network Access

  • Served on the institute network
  • Accounts given to lab members

Deployment Challenges & Solutions

Hosting was tried on several platforms before the app was deployed locally on the institute network.

Platform Evaluation

Evaluated Railway, Render, PythonAnywhere, and Vercel for hosting, each presenting unique constraints.

CORS Configuration

During the hosting trials the frontend ran on Vercel, on a different origin from the backend API, so the backend had to accept cross-origin requests. Its CORS settings allowed the Vercel frontend's address and the local development servers; every origin was allowed only in debug mode.

Performance Optimization

Repeated questions were answered from a one-hour Redis cache, and the prompt was kept small: the 4 best-matching passages (down from 5), at most 10,000 characters. Answers were capped at 500 tokens.

Local Deployment

Deployed in July 2025 in Docker containers on a MacBook on the institute network, serving 25 documents (7 PhD theses, 18 papers) to lab members at an institute IP address.

Platform Capabilities

Document Management

  • PDF theses and papers, split into passages and indexed
  • Title (by default the file name), author and year recorded for each document
  • Each document tagged by type (thesis, paper, protocol)

Search

  • Questions in plain English, matched by keyword (BM25)
  • Author names and titles searched along with the text

Shared Use

  • One document index for the whole lab

Real-World Applications

Literature Review

Lab members can query the indexed papers and theses in plain English. Each answer lists up to 3 source documents (title, author, year) from the passages the model was given.

Finding Methods

Lab members can ask how a method was done in the indexed theses and papers, and the answer lists up to 3 of the documents its passages came from.

Thesis Knowledge Preservation

Theses hold much of what a lab learns, and that knowledge is easily lost after graduation. The lab's PhD theses are indexed chapter by chapter, so later students can ask questions of earlier students' work.

Technical Achievements

Performance Optimization

An identical question asked within an hour is answered from a Redis cache, and the prompt carries only the 4 best-matching passages.

Sign-in

JWT sign-in for the app's pages, with refresh-token rotation, brute-force protection (django-axes) and accounts created by an admin or PI.

Lab Deployment

Deployed for the lab on the institute network in July 2025.

Engineering Insights

Deployment Platform Selection

Free tier limitations significantly impact architecture decisions. Evaluating multiple platforms (Railway, Render, PythonAnywhere) taught valuable lessons about balancing cost, features, and performance requirements.

RAG System Optimization

The app sends the model the 4 best-matching passages, down from 5, to cut response time.

Next Steps

Planned changes to the demo version, each measured on the 60-question test set.

Hybrid Retrieval

Keyword (BM25) search combined with embeddings from an embedding model that runs locally

Declining When Unsupported

Done: Answers only from the retrieved passages, declining when they do not support an answer

Statement-Level Citations

Each citation tied to the statement it supports

Model Comparison

Language models compared on the same pipeline

Project Impact

Deployment

Deployed for the lab on the institute network in July 2025

Knowledge Preserved

25 documents (7 PhD theses, 18 papers) indexed at the July 2025 local deployment

Interested in AI-Powered Research Tools?

Whether you're interested in implementing similar solutions for your laboratory, discussing technical architecture, or exploring collaboration opportunities, I'd love to connect.