Skip to content

About

AI prompt-building assistant that turns a rough idea into a clear, structured, reusable prompt using RAG-powered guidance and a quality score.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

PromptMind

Better prompts start with better questions.

PromptMind was developed as the capstone project for the Vibe Coding Program by SDAIA Academy.


Table of Contents


Overview

Many people know roughly what they want from an AI assistant but struggle to turn that idea into an effective prompt.

PromptMind closes that gap. It takes a rough idea, asks a small number of focused clarification questions, and turns the idea plus the user's answers into a clear, structured, reusable prompt — one the user can paste into any AI assistant to actually get the result they want.

PromptMind is a prompt-building tool, not a task-execution tool. It does not write the requested document, email, or code itself; it writes the instructions for another AI to do that. See Prompt Generation Boundary.


Live Demo

Live Website: https://promptmind-ai.netlify.app/

Alternative Deployment: https://promptmind-nada.netlify.app/

GitHub Repository: https://github.com/nadaalamri-9/PromptMind

The backend is not exposed as a separate public URL in this repository's configuration; the deployed frontend talks to a backend deployment configured through its own environment variables.


Core Features

  • Category selection (General, Work, Education, Technology, Creative, Marketing, Personal)
  • Initial idea submission with a live character counter
  • Intent analysis of the user's idea
  • AI-generated, category-aware clarification questions with single/multiple-choice options and optional custom answers
  • Reusable prompt generation based on the idea, category, detected intent, and the user's answers
  • Prompt quality score (0–100) with a five-criterion breakdown
  • Improvement notes describing what the generated prompt added over the raw idea
  • Copy the generated prompt to the clipboard, from the result screen or from history
  • Local prompt history stored in the browser
  • Clear the entire local prompt history
  • Loading, success, timeout, and error states for both the clarification and generation requests, with real backend error messages surfaced to the user
  • Automatic smooth scroll to the generated-result card once it renders
  • Responsive layout for desktop and mobile
  • Detects the language of the user's idea (tested with English and Arabic) and responds in that language

How It Works

  1. The user selects a category and enters an idea.
  2. The backend analyzes the request and detects the user's intent.
  3. Clarification questions are generated when information is missing.
  4. The user answers the clarification questions (or provides a custom answer).
  5. The backend retrieves relevant prompt-engineering guidance from ChromaDB (RAG) to inform how the final prompt should be structured.
  6. PromptMind generates a reusable prompt for another AI tool, along with a quality score and improvement notes.
  7. The user copies the prompt or it is saved to local history for later.

RAG and ChromaDB are used only during final prompt generation (step 5–6). The clarification stage (steps 2–3) does not query the knowledge base — it is a single, focused call to detect intent and form questions, kept fast on purpose.


Prompt Generation Boundary

PromptMind never performs the user's underlying task. It does not write the requested PRD, email, article, codebase, or other deliverable.

Instead, it produces a complete, reusable prompt that instructs another AI to produce that deliverable.

Example:

  • User idea: "Create a PRD for PromptMind."
  • PromptMind output: a reusable prompt beginning with something like "Act as a professional Product Manager and create a concise Product Requirements Document..." — not an actual PRD.

System Architecture

User Idea + Category
    │
    ▼
React Frontend
    │
    ▼
FastAPI Backend
    │
    ▼
OpenAI analyzes the request
    │
    ▼
Clarification Questions
    │
    ▼
User Answers
    │
    ▼
ChromaDB retrieves relevant
prompt-engineering guidance (RAG)
    │
    ▼
OpenAI generates the final reusable prompt
    │
    ├── Reusable Prompt
    ├── Quality Score
    └── Improvement Notes

Tech Stack

Frontend

  • React
  • Vite
  • Vanilla CSS
  • Framer Motion

Backend

  • FastAPI
  • Python
  • OpenAI API (Responses API and Embeddings)
  • ChromaDB
  • Retrieval-Augmented Generation (RAG)

Deployment

  • Netlify (frontend)
  • Render (backend)

Project Structure

PromptMind/
├── backend/
│   ├── app/
│   │   ├── routes/
│   │   ├── services/
│   │   ├── rag/
│   │   ├── config.py
│   │   ├── exceptions.py
│   │   ├── schemas.py
│   │   └── main.py
│   ├── scripts/
│   ├── tests/
│   ├── .env.example
│   └── requirements.txt
│
├── frontend/
│   ├── public/
│   ├── src/
│   │   ├── assets/
│   │   ├── components/
│   │   ├── services/
│   │   ├── App.jsx
│   │   └── main.jsx
│   ├── .env.example
│   └── package.json
│
├── .gitignore
└── README.md

