Skip to content

tuanle96/promptly

Repository files navigation

Promptly ๐Ÿš€

Transform vague prompts into clear, actionable instructions - promptly and thoughtfully

License: MIT Python 3.11+ FastAPI CrewAI

๐ŸŽฏ What is Promptly?

Promptly is an advanced Language-of-Thoughts (LoT) based prompt enhancement system that transforms vague, ambiguous prompts into clear, specific, and actionable instructions. Using a sophisticated multi-agent architecture powered by CrewAI, Promptly analyzes, expands, and refines your prompts to achieve dramatically better AI responses.

The Problem We Solve

In the era of AI-powered tools, the quality of your output is directly tied to the quality of your input. However, most users struggle with:

  • Vague language: "Write a good email" - what defines "good"?
  • Missing context: "Analyze this data" - which aspects? what format?
  • Ambiguous references: "Make it better" - better how? by what criteria?
  • Irrelevant noise: Including unnecessary information that confuses AI models

These issues lead to suboptimal AI responses, requiring multiple iterations and wasted time.

Our Solution

Promptly applies Language-of-Thoughts (LoT) methodology - a systematic approach to prompt analysis and enhancement that:

  1. Identifies ambiguities in your original prompt
  2. Expands vague concepts with specific, measurable criteria
  3. Removes irrelevant noise that distracts from your core intent
  4. Synthesizes everything into an optimized, clear prompt

Result: Get better AI responses on the first try, save time, and achieve your goals more effectively.

๐Ÿง  The Science Behind Promptly

Language-of-Thoughts (LoT) Methodology

Our approach is based on cognitive science research about how humans process and clarify thoughts. We've adapted these principles for AI prompt optimization:

OBSERVE ๐Ÿ” - Systematic Analysis

  • Extract entities, constraints, and intent
  • Detect L-implicit issues (local ambiguities like "good", "quickly")
  • Detect Q-implicit issues (contextual noise, irrelevant information)

EXPAND ๐Ÿ“ˆ - Intelligent Clarification

  • Replace vague terms with specific, measurable criteria
  • Add missing context using domain knowledge
  • Enhance completeness while preserving original intent

ECHO ๐Ÿ”„ - Focused Refinement

  • Remove irrelevant noise and distractions
  • Prioritize core information and requirements
  • Maintain clarity and actionability

SYNTHESIZE โœจ - Optimal Reconstruction

  • Combine processed information into the perfect prompt
  • Structure for maximum AI model comprehension
  • Ensure clarity, specificity, and actionability

Multi-Agent Architecture

Promptly employs specialized AI agents, each expert in one aspect of prompt enhancement:

  • Observer Agent: Analyzes prompt structure and identifies issues
  • Expander Agent: Clarifies ambiguities using knowledge base
  • Echo Agent: Removes noise and focuses on essentials
  • Synthesizer Agent: Creates the final optimized prompt
  • Manager Agent: Orchestrates the entire process intelligently

โœจ Key Features

๐ŸŽฏ Core Capabilities

  • Advanced LoT Processing: Systematic prompt analysis and enhancement
  • Multi-Agent System: Specialized AI agents for different enhancement tasks
  • Multiple Processing Modes: Fast (5s), Standard (15s), Comprehensive (45s)
  • Real-time Enhancement: WebSocket support for live prompt optimization
  • Batch Processing: Handle multiple prompts efficiently

๐Ÿ“Š Quality Assurance

  • Two-Layer Evaluation: Intrinsic (prompt quality) + Extrinsic (task performance)
  • LLM-as-Judge: Automated quality assessment
  • Comprehensive Metrics: Clarity, completeness, relevance scoring
  • Benchmark Testing: Validated against standardized test cases

๐Ÿš€ Production Ready

  • FastAPI Backend: High-performance async API
  • Authentication System: JWT tokens, API keys, role-based access
  • MCP Server Support: Model Context Protocol for AI tool integration
  • Docker Deployment: Complete containerized setup
  • Monitoring & Analytics: Real-time performance tracking

๐ŸŒŸ Why Promptly Matters

For Individual Users

  • Save Time: Get better AI responses on the first try
  • Improve Quality: Achieve more precise, actionable outputs
  • Learn Better Prompting: Understand what makes prompts effective
  • Reduce Frustration: Eliminate the trial-and-error cycle

For Businesses

  • Increase Productivity: Teams spend less time refining prompts
  • Standardize Quality: Consistent prompt quality across organization
  • Reduce AI Costs: Fewer API calls needed to get desired results
  • Scale AI Adoption: Make AI tools more accessible to non-experts

For Developers

  • API Integration: Easy integration into existing workflows
  • MCP Protocol: Standard interface for AI tool ecosystems
  • Customizable: Extend with domain-specific knowledge
  • Open Source: Transparent, auditable, and improvable

๐Ÿš€ Quick Example

Before (Vague):

"Write a good email to my boss about the project"

After Promptly Enhancement:

"Write a professional email to your supervisor with the following structure:

Subject: Clear, specific subject line about project status update

