A comprehensive FastAPI-based research platform that leverages OpenAI's advanced models (O3, O4-Mini) to conduct in-depth research, idea validation, market analysis, and financial assessments.
- Multi-Model Research: Support for O3 Deep Research and O4 Mini Deep Research models
- Research Types:
- Custom Research: General-purpose research queries
- Idea Validation: Comprehensive startup/business idea analysis
- Market Research: Market analysis and competitive landscape
- Financial Analysis: Financial feasibility and projections
- Comprehensive Analysis: All three research types combined
- Progressive Results: Real-time updates for comprehensive research
- Web Interface: Modern, responsive web UI with live progress tracking
- Data Persistence: SQLite database for storing research history
- Export Options: Download reports as Markdown files
- RESTful API: Complete API for programmatic access
- Backend: FastAPI, Python 3.8+
- AI Models: OpenAI O3, O4-Mini Deep Research
- Database: SQLite with custom ORM
- Frontend: HTML/CSS/JavaScript with Alpine.js
- Styling: Tailwind CSS
- API: RESTful endpoints with automatic documentation
- Python 3.8 or higher
- OpenAI API key with access to research models
- Git (for cloning)
-
Clone the repository:
git clone https://github.com/MajorAbdullah/ai-research-platform.git cd ai-research-platform -
Create and activate virtual environment:
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
-
Install dependencies:
pip install -r config/requirements.txt
-
Set up environment variables: Create a
.envfile in the root directory:OPENAI_API_KEY=your_openai_api_key_here
-
Initialize the database:
python -c "from models.database import init_db; init_db()"
# Setup (first time only)
./setup.sh
# Run the application
./dev.sh runsource .venv/bin/activate
python app.pyThe application will be available at:
- Web Interface: http://localhost:8000
- API Documentation: http://localhost:8000/docs
- Health Check: http://localhost:8000/health
- Open http://localhost:8000 in your browser
- Select your preferred research model
- Choose research type
- Enter your research query
- Monitor real-time progress
- Download or copy results when complete
curl -X POST "http://localhost:8000/api/research" \
-H "Content-Type: application/json" \
-d '{
"query": "AI app for construction workers",
"model": "o3-deep-research",
"research_type": "comprehensive",
"enrich_prompt": true
}'curl "http://localhost:8000/api/research/{task_id}/status"curl "http://localhost:8000/api/research/{task_id}/result"General-purpose research for any query with intelligent prompt enrichment.
Comprehensive startup/business idea analysis including:
- Market opportunity assessment
- Target audience analysis
- Competition landscape
- Technical feasibility
- Risk assessment
Detailed market analysis covering:
- Market size and growth
- Customer segments
- Competitive analysis
- Market trends
- Entry barriers
Financial feasibility assessment including:
- Revenue projections
- Cost analysis
- Break-even analysis
- Funding requirements
- ROI calculations
Combines all three research types for complete business intelligence.
ai-research-platform/
βββ app.py # Main FastAPI application
βββ config/
β βββ __init__.py
β βββ requirements.txt # Python dependencies
βββ models/
β βββ __init__.py
β βββ database.py # Database models and operations
βββ services/
β βββ __init__.py
β βββ research_client.py # OpenAI research client
β βββ storage_service.py # Data persistence layer
β βββ document_manager.py # Document handling
βββ research_documents/ # Generated research reports
β βββ archives/
β βββ comprehensive_research/
β βββ custom_research/
β βββ financial_analysis/
β βββ idea_validation/
β βββ market_research/
β βββ metadata/
βββ .env # Environment variables (create this)
βββ .gitignore
βββ README.md
POST /api/research- Start new research taskGET /api/research/{task_id}/status- Get task statusGET /api/research/{task_id}/result- Get completed resultsGET /api/research/{task_id}/progressive- Get progressive resultsGET /api/research/results- Get all resultsDELETE /api/research/{task_id}- Delete research result
GET /api/models- Get available research modelsGET /api/dashboard/overview- Dashboard metricsGET /api/dashboard/ideas- All ideas dataGET /health- Health check
For comprehensive research, the system provides real-time updates as each research phase completes:
- Idea validation phase
- Market research phase
- Financial analysis phase
Results are cached in SQLite database with metadata for quick retrieval and historical analysis.
- Markdown format downloads
- Clipboard copy functionality
- Structured JSON API responses
Choose between different OpenAI models based on your needs:
- O3 Deep Research: Maximum depth and accuracy
- O4 Mini Deep Research: Faster, cost-effective option
OPENAI_API_KEY=your_api_key_here
DATABASE_URL=sqlite:///research_platform.db # Optional, defaults to local SQLite
DEBUG=false # Optional, for developmentModels can be configured in services/research_client.py with custom parameters for:
- Maximum tool calls
- Timeout settings
- Response formatting
./dev.sh setup # Initial setup
./dev.sh run # Start development server
./dev.sh test # Run tests
./dev.sh lint # Check code quality
./dev.sh format # Format code
./dev.sh clean # Clean up files
./dev.sh docker # Run with Docker./dev.sh test
# or manually:
source .venv/bin/activate
pytest tests/ -v --cov=.# Using docker-compose
docker-compose up --build
# Using development script
./dev.sh dockerThe application follows a modular architecture:
- app.py: Main FastAPI application and routes
- services/: Business logic and external integrations
- models/: Data models and database operations
- config/: Configuration and dependencies
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you encounter any issues or have questions:
- Check the Issues page
- Create a new issue with detailed information
- Contact the maintainers
- Integration with additional AI models
- Advanced data visualization dashboard
- Export to multiple formats (PDF, DOCX)
- Collaborative research features
- API rate limiting and usage analytics
- Docker containerization
- Cloud deployment guides
- Typical research completion: 2-5 minutes
- Concurrent request handling: Up to 10 parallel research tasks
- Database: Optimized for quick retrieval with indexing
- Memory usage: ~100MB base + active research tasks
Built with β€οΈ using OpenAI's advanced research capabilities