PromptConductor is an Enterprise Prompt Optimization platform built on Next.js, Firebase, and Google Cloud Platform. It uses Retrieval-Augmented Generation (RAG) via Vertex AI Search to dynamically fetch structural constraints for specific AI models, and leverages the Gemini SDK to rewrite and optimize user prompts in real time via Server-Sent Events (SSE).
- Streaming Architecture: Immediate, token-by-token prompt optimizations delivered via Next.js Route Handlers.
- Dynamic Retrieval: Integrates with Vertex AI Search to inject model-specific constraints into the LLM orchestration flow.
- Secure by Default: Protected by Firebase Authentication (Google OAuth), strict Firestore Security Rules, and Edge-level rate limiting.
- Serverless Scaling: Built for deployment on Firebase App Hosting (Cloud Run), leveraging Application Default Credentials (ADC) for zero-trust IAM operations.
Comprehensive documentation is available in the docs/ directory:
- Node.js v18+
- Firebase CLI (
npm install -g firebase-tools) - A Google Cloud Platform project with the Vertex AI and Discovery Engine APIs enabled.
-
Clone the repository:
git clone <your-repo-url> cd promptconductor
-
Install Dependencies:
npm install
-
Environment Configuration: Create a
.env.localfile in the root directory:# Firebase Web SDK Configuration NEXT_PUBLIC_FIREBASE_API_KEY="..." NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN="..." NEXT_PUBLIC_FIREBASE_PROJECT_ID="..." NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET="..." NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID="..." NEXT_PUBLIC_FIREBASE_APP_ID="..." # Server-side GCP / Vertex AI Variables GCP_PROJECT_ID="newmum-copd-app-1234" VERTEX_DATA_STORE_ID="model-docs-datastore" VERTEX_SEARCH_ENGINE_ID="model-docs-search" # For local development bypasses (Mock Auth / Rate Limits) LOCAL_DEV_MODE="true" # GCP Service Account (Local Only - ADC is used in production) GCP_SA_KEY_PATH="./service-account.json"
-
Start the Development Server:
npm run dev
Open http://localhost:3000 in your browser.
This application is designed specifically for Firebase App Hosting.
- Ensure your public Firebase credentials and server-side keys are mapped in
apphosting.yaml. - Securely store your Gemini API Key in Google Cloud Secret Manager.
- Deploy via the Firebase CLI:
firebase deploy --only apphosting
This project is proprietary and confidential.