Best Practices and Advanced Concepts

Task Design

The effectiveness of the Parallel Task API depends heavily on well-designed tasks. Here are the key principles and patterns for creating robust, well-specified tasks.

Anatomy of an Effective Task

Below is a complete example of a Task. It includes the Task Spec, Input Schema and Output Schema.

{
    "name": "Regulatory Requirements",
    "description": "Analyze specific regulatory requirements by jurisdiction",
    "prompt": """
    Research the current requirements for ${regulation_type} in ${jurisdiction}.

    Specifically determine:
    1. Required filings or registrations
    2. Key deadlines and frequencies
    3. Recent changes (within last 12 months)
    4. Exemptions or special cases

    Focus on official government sources and regulatory bodies.
    Provide specific citations for all findings.
    """,
    "processor": "rhodium",
    "input_schema": {
        "properties": {
            "regulation_type": {
                "type": "string",
                "enum": ["data_privacy", "consumer_protection", "financial_reporting"]
            },
            "jurisdiction": {
                "type": "string",
                "description": "Country or US state"
            }
        }
    },
    "output_schema": {
        "properties": {
            "requirement_category": {
                "type": "string",
                "enum": ["new_requirement", "changed_requirement", "deleted_requirement", "updated_requirement", "other"],
                "description": "The type of requirement change"
            },
            "requirement_description": {
                "type": "string",
                "description": "A description of the requirement"
            },
            "requirement_deadline": {
                "type": "string",
                "format": "date",
                "description": "The deadline for the requirement"
            },
            "change_description": {
                "type": "string",
                "description": "A description of the change"
            },
            "change_date": {
                "type": "string",
                "format": "date",
                "description": "The date the change was made"
            },
            "source": {
                "type": "string",
                "description": "The source of the requirement"
            }
        }
    }
}

Prompt Design Principles

  1. Be Specific
❌ "Find information about the company's leadership"
✅ "Identify the current CEO, CFO, and CTO, including their start dates,
    prior roles, and key initiatives launched under their leadership"
  1. Structure the Research Process
✅ "Follow these steps:
    1. Check official company websites and press releases
    2. Verify against regulatory filings
    3. Cross-reference with reputable news sources
    4. Note any discrepancies between sources"
  1. Define Source Requirements
✅ "Prioritize sources in this order:
    1. Government/regulatory documents
    2. Official company materials
    3. Reputable financial news outlets
    Exclude: Social media, personal blogs, forums"
  1. Specify Validation Criteria
✅ "For each finding:
    - Require at least two independent sources
    - Note the publication date of each source
    - Flag any conflicting information
    - Indicate confidence level based on source quality"
  1. Handle Edge Cases ✅ “If information is not available or unclear:
    • For example, if the company is not public, use best available sources of information on the private company

    • Specify using most current financial periods as of November 2024

    • Example: ‘As of November 2024, the company’s most current financial period is FY2023. The company’s revenue for FY2023 is $1.2 billion, as reported in their FY2023 annual report.’”

    • Report what was found

    • Note specific gaps

    • Explain what was searched

    • Suggest alternative approaches

Input Schema Best Practices

Use Enums for known values:

{
    "industry": {
        "type": "string",
        "enum": ["fintech", "healthcare", "retail"],
        "description": "Primary industry sector"
    }
}

Output Schema Patterns

Include confidence scoring in the schema. This is a value outputted by our system that indicates how similar the answers of multiple runs would be. The higher the confidence, the higher the likelihood of the response matching the exact ground truth.

{
    "findings": {
        "type": "array",
        "items": {
            "type": "object",
            "properties": {
                "fact": {"type": "string"},
                "confidence": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                },
                "sources": {
                    "type": "array",
                    "items": {"type": "string"}
                }
            }
        }
    }
}