A structured, responsible, and explainable creative reasoning system powered by Gemini AI
ReasonForge is a Multi-Agent Creative Studio that demonstrates how a single Large Language Model (Gemini) can be orchestrated through multiple specialized roles to produce high-quality, explainable creative solutions. This is NOT a chatbot or autonomous agent swarm - it's a controlled creative reasoning architecture inspired by how humans think through complex problems.
- 🧩 10-Stage Reasoning Pipeline - Structured problem-solving process
- 🛡️ Safety-First Approach - Ethics check before any ideation
- 🎯 Domain-Specific Intelligence - Adapts to your problem's context
- 🔍 Explainable Reasoning - Transparent logic at every step
- 🎨 Professional UI/UX - Modern, responsive interface
- ⚡ Multi-Key Load Balancing - 10 API keys for reliability
- 🖼️ Contextual Images - Domain-specific visual representations
- Transparency over Magic - All reasoning steps are visible and explainable
- Responsibility over Speed - Quality and safety are prioritized over rapid execution
- Structure over Randomness - Deterministic pipeline with clear stage boundaries
- Explainability over Metrics - Qualitative reasoning instead of opaque numerical scores
- Node.js 18+
- 10 Gemini API keys (for load balancing and fallback)
-
Clone the repository
git clone https://github.com/Siddh-2006/ReasonForge.git cd ReasonForge -
Install dependencies
npm install
-
Configure API Keys
Edit
.env.localand add your 10 Gemini API keys (comma-separated):GEMINI_API_KEYS=key1,key2,key3,key4,key5,key6,key7,key8,key9,key10
Get API Keys: Visit Google AI Studio to create your keys
-
Start the application
npm start
-
Open the application
Navigate to http://localhost:3000
-
📝 Enter Your Problem
- Type any complex problem or challenge
- Can be from any domain (business, technology, creative, etc.)
-
🔍 Clarity Check
- System evaluates problem clarity (0-10 score)
- If score < 7, you'll see clarification questions
- You can skip questions or answer them
-
🤖 Automated Pipeline
- Safety check ensures ethical compliance
- Domain inference identifies your problem space
- Constraints are generated automatically
- Multiple idea trajectories are explored
- Ideas are critiqued and refined
- Top 3 ideas are ranked and explained
-
📊 Review Results
- See domain analysis and risk profile
- Review governing constraints
- Explore top 3 ranked ideas with full reasoning
- Click on ideas for detailed analysis
🏢 Business Strategy:
How can we increase customer retention for our SaaS product
while maintaining profitability and team capacity?
💡 Product Development:
Design an innovative mobile app feature that helps users
track their carbon footprint without being preachy or overwhelming.
🌱 Agricultural Innovation:
Create a smart irrigation system for small farms that optimizes
water usage while being affordable for developing regions.
🎨 Creative Challenge:
Create a marketing campaign for a sustainable fashion brand
that appeals to Gen Z without greenwashing.
- 📥 Problem Intake - Accept user's problem statement
- 🔍 Clarity Check - Evaluate problem clarity and ask clarifying questions
- 🛡️ Safety Gate - Detect harmful or unethical intent before ideation
- 🏢 Domain Inference - Identify problem domain and risk profile
- 🚧 Constraint Building - Generate governing constraints for ideation
- 🗜️ Context Compression - Create minimal, high-signal context summary
- 💡 Idea Generation - Explore multiple creative trajectories (exploratory & constraint-aware)
- 🔍 Critique - Identify issues using declared constraints
- ✨ Refinement - Improve ideas based on critiques
- 🏆 Ranking & Presentation - Select and explain top 3 ideas
Frontend:
- React 19.2.3 with TypeScript
- Framer Motion (animations)
- Lucide React (icons)
- Vite (build tool)
- Tailwind CSS (styling)
Backend:
- Node.js with Express
- Google Generative AI SDK
- Multi-key load balancing
- Rate limiting
- Structured JSON parsing
LLM:
- Gemini 2.5 Flash (primary model)
- Role-conditioned prompting
- Structured output parsing
reasonforge/
├── 📚 docs/ # Documentation
│ ├── README.md # Documentation index
│ ├── TECHNICAL_SPECIFICATION.md # Complete technical spec
│ ├── CODEBASE_ANALYSIS.md # Implementation analysis
│ ├── IMPLEMENTATION_SUMMARY.md # Feature summary
│ ├── API_DOCUMENTATION.md # Backend API reference
│ └── DEPLOYMENT_GUIDE.md # Deployment instructions
├── 🔧 backend/
│ ├── api/
│ │ └── creative-studio.js # ⭐ Core pipeline implementation
│ └── server.js # Express server
├── 🎨 services/
│ ├── api-client.ts # Backend communication
│ └── gemini.ts # Frontend service with image generation
├── 📱 App.tsx # Main React UI component
├── 📋 types.ts # TypeScript interfaces
├── 🚀 index.tsx # React entry point
├── 🎨 index.html # HTML template with styling
├── ⚙️ vite.config.ts # Vite configuration
├── 📦 package.json # Dependencies and scripts
├── 🔐 .env.local # Environment variables (API keys)
├── 🚫 .gitignore # Git ignore rules
├── 🌐 vercel.json # Vercel deployment config
└── 📖 README.md # This file
npm run dev- Start frontend development server (port 3000)npm run backend- Start backend API server (port 3001)npm start- Start both frontend and backend concurrentlynpm run backend:dev- Start backend with auto-reload (nodemon)npm run build- Build frontend for productionnpm run preview- Preview production build
The system uses multiple API keys for:
- Load Balancing - Distribute requests across keys
- Rate Limit Management - Avoid hitting per-key limits (15 requests/minute/key = 150 total)
- Fallback Resilience - Continue working if one key fails
- Visit Google AI Studio
- Create 10 API keys (you can use the same Google account)
- Copy each key and add to
.env.localseparated by commas
# Multiple API keys (comma-separated)
GEMINI_API_KEYS=key1,key2,key3,key4,key5,key6,key7,key8,key9,key10
# Rate limiting settings
MAX_REQUESTS_PER_MINUTE=15
FALLBACK_DELAY_MS=2000
# Server configuration
PORT=3001
NODE_ENV=development-
Push to GitHub
git add . git commit -m "Ready for deployment" git push origin main
-
Deploy to Vercel
- Go to vercel.com
- Import your GitHub repository
- Add environment variables (your 10 API keys)
- Deploy!
-
Configure Environment Variables In Vercel dashboard, add:
GEMINI_API_KEYS=your,ten,api,keys,here MAX_REQUESTS_PER_MINUTE=15 FALLBACK_DELAY_MS=2000 NODE_ENV=production
- Netlify - See Deployment Guide
- Custom Server - See Deployment Guide
- Docker - See Deployment Guide
- Clarity Check: 2-3 seconds
- Safety Gate: 1-2 seconds
- Domain Inference: 2-3 seconds
- Constraint Building: 2-3 seconds
- Idea Generation: 4-6 seconds (parallel)
- Critique & Refinement: 6-8 seconds
- Ranking: 2-3 seconds
Total Pipeline: 20-30 seconds of genuine AI reasoning
- Multi-key load balancing (10 API keys = 150 requests/minute capacity)
- Parallel execution of exploratory and constraint-aware paths
- Context compression to reduce token usage
- Automatic fallback handling for resilience
- Reliable image generation with domain-specific selection
- ✅ Keys stored in backend environment only (never exposed to frontend)
- ✅ Automatic key rotation on failure
- ✅ Per-key usage tracking and rate limiting
- ✅ Mandatory safety check before any ideation
- ✅ Content filtering for harmful intent
- ✅ Ethical boundary enforcement in constraints
- ✅ Transparent refusal with explanations
- ✅ Sanitized user input
- ✅ Length limits enforced
- ✅ Injection attack prevention
- ✅ CORS configuration for allowed origins
Backend won't start:
# Check if port 3001 is in use
netstat -ano | findstr :3001 # Windows
lsof -i :3001 # Mac/Linux
# Kill the process or change PORT in .env.localAPI Key Errors:
Error: All API keys failed
Solution: Verify your API keys are valid and not placeholder values in .env.local
Frontend can't connect to backend:
Failed to fetch
Solution: Ensure backend is running on port 3001 and CORS is enabled
Rate Limit Errors:
Error: All API keys have exceeded rate limits
Solution: Wait 1 minute or add more API keys to .env.local
# Check backend health
curl http://localhost:3001/api/health
# View backend logs
npm run backend
# Test API endpoint
curl -X POST http://localhost:3001/api/process \
-H "Content-Type: application/json" \
-d '{"problem":"test","stage":"clarity"}'- 📖 Complete Documentation - All technical documentation
- 🔧 Technical Specification - Detailed architecture and implementation
- 📊 Codebase Analysis - Code quality and structure assessment
- 📋 Implementation Summary - Feature overview and status
- 🌐 API Documentation - Backend API reference
- 🚀 Deployment Guide - Platform-specific deployment instructions
We welcome contributions! Here's how you can help:
- 🐛 Report Issues - Found a bug? Open an issue with details
- 💡 Suggest Features - Have an idea? Share it in discussions
- 🔧 Submit PRs - Fix bugs or add features with pull requests
- 📖 Improve Docs - Help make documentation clearer
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes and test thoroughly
- Commit with clear messages:
git commit -m "Add amazing feature" - Push to your fork:
git push origin feature/amazing-feature - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Google AI - For the powerful Gemini API
- React Team - For the excellent React framework
- Vercel - For seamless deployment platform
- Tailwind CSS - For the utility-first CSS framework
- Framer Motion - For smooth animations
- Lucide - For beautiful icons
If you find ReasonForge helpful, please consider:
- ⭐ Starring this repository
- 🐦 Sharing on social media
- 💬 Telling others about it
- 🤝 Contributing to the project
Where ideas are shaped, not guessed.
Made with ❤️ by Siddh and Freny
🚀 Try Live Demo • 📚 Read Docs • 🐛 Report Bug • � Request Featuare