Skip to content

JoyceGu/ClarifAI

Repository files navigation

ClarifAI - Requirement Management and Optimization System

ClarifAI is an intelligent requirement management system designed to help Product Managers (PMs) better formulate and refine product requirements, enabling researchers and data scientists to solve problems more efficiently.

Key Features

1. User Authentication

  • Support for multi-role login (PM/Researcher)
  • Test accounts provided:

2. PM Requirement Submission Interface

  • Business goal and data scope definition
  • File upload support
  • Expected output selection
  • Timeline setting
  • AI intelligent feedback based on Azure OpenAI (GPT-4o-mini)
  • "Verify Requirement" feature for real-time AI analysis
  • Requirement Scorecard including:
    • Clarity
    • Feasibility
    • Completeness

3. Researcher Feedback Interface

  • View requirement details
  • Provide solutions
  • Interactive discussion with PMs

Technology Stack

  • Backend: Flask
  • Frontend: HTML + CSS + JavaScript
  • Database: PostgreSQL
  • AI Model: Azure OpenAI GPT-4o-mini for requirement analysis

Project Structure

ClarifAI/
├── app/
│   ├── __init__.py         # Flask application initialization
│   ├── routes.py           # Flask routes
│   ├── database.py         # Database configuration
│   ├── ai_service.py       # Azure OpenAI integration
│   ├── models/             # Data models
│   ├── static/             # Static files
│   └── templates/          # HTML templates
├── requirements.txt        # Project dependencies
├── .env                    # Environment variables (not tracked by Git)
├── config.py               # Application configuration
└── README.md               # Project documentation

Installation and Setup

  1. Install dependencies:
pip install -r requirements.txt
  1. Configure Azure OpenAI: Create a .env file in the root directory with the following content:
# Azure OpenAI API Configuration
AZURE_OPENAI_ENDPOINT=your_azure_openai_endpoint
AZURE_OPENAI_API_KEY=your_api_key
AZURE_OPENAI_API_VERSION=2023-05-15
AZURE_OPENAI_DEPLOYMENT=gpt-4o-mini

# PostgreSQL Configuration
POSTGRES_SERVER=localhost
POSTGRES_USER=postgres
POSTGRES_PASSWORD=your_password
POSTGRES_DB=clarifai
  1. Initialize the database:
flask db init
flask db migrate
flask db upgrade
python init_db.py
  1. Run the application locally:
flask run
  1. Access the system: Open your browser and go to http://localhost:5000

Deploying to Azure

  1. Create a PostgreSQL database on Azure:

    • Go to Azure Portal
    • Create a new Azure Database for PostgreSQL server
    • Configure firewall rules to allow your application
  2. Configure Azure App Service:

    • Create a new Web App service
    • Set up deployment from Git repository or VS Code
    • Configure environment variables in App Service Configuration
  3. Deploy the application:

az login
az webapp up --name YourAppName --resource-group YourResourceGroup --location "East US" --sku B1
  1. Set environment variables in Azure:

    • Go to your App Service in Azure Portal
    • Navigate to Configuration > Application settings
    • Add all the environment variables from your .env file
  2. Access your deployed app:

Using the Requirement Verification Feature

  1. Fill out all fields in the requirement form
  2. Click the "Verify Requirement" button
  3. The system will analyze your requirement using Azure OpenAI and provide:
    • Clarity Score
    • Feasibility Score
    • Completeness Score
    • Detailed feedback with suggestions for improvement
  4. If the Clarity Score is at least 70%, the "Submit Requirement" button will be enabled
  5. Make any necessary improvements based on the AI feedback
  6. Submit the finalized requirement when ready

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors