An AI-powered prompt optimization companion that elevates your interactions with ChatGPT, Claude, and Gemini in real-time. By injecting an optimization layer directly into your favorite AI interfaces, PromptPilot AI refines, scores, and structures your prompts for maximum performance using advanced prompt engineering patterns.
PromptPilot AI is designed with a decoupled, high-performance architecture:
graph TD
subgraph Browser [Client-Side Browser Extension]
UI[ChatGPT / Claude / Gemini UI] -->|Injects Button| CS[Content Script]
CS -->|Message| BG[Service Worker / Background Script]
end
subgraph Server [Backend Stack - Docker Compose]
BG -->|POST /api/prompts/optimize| SB[Spring Boot API Gateway]
SB -->|Caching| RD[(Redis)]
SB -->|Persistence| DB[(PostgreSQL)]
SB -->|Optimizes via Spring AI| OpenAI[OpenAI API]
SB -->|Exposes Metrics| Prom[Prometheus]
Prom -->|Visualizes| Graf[Grafana]
end
- Chrome Extension (Manifest V3): Detects the active text area on chatgpt.com, claude.ai, and gemini.google.com, and injects a premium Optimize button. It routes request payloads through a background script to bypass Content Security Policies (CSP).
- Spring Boot Backend: Powered by Java 21, Spring Boot, and Spring AI to interface with OpenAI.
- Redis Caching: Caches optimized prompts to minimize OpenAI API usage and latency.
- PostgreSQL Database: Persists prompt-optimization history.
- Observability Stack: Spring Boot Actuator exposes health status and Prometheus metrics, which are scraped by Prometheus and visualized via Grafana.
- Direct UI Injection: Integrates cleanly into ChatGPT, Claude, and Gemini input boxes.
- Deep Prompt Analysis:
- Evaluates user intent and injects clear context and target roles.
- Adds formatting instructions and explicit constraints.
- Returns a refined version of the prompt, a quality score, and a list of missing information fields.
- Response Caching: Prevents redundant upstream API calls using Redis.
- Audit History: Automatically saves prompt refinement history (original prompt, optimized prompt, and score) to PostgreSQL.
- Production Observability: Built-in Grafana and Prometheus configurations to monitor API latency, JVM metrics, and application performance.
- Backend: Java 21, Spring Boot 3.x, Spring AI, Hibernate/JPA, Lombok
- Datastore & Cache: PostgreSQL 16, Redis 7
- Browser Extension: HTML5, CSS3, JavaScript (Chrome Extension Manifest V3)
- Monitoring: Prometheus, Grafana, Spring Boot Actuator
- Deployment: Docker, Docker Compose
- Docker & Docker Compose
- Google Chrome (or any Chromium-based browser)
- An OpenAI API Key
Create a .env file in the project root:
OPENAI_API_KEY=your-actual-openai-api-keyFrom the root directory, start all services (Database, Redis, Spring Boot Backend, Prometheus, and Grafana) in detached mode:
docker compose up -dVerify that all services are running:
docker compose psServices will be exposed on:
- Spring Boot Backend:
http://localhost:8080 - Prometheus:
http://localhost:9090 - Grafana Dashboard:
http://localhost:3000
- Open Chrome and navigate to
chrome://extensions/. - Enable Developer mode (toggle in the top-right corner).
- Click Load unpacked in the top-left corner.
- Select the
extension/folder from this project directory. - PromptPilot AI is now active!
- Open ChatGPT or Claude or Gemini.
- You will see a premium ✨ Optimize button next to or inside the prompt text area.
- Type a draft prompt (e.g.,
"write an email to my boss asking for a raise"). - Click Optimize.
- The button will change to Optimizing..., send the prompt to your local Spring Boot backend, and insert the fully engineered prompt directly back into your text editor.
PromptPilot/
├── Backend/ # Spring Boot application
│ ├── Dockerfile # Multi-stage JVM runtime build
│ ├── src/ # Spring Boot controllers, services, and configs
│ └── pom.xml # Maven dependencies (including Spring AI)
├── extension/ # Chrome Extension source
│ ├── manifest.json # Extension configuration
│ ├── background.js # Background worker for API routing (CORS bypass)
│ ├── content/ # DOM adapters for ChatGPT, Claude, and Gemini
│ └── styles/ # Extension UI styling
├── prometheus/ # Prometheus scraping configuration
├── grafana/ # Grafana datasource provisioning
├── docker-compose.yml # Production-ready compose orchestration
└── .env # Local environment file (API keys)
The backend exposes system metrics under /actuator/prometheus.
- Prometheus scrapes these metrics every 5 seconds.
- Grafana is pre-configured with a Prometheus datasource. You can access it at
http://localhost:3000(Default login:admin/admin).