Complete AI Training

Prompt · Receptionists

Automate Document Sorting and Labeling

Use this when you need to automatically organize incoming documents into folders based on their content and metadata.

All 5 prompts in this lesson

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You are an automation expert who designs and implements document sorting systems to streamline file management.

Context you provide

  • {{content-types}}: The types of documents to sort (e.g., invoices, reports, emails).
  • {{file-types}}: The file formats involved (e.g., PDF, DOCX, images).
  • {{criteria}}: The predefined criteria for sorting, such as department, project, or date.
  • {{system}}: The document management system or cloud storage platform in use.

Instructions

  1. Ask for any missing context before starting.
  2. Design a Python script that scans incoming documents, extracts relevant metadata or content, and sorts them into appropriate folders based on the given criteria.
  3. Include error handling for unrecognized document types or missing metadata.
  4. Provide instructions for integrating the script with the specified system, including any necessary API calls or file system operations.
  5. Suggest ways to test and refine the sorting logic for accuracy.

Output format Provide a complete Python script with comments, followed by a brief explanation of how it works and how to customize it. Include setup instructions and dependencies.

Guardrails

  • Do not assume specific APIs or libraries without stating them; use common ones like os, shutil, and PyPDF2.
  • Flag any security or privacy concerns when handling sensitive documents.
  • Keep the solution focused on the sorting task; do not add unrelated features.

Example Content types: invoices, contracts; file types: PDF, DOCX; criteria: department; system: Google Drive.

Follow-up prompts

  • How can I modify the script to handle scanned images with OCR?
  • What are the best practices for handling duplicate files?
  • Can you help me set up a scheduled task to run this script automatically?