Content Structure:
- Formal greeting with supervisor's name
- Purpose: Clearly state you're providing a project update
- Current Progress: Specific milestones achieved with dates
- Key Accomplishments: 2-3 concrete achievements this week
- Challenges (if any): Brief description with proposed solutions
- Next Steps: Clear action items with timelines
- Request: Any support or decisions needed from supervisor

Tone: Professional, confident, solution-oriented
Length: 150-250 words for optimal readability
Format: Business email with proper greeting and closing"

Result: The enhanced prompt produces significantly better, more structured, and actionable email content.

๐Ÿ›ฃ๏ธ Roadmap

Phase 1: Foundation & Research ๐Ÿ“š

  • LoT methodology research and theoretical design
  • Multi-agent system architecture planning
  • Comprehensive implementation documentation
  • Core LoT processor implementation
  • Basic multi-agent system with CrewAI
  • Fundamental prompt enhancement pipeline
  • Initial evaluation framework

Phase 2: Core System ๐Ÿ”ง

  • Complete LoT processor with NLP components
  • Observer, Expander, Echo, Synthesizer agents
  • Sequential workflow implementation
  • Basic CLI interface
  • Unit testing framework
  • Performance benchmarking

Phase 3: Production API ๏ฟฝ

  • FastAPI backend implementation
  • Authentication and user management
  • REST API endpoints for prompt enhancement
  • Real-time WebSocket enhancement
  • MCP server integration
  • Docker deployment setup

Phase 4: Advanced Features ๐Ÿ“‹

  • Domain-specific knowledge bases
  • Custom agent training capabilities
  • Advanced analytics dashboard
  • Batch processing optimization
  • Team collaboration features
  • API rate limiting and optimization

Phase 5: Scale & Ecosystem ๐ŸŒŸ

  • Enterprise features and SLA
  • Third-party integrations (Slack, Discord, etc.)
  • Mobile applications
  • Community marketplace for custom agents
  • Advanced AI model support
  • Multi-language support

Future Vision ๐Ÿ”ฎ

  • Voice-to-prompt enhancement
  • Industry-specific prompt templates
  • AI prompt generation from goals
  • Collaborative prompt engineering platform
  • Advanced reasoning and context understanding

๐Ÿ—๏ธ Technical Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Observer Agent โ”‚    โ”‚ Expander Agent  โ”‚    โ”‚   Echo Agent    โ”‚
โ”‚   (OBSERVE)     โ”‚โ”€โ”€โ”€โ–ถโ”‚   (EXPAND)      โ”‚โ”€โ”€โ”€โ–ถโ”‚    (ECHO)       โ”‚
โ”‚ Analyze prompt  โ”‚    โ”‚ Clarify ambig.  โ”‚    โ”‚ Remove noise    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                                        โ”‚
                                                        โ–ผ
                                              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                                              โ”‚Synthesizer Agentโ”‚
                                              โ”‚   (SYNTHESIZE)  โ”‚
                                              โ”‚ Create final    โ”‚
                                              โ”‚ enhanced prompt โ”‚
                                              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Technology Stack

  • Backend: FastAPI, Python 3.11+
  • AI Framework: CrewAI for multi-agent orchestration
  • NLP: spaCy, Sentence Transformers
  • Database: PostgreSQL, Redis
  • Deployment: Docker, Nginx
  • Monitoring: Prometheus, Grafana

๐Ÿค Contributing

We welcome contributions from the community! Whether you're interested in:

  • Core Algorithm Improvements: Enhance LoT methodology
  • New Agent Types: Develop specialized enhancement agents
  • Integration Support: Add new platform integrations
  • Documentation: Improve guides and examples
  • Testing: Expand test coverage and quality assurance

Please see our Contributing Guide for details on how to get started.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Language-of-Thoughts Research: Cognitive science foundations
  • CrewAI: Multi-agent framework
  • FastAPI: High-performance API framework
  • spaCy: Advanced NLP processing
  • Open Source Community: For inspiration and collaboration

๐Ÿ“ž Connect With Us

๐Ÿงช Testing

Promptly includes comprehensive testing infrastructure:

# Run all tests
python run_tests.py

# Run specific test categories
python run_tests.py unit
python run_tests.py integration
python run_tests.py manual

# Run quick verification
python run_tests.py quick

# Generate coverage report
python generate_coverage.py

๐Ÿ“Š Coverage Status

Coverage

Current Coverage: 22% (38 unit tests passing)

Component Coverage Status
Core LoT Processor 99% โœ… Excellent
Core Models 98% โœ… Excellent
Configuration 90% โœ… Good
Core Utils 71% โš ๏ธ Needs improvement
Agent System 0% โŒ Needs tests
API Layer 0% โŒ Needs tests
LLM Manager 0% โŒ Needs tests
Workflows 0% โŒ Needs tests
MCP Server 0% โŒ Needs tests

Note: While overall coverage is 22%, the core LoT processing logic has 99% coverage. The low overall coverage is due to untested API layer and integration components, which are verified through manual testing.


Promptly - Because every great AI response starts with a great prompt ๐Ÿš€

Transform your vague ideas into precise instructions. Get better AI results. Save time. Achieve more.

About

Transform vague prompts into clear, actionable instructions - promptly and thoughtfully

Topics

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages