An AI agent that autonomously designs new molecules and chemical synthesis pathways. Chem-Agent leverages a knowledge graph of chemical properties and reaction mechanisms to propose novel compounds for drug discovery, material science, and other chemical applications.
- Autonomous Molecule Design: The Molecule Design Agent generates novel chemical structures based on specified properties and objectives.
- Reaction Pathway Prediction: The Reaction Prediction Agent analyzes a knowledge graph of chemical reactions to propose viable synthesis pathways.
- Chemical Simulation: The Simulation Agent models the properties and behaviors of proposed molecules and reactions, validating their feasibility.
- Graph-based Analysis: Utilizes GATv2 to analyze complex molecular graphs, understanding the relationships between atoms and bonds.
- Specialized Chemical Intelligence: Employs a massive language model fine-tuned on chemical literature, providing expert-level knowledge of chemical concepts and reactions.
- Framework: Next.js 15 (App Router) β Chosen for its Server-Side Rendering (SSR) capabilities, which are vital for rendering complex chemical data and SEO.
- Language: TypeScript β Ensures strict type safety between your UI and the chemical data structures.
- Styling: Tailwind CSS + Shadcn UI β For a high-end, responsive "Laboratory Dashboard" aesthetic.
- Molecular Visualization: RDKit.js (MinimalLib) β Used for high-fidelity 2D rendering of SMILES directly in the browser.
- State Management: TanStack Query (React Query) β Manages the asynchronous states of your AI agentβs "thinking" process.
- Protocol: tRPC β Provides End-to-End Type Safety. When your Python model defines a new property (e.g.,
toxicity_score), tRPC ensures your Frontend knows exactly what that data looks like without manual API documentation. - Validation: Zod β Used to validate chemical strings (SMILES) and agent parameters at the schema level before they hit your database.
- Runtime: Node.js (Express) β Acts as the "Brain's Secretary," handling user authentication, request routing, and job queuing.
- Database: MongoDB (via Mongoose) β A NoSQL document store ideal for chemical data, where molecular properties and reaction pathways can vary significantly in structure.
- AI Bridge: Axios / Fetch β Used by Express to communicate with the internal Python FastAPI service.
- Framework: FastAPI (Python 3.10+) β A high-performance Python framework designed to serve machine learning models with minimal latency.
- Graph Model: PyTorch Geometric (GATv2) β The core Graph Attention Network that analyzes molecular structures as nodes (atoms) and edges (bonds).
- Cheminformatics: RDKit (Python) β The gold standard for chemical informatics; used for featurizing molecules, calculating molecular weight, and validating chemical valence.
- LLM Integration: OpenAI API / LangChain β Orchestrates the Large Language Model to provide "Agentic Reasoning" and synthesis summaries.
- Containerization: Docker & Docker Compose β Essential for packaging the RDKit C++ dependencies and PyTorch environment so they run anywhere.
- CI/CD: GitHub Actions β Automatically runs your Python unit tests and Next.js builds on every push to
saadsalmanakram/Chem-Agent. - Environment: Python Virtual Environments (venv) β Keeps your AI dependencies isolated from the rest of the system.
- Node.js (for Next.js)
- Python 3.10+ (for backend models)
- Clone the repository:
git clone https://github.com/saadsalmanakram/Chem-Agent.git cd Chem-Agent - Set up the frontend and backend:
Follow the instructions in the
frontend/andbackend/directories to install dependencies and configure the agent services.
Create a .env file to store your API keys and model credentials.
Run the Next.js server and backend services to begin designing molecules and chemical synthesis pathways.
Chem-Agent/
βββ .github/
β βββ workflows/
β βββ main.yml # CI/CD (Node + Python testing)
βββ apps/
β βββ web/ # Frontend (Next.js + Tailwind)
β β βββ src/
β β β βββ app/ # App Router (Pages & Layouts)
β β β βββ components/ # MoleculeViewer, AgentLog, MoleculeCanvas
β β β βββ hooks/ # Custom React hooks for tRPC
β β β βββ utils/ # trpc.ts (Client setup)
β β β βββ types/ # Frontend-specific TS interfaces
β β βββ public/ # Static assets
β β βββ next.config.js
β β βββ tailwind.config.js
β βββ server/ # Backend (Express + tRPC Server)
β βββ src/
β β βββ models/ # MongoDB Schemas (Molecule.ts)
β β βββ trpc/ # Router definitions & procedures
β β βββ services/ # pythonBridge.ts (Communicates with AI API)
β β βββ index.ts # Server entry point
β βββ package.json
β βββ tsconfig.json
βββ services/
β βββ ai-engine/ # Python AI Engine (FastAPI)
β βββ data/ # Training datasets (CSV/SMILES)
β βββ models/ # gatv2.py (Graph Neural Network)
β βββ utils/
β β βββ data_loader.py # RDKit featurization logic
β β βββ llm_wrapper.py # Chemical Intelligence prompt logic
β βββ main.py # FastAPI entry (The "Agent" API)
β βββ train.py # Script to train GATv2
β βββ requirements.txt # Python dependencies
βββ .env.example # Template for API keys & DB URIs
βββ docker-compose.yml # Multi-container orchestration
βββ README.md