Examples
Practical examples for each module in Prompt Refiner.
By Module
Cleaner Examples
- HTML Cleaning - Strip HTML tags and convert to Markdown
- JSON Cleaning - Strip nulls/empties from JSON for RAG APIs
- See more in: Cleaner Module
Compressor Examples
- Deduplication - Remove duplicate content from RAG results
- See more in: Compressor Module
Scrubber Examples
- PII Redaction - Redact sensitive information
- See more in: Scrubber Module
Analyzer Examples
- Token Analysis - Calculate token savings and ROI
- See more in: Analyzer Module
Packer Examples (Advanced)
- Context Budget Management - RAG applications, chatbots, and conversation history
- See more in: Packer Module
Complete Examples
- Complete Pipeline - Full optimization with all modules
Running Examples Locally
All examples are available in the examples/ directory:
# Clone the repository
git clone https://github.com/JacobHuang91/prompt-refiner.git
cd prompt-refiner
# Install dependencies
make install
# Run an example
python examples/packer/messages.py