A powerful visual experiment builder powered by AI. Create complex scientific experiments using drag-and-drop components, connect them together, and let AI analyze and predict the outcomes!
π¨ Visual Canvas: Drag-and-drop interface for building experiments (like Microsoft Paint meets n8n)
- Infinite canvas with pan and zoom
- Grid background for precision
- Minimap for navigation
- Multi-select and delete (press Delete key)
π 1000+ Components: Extensive library across multiple categories:
- β‘ Electronics (300+ components): Resistors, capacitors, transistors, ICs, sensors, displays
- βοΈ Chemicals (200+ components): Elements, acids, bases, organic compounds, lab equipment
- βοΈ Physics (250+ components): Mechanics, forces, optics, waves
- π‘οΈ Thermodynamics: Heat sources, insulators, conductors, gases
- π» Coding (200+ components): Logic blocks, arithmetic, control flow, variables
- π Mathematics (150+ components): Functions, statistics, trigonometry
- π§« Biology (100+ components): Cells, biomolecules, DNA
- βοΈ Quantum (50+ components): Qubits, quantum gates
π Node Connections: Connect components with animated flow lines
- Visual connections from outputs (green) to inputs (blue)
- Click connections to add labels/conditions
- Animated flow visualization
βοΈ Editable Components:
- Double-click any component to customize its label
- Edit component text inline
- Customize experiment descriptions
π¬ Example Experiments: Pre-built experiments to get started quickly
- Simple LED Circuit (Electronics)
- Acid-Base Neutralization (Chemistry)
- Simple Pendulum (Physics)
- Conditional Logic Flow (Coding)
π₯ Import/Export:
- Export experiments as JSON
- Import previously saved experiments
- Share experiments with others
π€ Google Gemini Integration:
- Analyze your experiment setup
- Predict outcomes and results
- Provide step-by-step explanations
- Calculate numerical results
- Generate detailed reports
π― Welcome Guide: First-time users see an interactive tutorial πΎ Local Storage: API key saved securely in browser π¨ Modern UI: Clean, intuitive interface with helpful tooltips β¨οΈ Keyboard Shortcuts: Delete key to remove components
- Node.js 18+ and npm
- Google Gemini API Key (Get one here)
- Navigate to the aiexp folder:
cd aiexp- Install dependencies:
npm install- Start the development server:
npm run dev- Open your browser to
http://localhost:3000
- Visit Google AI Studio
- Sign in with your Google account
- Click "Create API Key"
- Copy the API key
- In the app, click the "API Key" button and paste your key
- On first launch, you'll see a Welcome Modal with instructions
- Click "API Key" button and enter your Google Gemini API key
- Your API key is saved securely in browser local storage
- Try loading an Example Experiment to see how it works!
-
Browse Components: Use the left sidebar to browse 1000+ components
- π Search for specific components
- π·οΈ Filter by category (Electronics, Chemicals, Physics, etc.)
- π See component count for each category
-
Add Components: Drag components from the library onto the canvas
- Components appear with icons and labels
- Each component shows its category badge
-
Connect Components: Click and drag from output (green dot) to input (blue dot)
- Connections are animated for visual feedback
- Click any connection to add a label/condition
-
Edit Labels: Double-click any component to edit its text
- Type new text and press Enter or click outside
- Customize component descriptions
-
Load Examples: Click "Examples" button to load pre-built experiments
- Choose from 4 example experiments
- Learn from working examples
-
Run Analysis: Click "Run Experiment" button to analyze with AI
- Results appear in the right panel
- Get detailed explanations and predictions
-
Export/Import:
- Click "Export" to download experiment as JSON
- Click "Import" to load a saved experiment
- Share experiments with others
-
Clear Canvas: Click "Clear" to start fresh
- Confirmation dialog prevents accidental deletion
- Add a "Power Source 5V USB"
- Add a "Resistor 220Ξ©"
- Add a "LED Red"
- Connect them in series
- Run analysis to see the predicted behavior
- Add "Hydrochloric (HCl)" acid
- Add "Sodium Hydroxide (NaOH)" base
- Add a "Beaker 250ml"
- Connect the components
- Run analysis to predict the neutralization reaction
- Add "Mass 1kg"
- Add "Spring k=100"
- Add "Force 10N"
- Connect them to simulate spring mechanics
- Run analysis to calculate displacement and oscillation
- Add "Variable Number"
- Add "Compare Greater >"
- Add "If Statement"
- Add "Math Add"
- Connect to create a conditional flow
- Run analysis to trace execution
- React 18 - UI framework
- TypeScript - Type safety
- Vite - Build tool and dev server
- React Flow - Node-based editor
- Google Gemini AI - AI analysis engine
- Zustand - State management
- Lucide React - Icons
aiexp/
βββ src/
β βββ components/
β β βββ CustomNode.tsx # Individual node component
β β βββ ComponentLibrary.tsx # Sidebar component library
β βββ data/
β β βββ componentLibrary.ts # 1000+ component definitions
β βββ types/
β β βββ index.ts # TypeScript type definitions
β βββ utils/
β β βββ geminiService.ts # Gemini API integration
β β βββ jsonGenerator.ts # JSON export utility
β βββ App.tsx # Main application
β βββ main.tsx # Entry point
β βββ index.css # Global styles
βββ package.json
βββ tsconfig.json
βββ vite.config.ts
βββ README.md
- Each component has properties (resistance, capacitance, voltage, etc.)
- Components have inputs and outputs for connections
- Visual icons and category badges
- Searchable and filterable
- Infinite canvas with pan and zoom
- Grid background
- Minimap for navigation
- Multi-select and delete
- Undo/redo support (Ctrl+Z / Ctrl+Y)
- Converts visual experiment to structured JSON
- Sends to Gemini for analysis
- Receives detailed explanations
- Shows step-by-step process
- Calculates numerical results
- Clean, structured format
- Includes all node data
- Connection information
- Metadata (timestamp, description)
- Can be imported back (future feature)
- Delete - Delete selected nodes/edges
- Ctrl + Z - Undo
- Ctrl + Y - Redo
- Mouse Wheel - Zoom in/out
- Middle Mouse Button - Pan canvas
- Double-click nodes to rename them with custom labels
- Use categories to quickly find component types
- Search for specific components (e.g., "LED", "resistor")
- Connect multiple components to create complex flows
- The AI works best with logical, realistic experiment setups
- Export JSON to save your work and share with others
- Make sure you've entered a valid Gemini API key
- Check that your API key has the necessary permissions
- Verify your Google Cloud project has the Generative AI API enabled
- Clear your search filter
- Select "All" categories
- Refresh the page
- If the canvas feels slow with many nodes, try:
- Deleting unused nodes
- Working in smaller sections
- Refreshing the browser
- Save/Load experiments to local storage
- Import JSON files
- Real-time collaboration
- Animation of experiment flow
- More component properties editing
- Custom component creation
- Export to different formats (PDF, PNG)
- Code generation from experiments
- 3D visualization mode
This is an open experiment! Feel free to:
- Add more components to the library
- Improve AI prompts for better analysis
- Add new features
- Report bugs
- Share your experiments
MIT License - Feel free to use this for learning and experimentation!
Built with β€οΈ using:
- React Flow for the amazing node editor
- Google Gemini for AI-powered analysis
- The open-source community
Happy Experimenting! π
Try building your first experiment and see what the AI discovers!