A RAG-powered prompt engineering platform with modality-specific optimization for Text, Image, Video, and System Prompts
System prompts are generated referencing frontier LLM providers (Claude, Cursor, v0, Gemini CLI)
Try it Live β’ Features β’ System Design β’ Architecture β’ Technologies β’ Contributing β’ Security
PromptTriage is an enterprise-grade prompt engineering platform that transforms rough ideas into production-ready AI prompts through RAG-powered retrieval and modality-specific optimization.
The platform excels at system prompt generation by referencing a curated corpus of frontier LLM system prompts from Claude Code, Cursor, v0, Windsurf, and Gemini CLIβensuring your prompts follow proven patterns from industry leaders.
- Pinecone RAG Architecture: 28K+ vectors for fast semantic retrieval of similar high-quality prompts
- Modality-Specific Prompts: Dedicated metaprompts for Text, Image, Video, and System Prompt generationβeach optimized for their domain
- MCP Tool Integration: Context7 integration provides live documentation lookup for current library APIs
- Fine-Tuning Ready: Curated datasets prepared for Unsloth QLoRA and custom model fine-tuning
PromptTriage isn't just a wrapperβit's built on our proprietary empirical research. We analyzed 28,000 production system prompts to extract what actually drives frontier model reasoning:
- The 50-Word Rule (Study E): Short prompts (<50 words, 80.1/100) consistently outperform long, bloated prompts (>300 words, 66.9/100). PromptTriage structures instructions into ruthless, boundary-focused directives.
- The Format Scaffold (Study E): Forcing models into JSON or YAML schemas acts as a cognitive scaffold, mathematically improving reasoning quality over plain text output.
- The "Expert" Trap (Study C): 80% of production prompts start with "Act as an expert." Our data proves this provides zero performance lift. PromptTriage strips out emotional appeals and persona bloat in favor of hard, negative constraints.
- Deep Context Understanding: Gemini analyzes your initial prompt to identify gaps, ambiguities, and missing context
- Risk Assessment: Automatically detects potential issues, biases, and edge cases in your prompt design
- Structured Blueprint Generation: Creates a comprehensive blueprint with intent, audience, success criteria, constraints, and evaluation checklists
- Context-Aware Questions: Generates 2-5 custom follow-up questions based on detected gaps
- Adaptive Intelligence: Questions evolve based on the target AI model, tone, and output requirements
- Efficient Information Gathering: Streamlined workflow to capture all necessary details
- Multi-Model Support: Optimized prompts for OpenAI GPT, Claude (Sonnet/Opus/Haiku), Gemini (Pro/Flash), Grok, and Mistral
- Structured Output: Generates markdown-formatted prompts with nine comprehensive sections
- Quality Guardrails: Includes assumptions, change summaries, and evaluation criteria for response validation
- Pinecone Vector Store: 28K+ embeddings for fast semantic retrieval
- Smart Retrieval: Uses Google's
gemini-embedding-001model (768d) to search across 28,000+ verified prompts - System Prompts Corpus: Curated library of 79+ system prompts from frontier models (Claude Code, Cursor, v0, Gemini CLI), professionally categorized and labeled
- Modality Routing: Automatic namespace selection based on prompt type (text β
system-prompts, image βimage-prompts, video βvideo-prompts)
- Unified Interface: Seamlessly switch between Text, Image, and Video generation modes.
- Context-Aware Refinement:
- Text: Focuses on system instructions, tone, and structure.
- Image: Optimizes for negative prompts, aspect ratios, and style descriptors.
- Video: Enhances temporal consistency, camera motion, and duration parameters.
- Output Format Selector: Force outputs into JSON, XML, Markdown, or tabular formats
- Desired Output Specification: Tell the AI what format your target model should respond in
- Thinking Mode: Enable deep analysis with extended reasoning for complex prompts
- Fast Mode (Non-Thinking): Powered by
TriageAgent 14B(our fine-tuned Qwen 3.0 14B model) for rapid iteration
- Context7: Live documentation lookup for current library APIs (Next.js 15, React 19, LangChain, etc.)
- Firecrawl (Optional): Web search to enrich prompts with real-world context when needed
- One-Click Rewrite: Generate alternative refinements without re-answering questions
- Metaprompt-Driven Consistency: Curated system prompts guide Gemini to maintain quality across generations
PromptTriage is built on RAG-powered retrieval and modality-specific optimization, not just API wrappers.
Before generating any prompt, the system queries a curated vector store to find similar high-quality prompts:
- Semantic Search: Pinecone vector store with 28K+ embeddings finds the most relevant reference prompts
- Modality Routing: Queries automatically route to the correct namespace (
system-prompts,video-prompts,image-prompts) - Frontier Model References: System prompt generation draws from Claude Code, Cursor, v0, Windsurf, and Gemini CLI patterns
Each modality has dedicated analyzer, fast mode, and refiner prompts:
- Text/System: Focuses on role definition, guardrails, and multi-turn behavior
- Image: Optimizes for composition, style keywords, and negative prompts
- Video: Enhances camera motion, temporal consistency, and duration compliance
- Versioned Prompts: Current version
2025-01-systemprompts-enhancedfor reproducibility
Curated examples provide format consistency alongside RAG retrieval:
- Domain examples (creative, analytical, technical) demonstrate target output structure
- Examples work with RAG context, not as the primary source of prompt patterns
The system uses a two-phase orchestration design with structured blueprints:
Phase 1 - Analysis:
- Extracts intent, audience, success criteria, constraints, risks
- Generates targeted follow-up questions (2-5 questions)
- Creates a structured blueprint with 10+ fields for later synthesis
- Validates completeness through confidence scoring
Phase 2 - Refinement:
- Reconciles the original prompt with blueprint, RAG context, and user answers
- Synthesizes a production-ready prompt with 9 standardized sections
- Generates usage guidance, change summaries, assumptions, and evaluation criteria
The platform integrates with MCP tools for real-time context:
- Context7: Fetches current library documentation during prompt generation
- Firecrawl: Optional web search for additional context enrichment
- Google OAuth 2.0: Secure authentication with Google Sign-In
- NextAuth.js Integration: Session management and authentication flows
- Environment-based Configuration: Secure API key management
- TypeScript-First: Full type safety across the application
- Modern Tooling: ESLint, Turbopack, and PostCSS for optimal development
- Responsive Design: Tailwind CSS-powered UI that works on all devices
βββββββββββββββββββ
β User Input β
β (Rough Idea) β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Analyzer API β
β /api/analyze β
β β
β ββββββββββββββββββββ ββββββββββββββββββββββββββββββββ β
β β Modality Router βββββΆβ RAG Service (FastAPI) β β
β β Text/Image/Video β β βββββββββββββββββββββββββββ β β
β ββββββββββββββββββββ β β Pinecone (28K+ Vecs) β β β
β β β βββββββββββββββββββββββββββ β β
β βΌ ββββββββββββββββββββββββββββββββ β
β ββββββββββββββββββββ β
β β Metaprompt ββββββββ 9 Modality-Specific Prompts β
β β (v2025-01) β + RAG Context β
β ββββββββββββββββββββ ββββββββββββββββββββββββββββββββ β
β β β MCP Tools β β
β βΌ β β’ Context7 MCP β Live Docs β β
β ββββββββββββββββββββ β β’ Firecrawl β Web Search β β
β β AI Generation β ββββββββββββββββββββββββββββββββ β
β ββββββββββββββββββββ β
β β β
β β’ Blueprint Generation β
β β’ Follow-up Questions β
βββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β User Answers β
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Refiner API β
β /api/refine β
β β
β ββββββββββββββββββββ ββββββββββββββββββββββββββββββββ β
β β Modality-Specific β β Blueprint + RAG Context β β
β β Refiner Prompt βββββΆβ + User Answers β β
β ββββββββββββββββββββ ββββββββββββββββββββββββββββββββ β
β β β
β βΌ β
β β’ Production-Ready Prompt β
β β’ Negative Prompts (Image/Video) β
β β’ Evaluation Criteria β
βββββββββββββ¬ββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββ
β Final Prompt β
β (AI-Ready) β
βββββββββββββββββββ
app/page.tsx: Main UI with modality selection and form orchestrationcomponents/: ModalitySelector, OutputFormatSelector, DesiredOutputSelector, ImageUploader, ErrorFeedback, PipelineProgressservices/: RAG client, Context7 MCP integration, Firecrawl clientlib/: PipelineLogger (structured agentic logging)
analyze/route.ts: Prompt analysis with modality routing and RAG contextrefine/route.ts: Prompt refinement with modality-specific system prompts
app/routers/rag.py: RAG endpoints with Pinecone retrievalapp/services/rag.py: RAG service with modality-based namespace routingscripts/: Dataset ingestion and labeling pipelines
metaprompt.ts: 9 modality-specific system promptsANALYZER_SYSTEM_PROMPT/FAST_MODE_SYSTEM_PROMPT/REFINER_SYSTEM_PROMPT(Text)IMAGE_ANALYZER_SYSTEM_PROMPT/IMAGE_FAST_MODE_SYSTEM_PROMPT/IMAGE_REFINER_SYSTEM_PROMPTVIDEO_ANALYZER_SYSTEM_PROMPT/VIDEO_FAST_MODE_SYSTEM_PROMPT/VIDEO_REFINER_SYSTEM_PROMPTSYSTEM_PROMPT_ANALYZER/SYSTEM_PROMPT_FAST_MODE/SYSTEM_PROMPT_REFINER
- Version Control:
PROMPT_VERSION = "2025-01-systemprompts-enhanced"
- Next.js 15.1.6: React framework with App Router
- React 19.0.0: UI component library
- TypeScript 5: Type-safe development
- Tailwind CSS 3.4: Utility-first styling
- Thinking Mode: Deep reasoning powered by
gemini-3.1-pro - Fast Mode: Standard generation powered by our fine-tuned
TriageAgent 14B(Qwen 3.0 14B) - Advanced Configuration: Corrective RAG (CRAG) architecture with Brave Search fallback
- Retrieval Engine:
GTE-ModernBERTembeddings for state-of-the-art vector similarity across 28K+ vectors - 9 Modality Metaprompts: Text, Image, Video, System Prompt specializations
- Context7: Live library documentation lookup
- Firecrawl (Optional): Web search for context enrichment
- NextAuth.js 4.24: Google OAuth 2.0 authentication
- Node.js 20+: JavaScript runtime
- Python 3.9+: Backend runtime
- AI Product Development: Generate production-ready prompts for AI features
- Content Creation: Craft precise prompts for copywriting, marketing, and creative work
- Data Analysis: Structure prompts for analytical tasks and reporting
- Research: Formulate clear research questions and analysis frameworks
- Education: Teach effective prompt engineering techniques
- Automation: Create consistent, reusable prompt templates
- Input: User provides rough idea + selects modality (Text/Image/Video/System)
- RAG Retrieval: System queries Pinecone for similar high-quality prompts
- Modality Routing: Appropriate analyzer prompt is selected based on modality
- Analysis: AI generates structured blueprint with gaps and questions
- Clarification: User answers 2-5 targeted follow-up questions
- Refinement: Blueprint + RAG context + answers are synthesized
- Generation: Production-ready prompt with modality-specific optimizations
- Iteration: One-click rewrite or modify with custom instructions
Generated prompts include nine comprehensive sections:
- Context: Background and situational information
- Objective: Clear goal statement
- Constraints: Limitations and boundaries
- Audience: Target users or stakeholders
- Tone & Style: Communication approach
- Format: Expected output structure
- Examples: Reference cases (when applicable)
- Success Criteria: Evaluation metrics
- Additional Notes: Edge cases and considerations
Plus metadata:
- Usage Guidance: How to use the prompt effectively
- Change Summary: What was refined from the original
- Assumptions Made: Inferred context
- Evaluation Checklist: Quality validation points
- Pinecone RAG pipeline (28K+ vectors)
- 9 modality-specific metaprompts
- Context7 MCP integration (direct
mcp.context7.com) - System prompt corpus from frontier models
- Google OAuth authentication
- Error feedback UX (inline form + GitHub issues)
- Chain-of-thought loading indicator
- Pipeline logging (PipelineLogger)
- Open-sourcing the 28K Prompts empirical dataset
- Deploying predictive Prompt Performance Analytics based on Study E findings
- Public API with rate limiting
- Automated A/B testing and format permutation generator
- Multi-LLM provider support (OpenAI, Anthropic)
- Unsloth QLoRA tuning pipelines for enterprise clients
This is an early-stage project and I'm currently the only developer β so if you spot something broken, confusing, or just have an idea, please don't be shy!
- π Something broken? Open an issue β even a one-liner helps
- π‘ Got an idea? Start a discussion or drop a feature request
- π§ Want to contribute code? PRs are welcome, big or small
See the Contributing Guidelines for setup instructions and conventions.
Security is a top priority. Please see our Security Policy for:
- Reporting vulnerabilities
- Security best practices
- Disclosure policy
This project is licensed under the terms specified in the LICENSE file.
- Google Gemini Team: For Gemini API and embeddings powering generation and RAG
- Pinecone: For the vector database infrastructure
- Frontier Model Providers: Claude, Cursor, v0, Windsurfβwhose system prompts informed our corpus
- Open Source Community: For the amazing tools and libraries
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Built with β€οΈ using RAG pipelines, modality-specific prompts, and frontier model patterns
Not just an API wrapperβa specialized prompt engineering system