Inspiration

Modern proteomics researchers face an overwhelming volume of scientific literature and structured database records when studying proteins, post-translational modifications (PTMs), and cellular functions. While centralised databases like UniProt provide massive tables of annotations, querying specific functional details, active sites, or disease associations requires tedious manual navigation.

To bridge this gap, we built a domain-specific, highly reliable AI knowledge assistant. The goal was simple: enable natural language queries over protein annotation databases, while maintaining absolute biological correctness, preventing model hallucinations, and providing direct clickable references to UniProt entries and AlphaFold 3D structure predictions.

How we built it

We developed a complete retrieval-augmented generation (RAG) system running entirely on CPU and fully compatible with Google Colab. The pipeline consists of the following components:

  1. Data Ingestion: A programmatic interface fetching detailed, reviewed human kinase data from the official UniProt REST API.
  2. Custom Hybrid Search: Standard dense semantic vector search (e.g., using FAISS) frequently fails when dealing with short biological acronyms (like TTK or CLK3), leading to semantic dilution. To overcome this, we built a custom hybrid search engine that extracts exact gene keywords from queries and merges them with FAISS vector distances.
  3. Factual Grounding & Generation: We utilised the flagship Qwen-2.5-72B-Instruct model via Hugging Face's serverless router. The prompt system is heavily guarded with strict rules (temperature 0.1), ensuring the model responds only when the facts exist in the retrieved context, falling back to a safe "I do not have data on this" is the response if not.
  4. Interactive Dashboard: Designed a modern scientific UI using Gradio, which features pre-populated sample queries, direct formatted citations, and an expandable Grounding Audit Log showing FAISS database matches for total researcher auditability.

Challenges we faced

  1. Biological Acronym Dilution: Standard dense vector embeddings (all-MiniLM-L6-v2) struggled to distinguish short acronyms (e.g., "TTK" vs "TNK1" or "CSK"). We solved this by implementing a fast keyword-matching pre-filter before calling the dense retrieval.
  2. API Access Constraints: Official enterprise API gateways were restricted or required complex billing integrations. We bypassed this successfully by utilising the Hugging Face Serverless Inference API and fine-tuning the token's permission scope to directly query Qwen-2.5.
  3. Annotation Variability: UniProt's JSON responses can vary wildly in structure depending on whether a protein has specific disease associations or notes. We engineered a defensive type-checking parser in Python to prevent runtime parsing crashes.

What we learned

We learned that RAG pipelines for scientific or clinical purposes cannot rely on "black-box" vector databases alone. Exact keyword matching is critical when handling acronyms. Additionally, we proved that massive open-weights models like Qwen-2.5-72B can deliver incredibly fast, grounded, and referenced summaries when fed structured markdown inputs, making advanced AI highly accessible on completely free, CPU-only platforms.

Built With

  • alphafold
  • bioinformatics
  • embeddings
  • faiss
  • google-colab
  • gradio
  • huggingface-api
  • llm
  • python
  • qwen-2.5
  • rag
  • sentence-transformers
  • uniprot-api
  • vector-database
Share this project:

Updates