PromptLab MCP Server

Integrations

  • Used for environment variable management to configure the PromptLab server with API keys and other settings

  • Enables version control and contribution workflows for the PromptLab project

  • Hosts the repository and provides collaboration features for contributing to PromptLab

PromptLab: AI 쿼리 향상 엔진

PromptLab은 기본적인 사용자 질의를 AI 시스템에 최적화된 프롬프트로 변환합니다. 콘텐츠 유형(에세이, 이메일, 기술 설명, 창작물 등)을 자동으로 감지하고, 맞춤형 템플릿을 적용하며, 향상된 프롬프트가 원래 의도를 유지하는지 검증합니다.

🔍 개요

PromptLab은 모듈형 아키텍처와 YAML 기반 템플릿 시스템을 기반으로 구축되어 누구나 코딩 지식 없이도 프롬프트 템플릿을 생성하고 관리할 수 있습니다. 궁극적으로 이 시스템은 더욱 체계화된 입력을 통해 더욱 높은 품질의 AI 응답을 생성합니다.

🏗️ 건축

PromptLab은 세 가지 주요 구성 요소로 구성됩니다.

  1. 템플릿 시스템 ( prompt_templates.yaml ) - 다양한 콘텐츠 유형에 대한 구조화된 템플릿
  2. MCP 서버 ( promptlab_server.py ) - LangGraph Workflow를 통해 표준화된 프로토콜을 통해 템플릿을 제공합니다.
  3. 처리 클라이언트 ( promptlab_client.py ) - 사용자 쿼리를 처리하는 씬 클라이언트

워크플로 프로세스

  1. 쿼리 입력 : 사용자가 자연어 쿼리를 제출합니다.
  2. 분류 : 시스템이 콘텐츠 유형(논문, 이메일 등)을 결정합니다.
  3. 매개변수 추출 : 주요 매개변수를 식별합니다(주제, 대상 고객 등)
  4. 템플릿 적용 : 적절한 템플릿을 검색하여 채웁니다.
  5. 검증 : 향상된 프롬프트가 원래 의도와 일치하는지 확인합니다.
  6. 조정 : 필요한 모든 세부 조정이 자동으로 이루어집니다.
  7. 응답 생성 : 최적화된 프롬프트는 고품질의 응답을 생성합니다.

📋 특징

  • 콘텐츠 유형 감지 - 사용자 질의를 에세이, 이메일, 기술 또는 창의적 글쓰기 요청으로 자동 분류합니다.
  • 매개변수 추출 - 주제, 수신자, 대상 수준과 같은 주요 매개변수를 지능적으로 추출합니다.
  • 템플릿 라이브러리 - 구조화된 지침이 포함된 일반적인 콘텐츠 유형에 대한 사전 구성된 템플릿
  • 검증 시스템 - 향상된 프롬프트가 원래 사용자 의도를 유지하도록 보장합니다.
  • 피드백 루프 - 검증을 통해 정렬 오류를 식별하면 프롬프트를 조정합니다.
  • 모듈식 디자인 - MCP 서버는 모든 LLM 시스템에 플러그인될 수 있습니다.
  • 비기술적 관리 - 코딩 지식 없이도 템플릿을 업데이트할 수 있습니다.

🚀 시작하기

필수 조건

  • 파이썬 3.8 이상
  • 종속성:
    • mcp[cli]
    • langchain-openai
    • langgraph>=0.0.20
    • python-dotenv
    • pyyaml

설치

지엑스피1

용법

  1. 서버를 실행하여 시작하세요.
# The server loads templates from prompt_templates.yaml python promptlab_server.py
  1. 귀하의 쿼리로 클라이언트를 실행하세요:
python promptlab_client.py "Write an essay about climate change"
  1. 시스템은 다음을 출력합니다.
    • 원래 쿼리
    • 분류된 콘텐츠 유형
    • 향상된 프롬프트
    • 검증 결과
    • 최종 응답

📝 템플릿 시스템

템플릿은 구조화된 형식을 사용하여 prompt_templates.yaml 에 정의됩니다.

templates: essay_prompt: description: "Generate an optimized prompt template for writing essays." template: | Write a well-structured essay on {topic} that includes: - A compelling introduction that provides context and states your thesis ... parameters: - name: topic type: string description: The topic of the essay required: true

새 템플릿 추가

  1. prompt_templates.yaml 엽니다.
  2. 기존 형식에 따라 새 템플릿을 추가합니다.
  3. 매개변수와 변환을 정의합니다
  4. 서버 측에서 도구를 정의하고 템플릿을 로드합니다.
  5. 서버는 재시작 시 자동으로 새 템플릿을 로드합니다.

🛠️ 고급 구성

환경 변수

  • TEMPLATES_FILE - 템플릿 YAML 파일 경로(기본값: prompt_templates.yaml )
  • OPENAI_API_KEY - LLM 액세스를 위한 OpenAI API 키
  • MODEL_NAME - 사용할 OpenAI 모델(기본값: gpt-3.5-turbo )
  • PERSONA_SERVER_SCRIPT - 서버 스크립트 경로(기본값: promptlab_server.py )

사용자 정의 변환

템플릿에는 매개변수를 동적으로 조정하는 변환이 포함될 수 있습니다.

transformations: - name: formality value: "formal if recipient_type.lower() in ['boss', 'client'] else 'semi-formal'"

📊 출력 예시

입력 쿼리

"교수님께 재생 에너지에 대해 뭔가 써주세요"

향상된 프롬프트

Write a well-structured essay on renewable energy that includes: - A compelling introduction that provides context and states your thesis - 2-3 body paragraphs, each with a clear topic sentence and supporting evidence - Logical transitions between paragraphs that guide the reader - A conclusion that synthesizes your main points and offers final thoughts The essay should be informative, well-reasoned, and demonstrate critical thinking.

📄 라이센스

MIT 라이선스 - 자세한 내용은 라이선스 파일을 참조하세요.

🤝 기여하기

기여를 환영합니다! 풀 리퀘스트를 제출해 주세요.

  1. 저장소를 포크하세요
  2. 기능 브랜치를 생성합니다( git checkout -b feature/amazing-feature )
  3. 변경 사항을 커밋하세요( git commit -m 'Add some amazing feature' )
  4. 브랜치에 푸시( git push origin feature/amazing-feature )
  5. 풀 리퀘스트 열기
-
security - not tested
A
license - permissive license
-
quality - not tested

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

기본 사용자 쿼리를 AI 시스템에 최적화된 프롬프트로 변환하기 위해 표준화된 프로토콜을 통해 프롬프트 템플릿을 제공합니다.

  1. 🔍 Overview
    1. 🏗️ Architecture
      1. Workflow Process
    2. 📋 Features
      1. 🚀 Getting Started
        1. Prerequisites
        2. Installation
        3. Usage
      2. 📝 Template System
        1. Adding New Templates
      3. 🛠️ Advanced Configuration
        1. Environment Variables
        2. Custom Transformations
      4. 📊 Example Outputs
        1. Input Query
        2. Enhanced Prompt
      5. 📄 License
        1. 🤝 Contributing
          ID: i3tad94sjm