A production-grade prompt optimization and reliability engine that transforms raw ideas into structured, validated, and enterprise-ready AI instructions.
- 6-Stage Pipeline: Optimize → Review → Risk Detection → Hardening → Test Cases → Metadata
- 5 Output Modes:
general_llm- Standard prompts for ChatGPT, Claude, etc.custom_gpt- GPT Builder configuration formatagent- AI agent system promptsjson- Structured JSON for APIs/automationaction_schema- OpenAPI 3.1.0 schemas for tool-calling
- Prompt Hardening: Anti-hallucination safeguards, clarification rules, edge case handling
- Risk Detection: Identify failure points, ambiguity, and hallucination risks
- Multi-Provider Support: OpenAI, Gemini, Anthropic (via LiteLLM), local models (via Ollama)
- Memory Integration: Prompt engineering notes for better outputs
# Clone and install
git clone <repo-url>
cd prompt-optimization-agent
pip install -e .
# Run CLI
prompt-optimization-cli
# Or run UI
streamlit run src/prompt_optimization_agent/ui.pyFor detailed guides and reference:
| Guide | Description |
|---|---|
| Setup Guide | Installation and configuration |
| Usage Guide | CLI and UI usage |
| API Reference | Core classes and functions |
| Testing | Testing procedures |
| Output Format | Result file structure |
User Input → Optimize → Review → Risk Detection → Hardening → Test Cases → Metadata → Output
src/prompt_optimization_agent/
├── agent/
│ ├── orchestrator.py # Pipeline orchestration
│ ├── prompt_generator.py # Prompt optimizer
│ ├── prompt_hardener.py # Hardening agent
│ ├── prompt_reviewer.py # Review agent
│ ├── risk_detector.py # Risk analysis
│ ├── test_case_generator.py
│ ├── prompts/ # Agent prompts
│ └── memory/ # Memory system
├── core/
│ ├── config/ # Configuration
│ ├── providers/ # LLM providers
│ └── utils/ # Utilities
└── ui.py # Streamlit UI
MIT