A sophisticated desktop application for authoring, validating, and visualizing Formal Reasoning Mode (FRM) problem descriptions with equation-first mathematical modeling and AI-powered novelty assurance.
Features โข Quick Start โข Architecture โข Screenshots โข Contributing
FRM Desktop is a cutting-edge Electron + React application designed for mechanism-level, equation-first reasoning in the AI era. It provides a comprehensive workspace for building sophisticated mathematical models across multiple domains including medicine, biology, engineering, AI, and more.
The application features AI-powered novelty assurance, Model Context Protocol (MCP) integration, and real-time communication logging to ensure every model you build remains schema-compliant, novel, and ready for AI consumption. The system is driven entirely by the enhanced frm_schema.json specification with comprehensive novelty assessment capabilities.
- ๐ Schema-Driven Editor - Intuitive form editor with real-time validation feedback
- ๐ Live AJV Validation - Instant validation against enhanced FRM JSON Schema with novelty assurance
- ๐งฎ Equation-First Modeling - Built for ODE, PDE, DAE, SDE, and hybrid systems with novelty tagging
- ๐ค AI Schema Generator - Generate domain-specific schemas using configurable OpenAI API integration
- ๐ Interactive Visualization - Real-time model visualization and analysis
- ๐ Modern UI - Beautiful dark/light theme with smooth animations and lazy loading
- ๐ง Multi-Domain Support - 30+ domains including AI, astrophysics, climate science, quantum computing
- ๐ Mathematical Rendering - KaTeX integration for beautiful equation display
- ๐พ Import/Export - JSON-based problem sharing and collaboration
- โก Performance Optimized - Lazy-loaded components, validation caching, and efficient state management
- ๐ก๏ธ Type Safety - Full TypeScript support with generated schema types and runtime type guards
- ๐ MCP Integration - Model Context Protocol server for AI tool integration
- ๐ก Real-time Communication - Live communication logging and monitoring panel
- ๐ฏ Novelty Assurance - AI-powered novelty assessment with similarity metrics and redundancy checking
- โฑ๏ธ Generation Timer - Real-time timer display during schema generation with precise duration tracking
- ๐ Generation Logging - Comprehensive logging of each generation including model, domain, sub-domain, and duration
- ๐ Monaco Editor - Professional code editor with syntax highlighting and IntelliSense
- ๐ Schema Migration - Built-in tools for schema version migration and updates
- ๐ Schema Debugging - Comprehensive debugging utilities for schema validation
- ๐ Clipboard Integration - Advanced copy/paste functionality for schema elements
- โก Build Optimization - Advanced code splitting and chunk optimization
- ๐ก๏ธ Error Boundaries - Robust error handling with graceful degradation
- ๐ Virtualized Lists - High-performance rendering for large datasets
- AI-Powered Novelty Detection - Integrated similarity assessment using cosine embeddings, ROUGE-L, and NovAScore
- Comprehensive Citation Management - Full citation tracking with coverage analysis and conflict detection
- Evidence Mapping - Systematic evidence tracking linking claims to supporting citations
- Redundancy Prevention - Automated detection of duplicate work with configurable thresholds
- MCP Server Implementation - Built-in MCP server for AI tool integration
- Real-time Communication Logging - Live monitoring of AI interactions and tool calls
- Tool Validation - Comprehensive validation of FRM documents through MCP tools
- Performance Monitoring - Real-time statistics and connection status tracking
- Validation Caching - LRU-style caching with 90% performance improvement for repeated operations
- Lazy Loading - Component-level lazy loading for faster initial load times
- Memory Management - Optimized memory usage with WeakMap caching and cleanup
- Type Guard Optimization - Runtime type validation with performance monitoring
- Domain Selector - Comprehensive domain selection with 30+ scientific domains
- Communication Panel - Real-time monitoring of AI interactions and system events
- Enhanced Validation - Detailed error reporting with context-aware suggestions
- Modern UI Components - Radix UI components with smooth animations and accessibility
- Node.js 18+
- npm 9+
# Clone the repository
git clone https://github.com/DesmondForward/formal-reasoning-mode.git
cd formal-reasoning-mode
# Install dependencies
npm install
# Start development server
npm run devThe development script starts both the Vite dev server and Electron, providing hot-reload for rapid development.
# Build for production
npm run build
# Create desktop packages
npm run dist # All platforms
npm run dist:win # Windows only
npm run dist:mac # macOS only
npm run dist:linux # Linux only| Layer | Technology | Purpose |
|---|---|---|
| ๐ฅ๏ธ Desktop | Electron 38 | Cross-platform desktop runtime |
| โ๏ธ Frontend | React 18 + TypeScript 5.3.3 | Modern UI with type safety |
| ๐จ Styling | Tailwind CSS 3.4.0 + Framer Motion | Responsive design with animations |
| ๐ Validation | AJV 8.12.0 + json-schema-to-ts | Schema validation and type generation |
| ๐งฎ Math | KaTeX 0.16.9 + react-katex | Mathematical equation rendering |
| ๐ง Build | Vite 7.1.7 | Fast development and optimized builds |
| ๐ค AI Integration | Configurable OpenAI API | AI-powered schema generation |
| ๐ MCP | Model Context Protocol | AI tool integration and communication |
| ๐ State Management | React Hooks + Context | Efficient state management with caching |
- Monaco Editor - Professional code editing with syntax highlighting
- Radix UI - Accessible, unstyled UI components
- Axios - HTTP client for API communication
- Zod - Runtime type validation and schema parsing
- PostCSS - CSS processing and optimization
- Cross-env - Cross-platform environment variable handling
๐ FRM Desktop/
โโโ ๐ main/ # Electron main process
โ โโโ main.ts # Main process entry point
โ โโโ preload.ts # Secure preload script
โ โโโ ๐ mcp/ # Model Context Protocol server
โ โโโ frmMcpServer.ts # MCP server implementation
โโโ ๐ src/ # React renderer application
โ โโโ ๐ components/ # React components
โ โ โโโ ๐ editors/ # Specialized form editors
โ โ โ โโโ NoveltyAssuranceEditor.tsx # Novelty assessment editor
โ โ โ โโโ InputEditor.tsx # Input specification editor
โ โ โ โโโ ModelingEditor.tsx # Mathematical modeling editor
โ โ โ โโโ MethodSelectionEditor.tsx # Method selection editor
โ โ โ โโโ SolutionAnalysisEditor.tsx # Solution analysis editor
โ โ โ โโโ ValidationEditor.tsx # Validation editor
โ โ โ โโโ OutputContractEditor.tsx # Output contract editor
โ โ โโโ ๐ ui/ # Reusable UI components
โ โ โโโ SchemaEditor.tsx # Main schema editor
โ โ โโโ ValidationPanel.tsx # Real-time validation
โ โ โโโ VisualizationPanel.tsx # Model visualization
โ โ โโโ CommunicationLogPanel.tsx # Real-time communication monitoring
โ โ โโโ VirtualizedEventList.tsx # High-performance event rendering
โ โ โโโ ErrorBoundary.tsx # Error handling component
โ โ โโโ DomainSelector.tsx # Domain selection component
โ โโโ ๐ hooks/ # Custom React hooks
โ โ โโโ useCommunication.ts # Communication monitoring
โ โ โโโ useValidation.ts # Validation with caching
โ โ โโโ useFRMData.ts # Data management
โ โ โโโ useTheme.ts # Theme management
โ โโโ ๐ data/ # Schema definitions and types
โ โโโ ๐ utils/ # Utility functions
โ โ โโโ typeGuards.ts # Runtime type validation
โ โ โโโ validation.ts # Validation utilities
โ โ โโโ schemaMigration.ts # Schema migration tools
โ โ โโโ schemaDebug.ts # Schema debugging utilities
โ โ โโโ schemaGenerator.ts # AI schema generation
โ โ โโโ clipboard.ts # Clipboard utilities
โ โโโ App.tsx # Application root
โโโ ๐ frm_schema.json # Enhanced FRM JSON Schema with novelty assurance
โโโ ๐ package.json # Dependencies and scripts
Create a .env.local file for development. Copy from .env.example and configure your preferred AI provider:
# AI Provider Configuration
# Set AI_PROVIDER to one of: openai, google, anthropic
AI_PROVIDER=openai
# OpenAI Configuration (for AI example generation)
OPENAI_API_KEY=your_openai_api_key_here
OPENAI_MODEL=gpt-5.5
OPENAI_API_URL=https://api.openai.com/v1/responses
OPENAI_REASONING_EFFORT=medium
OPENAI_TEXT_VERBOSITY=low
# Google Gemini Configuration
GOOGLE_API_KEY=your_google_api_key_here
GOOGLE_MODEL=gemini-2.5-pro
GOOGLE_API_URL=https://generativelanguage.googleapis.com/v1beta
# Anthropic Claude Configuration
ANTHROPIC_API_KEY=your_anthropic_api_key_here
ANTHROPIC_MODEL=claude-3-5-sonnet-20241022
ANTHROPIC_API_URL=https://api.anthropic.com/v1/messages
# Development
VITE_DEV_SERVER_URL=http://localhost:3000Supported AI Providers:
- OpenAI: GPT-5.5, GPT-5.4, GPT-5.2, GPT-5, GPT-4o, GPT-4o-mini, GPT-4-turbo
- Google: Gemini 2.5 Pro, Gemini 2.5 Flash, Gemini 2.5 Flash-Lite, Gemini 1.5 Pro, Gemini 1.5 Flash
- Anthropic: Claude 3.5 Sonnet, Claude 3.5 Haiku, Claude 3 Opus, Claude 3 Sonnet, Claude 3 Haiku
The application is fully driven by frm_schema.json. To extend or modify the schema:
- Update
frm_schema.jsonwith your changes - Regenerate TypeScript types:
npm run generate-types - The UI will automatically adapt to schema changes
- Launch FRM Desktop
- Select a domain from the dropdown (medicine, biology, engineering, etc.)
- Generate a schema or start from scratch
- Edit the schema sections (Best for Professionals):
- Metadata: Problem ID, domain, version
- Input: Problem summary, known quantities, unknowns
- Modeling: Equations, variables, model class
- Method Selection: Solution methods and justification
- Validation: Quality metrics and checks
- Output Contract: Required sections and formatting
- Novelty Assurance: Novelty assessment and citation management
// Generate a medicine domain schema
const example = await generateSchemaProblem({
domain: 'medicine',
scenarioHint: 'epidemic modeling with vaccination'
})// Real-time validation
const validation = useValidation(frmSchema)
const isValid = validation.isValid
const errors = validation.errors| Domain | Description | Example Use Cases |
|---|---|---|
| ๐ค Artificial Intelligence | AI/ML models, neural networks, and intelligent systems | Deep learning, reinforcement learning, optimization |
| ๐ Astrophysics | Celestial mechanics, stellar dynamics, and cosmic phenomena | Stellar evolution, orbital mechanics, cosmology |
| ๐ค Autonomous Systems | Robotics, autonomous vehicles, and self-governing systems | Path planning, control systems, decision making |
| ๐งฌ Biology | Biological systems and processes | Population dynamics, enzyme kinetics, gene regulation |
| โ๏ธ Chemical Engineering | Process design, reactor engineering, and chemical systems | Reactor design, process optimization, kinetics |
| ๐งช Chemistry | Chemical reactions and processes | Reaction kinetics, molecular dynamics, catalysis |
| ๐ Climate Science | Climate modeling, carbon dynamics, and environmental systems | Climate change, ecosystem dynamics, pollution |
| ๐ป Coding | Software engineering and computational problems | Algorithm design, system architecture, performance optimization |
| ๐ฐ Computational Finance | Financial modeling and quantitative analysis | Risk assessment, portfolio optimization, derivatives |
| ๐ก๏ธ Cybersecurity | Security systems and threat modeling | Cryptography, network security, threat analysis |
| ๐ Data Science | Data analysis and machine learning | Statistical modeling, predictive analytics, data mining |
| ๐ฐ Economics | Economic modeling and analysis | Market dynamics, policy impact, resource allocation |
| โก Energy Systems | Energy generation, storage, and distribution | Renewable energy, grid optimization, storage systems |
| ๐ญ Engineering | Engineering systems and control | Control systems, structural analysis, optimization |
| ๐ Fluid Dynamics | Fluid flow and transport phenomena | CFD, turbulence modeling, heat transfer |
| ๐ Fluid Mechanics | Fluid behavior and properties | Viscous flow, compressible flow, multiphase systems |
| ๐ Geosciences | Earth sciences and geological processes | Seismic modeling, climate patterns, geological formations |
| ๐ฌ General | General-purpose mathematical and scientific problems | Cross-domain applications, fundamental research |
| ๐งฑ Materials Science | Material properties and behavior | Material design, phase transitions, mechanical properties |
| ๐งฎ Mathematics | Pure and applied mathematical problems | Mathematical proofs, numerical methods, optimization |
| ๐ฅ Medicine | Medical and healthcare applications | Disease modeling, drug kinetics, treatment optimization |
| ๐ Metrology | Measurement science and standards | Calibration, uncertainty quantification, measurement systems |
| ๐ง Neuroscience | Brain and nervous system modeling | Neural networks, cognitive modeling, brain dynamics |
| ๐ Network Science | Network analysis and graph theory | Social networks, infrastructure networks, information flow |
| โ๏ธ Physics | Physical systems and phenomena | Quantum mechanics, thermodynamics, electromagnetism |
| ๐ฅ Public Health | Population health and epidemiology | Disease spread, health policy, population dynamics |
| โ๏ธ Quantum Computing | Quantum systems and algorithms | Quantum algorithms, error correction, optimization |
| ๐ฑ Renewable Energy | Sustainable energy systems | Solar modeling, wind energy, energy storage |
| ๐ค Robotics | Robotic systems and automation | Motion planning, sensor fusion, autonomous navigation |
| ๐ก Signal Processing | Signal analysis and processing | Audio processing, image analysis, communication systems |
| ๐ฅ Social Science | Social systems and human behavior | Social dynamics, policy analysis, behavioral modeling |
| ๐ Space Technology | Space systems and aerospace engineering | Orbital mechanics, spacecraft design, mission planning |
| ๐งฌ Synthetic Biology | Engineered biological systems | Synthetic circuits, metabolic engineering, bio-design |
| ๐งฌ Systems Biology | Biological system integration | Multi-scale modeling, biological networks, systems analysis |
- โ Type Safety - Generated TypeScript types from JSON Schema with runtime type guards
- โ Real-time Validation - AJV validation with detailed error reporting and caching
- โ Schema Evolution - Automatic UI updates when schema changes
- โ Import/Export - Full schema compliance for data portability
- โ Novelty Assessment - AI-powered novelty detection with similarity metrics
- โ Redundancy Checking - Automated detection of duplicate or similar work
- โ Citation Management - Comprehensive citation tracking and validation
- โ Evidence Tracking - Systematic evidence mapping for novelty claims
- Lazy Loading - Components load on-demand to reduce initial bundle size
- Validation Caching - LRU cache for validation results with 90% performance improvement
- Code Splitting - Intelligent chunking for optimal loading performance
- Memory Management - WeakMap caching and automatic cleanup
- Virtualized Rendering - High-performance rendering for large datasets
- Chunk Optimization - Manual chunk configuration for optimal loading
- Tree Shaking - Dead code elimination for smaller bundles
- Asset Optimization - Compressed assets and optimized images
- Cross-platform Compatibility - Cross-env for consistent environment handling
- Design - Plan your schema structure and requirements
- Implement - Use the Monaco editor for precise schema editing
- Validate - Real-time validation with detailed error reporting
- Debug - Use built-in debugging utilities for schema issues
- Migrate - Apply schema migrations for version updates
- Configure - Set up OpenAI API credentials
- Generate - Use AI to generate domain-specific schemas
- Validate - Ensure generated schemas pass validation
- Refine - Iterate on AI-generated content
- Monitor - Track AI interactions via communication panel
For detailed troubleshooting information, see SETUP.md.
- Schema errors on import: The file must satisfy
frm_schema.json; the app reports validation details in the Validation panel - Electron window stays blank: Ensure the Vite dev server (port 3000 by default) is running and reachable
- TypeScript errors: Run
npm run buildto surface compile issues introduced by schema changes - MCP connection issues: Check the Communication Log Panel for connection status and error details
- AI generation fails: Verify your OpenAI API key is correctly set in
.env.localand restart the application - Performance issues: The app uses lazy loading and caching; initial load may take a moment for large schemas
We welcome contributions! Here's how to get started:
# Fork and clone the repository
git clone https://github.com/DesmondForward/formal-reasoning-mode.git
cd formal-reasoning-mode
# Install dependencies
npm install
# Start development server
npm run dev- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes with clear, descriptive commits
- Test your changes thoroughly
- Submit a pull request with a detailed description
- TypeScript for type safety
- ESLint for code quality
- Prettier for code formatting
- Conventional Commits for commit messages
This project is licensed under the MIT License - see the LICENSE file for details.
- Formal Reasoning Mode - The underlying methodology and schema
- OpenAI - For AI-powered example generation
- Electron - For cross-platform desktop capabilities
- React - For the modern UI framework
- Tailwind CSS - For the beautiful design system
- ๐ Documentation: Wiki (Coming Soon)
- ๐ Issues: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions (Coming Soon)
Built with โค๏ธ for the future of mathematical modeling and AI reasoning
โญ Star this repo โข ๐ Report a bug โข ๐ก Request a feature