Local Setup

Prerequisites

  • Python 3.12 or later
  • Node.js and npm
  • An OpenAI API key

1. Clone the Repository

git clone https://github.com/nadaalamri-9/PromptMind.git
cd PromptMind

2. Start the Backend

cd backend
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -r requirements.txt
copy .env.example .env

Open backend/.env and add your OpenAI API key:

OPENAI_API_KEY=your_openai_api_key

Build the RAG knowledge base:

python scripts\index_knowledge.py --rebuild

Start the FastAPI development server:

uvicorn app.main:app --reload

The backend runs at http://localhost:8000. Interactive API docs are available at http://localhost:8000/docs.

3. Start the Frontend

Open a second terminal:

cd frontend
npm install
copy .env.example .env
npm run dev

The frontend runs at http://localhost:5173.


Environment Variables

Backend (backend/.env, see backend/.env.example)

Variable Purpose
OPENAI_API_KEY OpenAI API key used for analysis and generation
OPENAI_MODEL Chat/completions model used for analysis and generation
OPENAI_EMBEDDING_MODEL Embedding model used for RAG retrieval
CHROMA_PERSIST_DIRECTORY Path to the on-disk ChromaDB store
CHROMA_COLLECTION_NAME Name of the ChromaDB collection
FRONTEND_ORIGINS Allowed CORS origin(s) for the frontend
OPENAI_TIMEOUT_SECONDS Per-request timeout for OpenAI API calls
OPENAI_MAX_RETRIES Bounded retry attempts for transient OpenAI errors
RAG_TOP_K Number of chunks retrieved per RAG query
RAG_RELEVANCE_THRESHOLD Minimum similarity score for a retrieved chunk
APP_ENV Application environment name
LOG_LEVEL Logging verbosity

Frontend (frontend/.env, see frontend/.env.example)

Variable Purpose
VITE_API_BASE_URL Base URL of the backend API

Never commit real API keys or .env files.


Prompt Quality Score

PromptMind evaluates each generated prompt using five quality criteria, each worth 20 points:

Criterion Maximum Score
Goal clarity 20
Context completeness 20
Requirement specificity 20
Output definition 20
Ambiguity reduction 20
Total 100

The backend scores the generated prompt against each criterion and returns the total as the final quality score.


Data and Security

  • The OpenAI API key is stored only in backend/.env and is never sent to the frontend
  • Environment files must not be committed to GitHub
  • User prompts and answers are not stored in ChromaDB
  • ChromaDB contains only curated prompt-engineering reference material
  • Prompt history is stored locally in the browser using localStorage, not on a server
  • No user authentication system or user database is used

The following should never be committed:

backend/.env
frontend/.env
backend/.venv/
__pycache__/
backend/app/rag/chroma/

Testing

Backend

cd backend
pytest

This runs the full backend suite (request validation, the analyze and generate stages, retrieval, and health checks) against a mocked OpenAI client. A small set of opt-in, real-API verification tests also exists in backend/tests/test_generate_live.py; they are skipped by default and only run when RUN_LIVE_OPENAI_TESTS=1 is set, since they call the real OpenAI API.

Frontend

cd frontend
npm test

This runs the frontend suite (frontend/src/services/promptApi.test.js), which covers request handling, timeout behavior, and error messaging for the API layer.


Current Scope

In scope

  • The prompt creation workflow: idea, category, clarification questions, answers
  • AI-generated clarification questions
  • RAG-assisted reusable prompt generation
  • Prompt quality score and improvement notes
  • Local prompt history in the browser
  • Responsive desktop and mobile interface

Out of scope

  • User authentication
  • A permanent cloud database
  • Payments
  • Team collaboration
  • AI model selection by the user
  • Direct execution of the generated prompts

Future Improvements

  • Add prompt export options
  • Add reusable prompt templates
  • Support additional languages
  • Add optional user authentication
  • Add cloud-based prompt history
  • Expand the RAG knowledge base
  • Add prompt comparison features
  • Add prompt version history

Author

Nada Alamri

github.com/nadaalamri-9

Capstone Project — Vibe Coding Program by SDAIA Academy

About

AI prompt-building assistant that turns a rough idea into a clear, structured, reusable prompt using RAG-powered guidance and a quality score.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages