Skip to content

emapco/chem-mrl-demo

Repository files navigation

Chem-MRL Demo

A web application for demoing Chem-MRL model with similarity search capabilities.

Features

  • 🧪 Interactive Molecule Editor: Draw molecules using ChemWriter editor
  • 🤖 AI-Powered Embeddings: Generate molecular embeddings using ChemMRL
  • 🔍 Similarity Search: Find similar molecules using Redis hierarchical navigable small world (HNSW) algorithm

Quick Start

Using Docker (Recommended)

git clone https://github.com/emapco/chem-mrl-demo.git
cd chem-mrl-demo
docker compose up

Manual Setup

  1. Install Dependencies
pip install -r requirements.txt
  1. Start Redis
redis-server
  1. Start App
python app.py

Access Application

Navigate to http://localhost:7860

Architecture

graph TD
    A[ChemWriter Editor<br/>Frontend] <--> B[Gradio API<br/>Backend]
    B <--> C[Chem-MRL<br/>HF Model]
    B <--> D[Redis + HNSW<br/>Vector DB]
    D --> E[Similar Molecules<br/>Results]
    E --> B
    
    %% Styling
    classDef frontend fill:#e1f5fe
    classDef backend fill:#f3e5f5
    classDef model fill:#e8f5e8
    classDef database fill:#fff3e0
    classDef results fill:#fce4ec
    
    class A frontend
    class B backend
    class C model
    class D database
    class E results
Loading

Configuration

Environment variables in .env:

  • REDIS_HOST
  • REDIS_PORT
  • REDIS_PASSWORD

Visualization Data

The visualization directory contains embeddings of the Isomer Design SMILES dataset (License: CC BY-NC-SA 4.0), with various embedding sizes. The .tsv files can be visualized using TensorFlow Projector or viewed directly using the links below.

Embedding Dimension URL
1024 1024 embeddings
512 512 embeddings
128 128 embeddings
32 32 embeddings
4 4 embeddings
2 2 embeddings

License

Apache-2.0 license

Releases

No releases published

Packages

No packages published