Skip to main content

Managing AI Prompts

This guide covers how administrators configure and manage the AI prompts that power the risk assessment pipeline. Prompt management is restricted to users with Admin role.
Admin Access Required: All prompt management features require administrator privileges. Regular users cannot view or edit prompts.

Overview

AI prompts define how the system analyzes business documents and generates risk assessments. The platform uses prompts across 7 risk analysis sections:
  • Parser - Extracts structured data from PDFs
  • Gap Detection - Identifies missing information
  • Risk Analysis - Evaluates risks for each category
  • Recommendations - Generates actionable advice
  • Report Generation - Creates final assessment reports
  • Quality Assurance - Validates analysis outputs
  • Summarization - Produces executive summaries

Accessing Prompt Manager

2
  • Click your profile menu in the top-right corner
  • Select “Admin Panel” from the dropdown
  • Click “Prompt Manager” in the admin navigation
  • 3
    Prompt List View
    4
    The main prompt manager displays all prompts in a grid of cards. Each card shows:
    5
  • Name: Prompt identifier
  • Section: Which analysis stage it belongs to
  • Version: Current version number (e.g., v3)
  • Active/Inactive badge: Deployment status
  • Tags: Categorization labels
  • Last updated: Timestamp of most recent edit
  • Filtering and Searching Prompts

    Use the toolbar filters to find specific prompts:

    Available Filters

    FilterOptionsPurpose
    SectionParser, Gap Detection, Risk Analysis, etc.Filter by analysis stage
    StatusActive, Inactive, AllShow only deployed or draft prompts
    TagsMultiple selectionFilter by category tags
    SearchText inputSearch by name or content
    RouteAPI endpoint pathsFilter by routing configuration

    Creating a New Prompt

    1
    Open Prompt Editor
    2
    Click “Create New Prompt” in the top-right corner of the Prompt Manager.
    3
    Enter Basic Information
    4
    Fill in the required fields:
    5
    Required Fields:
    6
  • Name: Descriptive identifier (e.g., “Financial Risk Analysis - Detailed”)
  • Section: Select from dropdown (determines when this prompt runs)
  • System Prompt: Base instructions for the AI model
  • User Prompt Template: Dynamic template with variable placeholders
  • 7
    Optional Fields:
    8
  • Route: API endpoint path (for custom routing)
  • Sub-Section: Additional categorization
  • Tone: Desired output style (e.g., “Professional and informative”)
  • Output Format: Structure requirements (e.g., JSON schema)
  • 9
    Configure System Prompt
    10
    The system prompt sets the AI’s role and base instructions.
    11
    Example:
    12
    You are an expert agricultural risk analyst specializing in 
    evaluating market risks for small and medium enterprises in 
    East Africa. Your analysis should be thorough, data-driven, 
    and actionable for non-technical stakeholders.
    
    13
    Best Practices:
    14
  • Define the AI’s expertise area
  • Specify the target audience
  • Set expectations for output quality
  • Include relevant context about CGIAR’s focus
  • 15
    Build User Prompt Template
    16
    The user prompt template is sent with each analysis request and supports variable injection.
    17
    Available Variables:
    18
  • {{category_1}}, {{category_2}}, etc. - Individual category names
  • {{categories}} - Comma-separated list of all categories
  • Custom variables defined in your integration
  • 19
    Example:
    20
    Analyze the following {{category_1}} risks for this agricultural 
    business. Consider:
    
    1. Historical market volatility
    2. Supply chain dependencies  
    3. Price fluctuation patterns
    4. Competition landscape
    
    Provide a risk score (0-100) and detailed evidence for your assessment.
    
    21
    Variable Replacement: Variables are automatically replaced at runtime with actual category names and data from the current assessment.
    22
    Add Categories and Tags
    23
    Organize your prompt with metadata:
    24
    Categories: Risk categories this prompt applies to
    25
  • Click the category input field
  • Type a category name (e.g., “Market Risk”, “Financial Risk”)
  • Press Enter to add
  • Click × to remove
  • 26
    Tags: Searchable labels for filtering
    27
  • Enter tag text (converted to lowercase with hyphens)
  • Press Enter to add
  • Use tags like: agriculture, sme, detailed-analysis
  • 28
    Set Tone and Output Format
    29
    Optional fields for fine-tuning:
    30
    Tone: Describe the desired writing style
    31
  • Professional and informative
  • Conversational and accessible
  • Technical and detailed
  • Concise and action-oriented
  • 32
    Output Format: Specify structure requirements
    33
    {
      "riskScore": 0-100,
      "level": "LOW|MODERATE|HIGH|CRITICAL",
      "evidence": "string",
      "recommendations": ["string"]
    }
    
    34
    Toggle Active Status
    35
    Use the Active/Inactive switch at the bottom:
    36
  • Active (green): Prompt is live and used in production
  • Inactive (gray): Prompt is saved but not deployed
  • 37
    Single Active Prompt Rule: Only one prompt per section should be active at a time. Activating a new prompt may automatically deactivate others in the same section.
    38
    Save the Prompt
    39
    Click “Create Prompt” to save. The system:
    40
  • Creates version 1 (v1) of the prompt
  • Stores a complete snapshot
  • Redirects you to the prompt list
  • Editing Existing Prompts

    1
    Open Prompt for Editing
    2
    From the prompt list:
    3
  • Click the pencil icon (✏️) on any prompt card, or
  • Click the prompt card itself to open the editor
  • 4
    Make Your Changes
    5
    Update any field as needed. The editor pre-fills with current values.
    6
    Preview Before Saving
    7
    Click the “Preview” tab in the right sidebar to test your prompt with AI.
    8
    Save Changes
    9
    Click “Save Changes” at the bottom. The system:
    10
  • Increments version number (v2, v3, etc.)
  • Creates a new version snapshot
  • Records change history with diff
  • Preserves all previous versions
  • 11
    Version History: Every save creates a new version. You can view and compare all historical versions from the History tab.

    Preview Prompt Outputs

    The Preview panel lets you test prompts with real AI before deploying.
    1
    Access Preview Panel
    2
    In the prompt editor, click the “Preview” tab in the right sidebar.
    3
    Generate AI Response
    4
  • Click “Generate Preview”
  • The system creates an asynchronous AI job
  • Progress indicator shows “Processing…”
  • Results appear in 5-15 seconds
  • 5
    Review Output
    6
    The preview shows:
    7
  • Full AI response based on your prompt
  • Generated with actual Bedrock model
  • Uses sample data for variable substitution
  • 8
    Iterate and Refine
    9
  • Review the AI output quality
  • Switch back to prompt editor
  • Adjust system prompt or user template
  • Generate a new preview
  • Repeat until satisfied
  • 10
    Preview Limitations: Previews use sample data, not real assessments. Final outputs may vary based on actual business documents.

    Version Control and History

    Viewing Change History

    Click the “History” tab in the prompt editor to see:
    • Version timeline: Chronological list of all versions
    • Author: Who made each change
    • Timestamp: When the change was made
    • Change summary: Auto-generated diff highlights

    Comparing Versions

    Expand any version to see: Field-level diffs:
    • Added content in green
    • Removed content in red
    • Unchanged fields collapsed
    Changed fields:
    • System prompt modifications
    • User template updates
    • Category/tag additions or removals
    • Status changes (active ↔ inactive)

    Reverting to Previous Version

    1. Navigate to the History tab
    2. Find the desired version
    3. Click “View This Version”
    4. Review the historical prompt content
    5. Copy content to current version if needed
    No Direct Rollback: The system doesn’t support automatic rollback. To restore an old version, copy its content into the current editor and save as a new version.

    Commenting and Collaboration

    Adding Comments

    Click the “Comments” tab in the prompt editor:
    1. Type your comment in the text box
    2. Mention specific concerns or suggestions
    3. Click “Add Comment”
    4. Comment appears with your email and timestamp

    Threaded Discussions

    Comments support threading:
    • Click “Reply” on any comment to create a thread
    • Replies are indented under parent comments
    • Track decision rationale and team discussions

    Use Cases for Comments

    • Review requests: “@team please review this market risk prompt”
    • Change rationale: “Updated tone to be less technical per user feedback”
    • TODO tracking: “Need to add climate considerations to categories”
    • Version notes: “v4: Fixed JSON output format to match API spec”

    Import and Export

    Exporting Prompts

    1. Click “Export” in the top toolbar
    2. Choose format:
      • JSON: Full prompt data with metadata
      • CSV: Spreadsheet format for bulk review
    3. File downloads with timestamp: prompts-2026-03-04.json
    Exported data includes:
    • All prompt fields
    • Current version only
    • Active/inactive status
    • Categories and tags

    Importing Prompts

    1. Click “Import” in the toolbar
    2. Upload a JSON file (exported from this system)
    3. Select import mode:
      • Create New: Skip existing prompts, create new ones only
      • Upsert: Update existing prompts, create new ones
    4. Review import summary
    5. Confirm to proceed
    Upsert Behavior: In upsert mode, matching prompts (by ID) are updated and version-bumped. Use with caution in production.

    Toggling Active Status

    Quickly enable or disable prompts:

    From the Prompt List

    1. Locate the prompt card
    2. Click the toggle icon (⚡)
    3. Status badge updates immediately
    4. Active prompts show green “Active” badge
    5. Inactive prompts show gray “Inactive” badge

    From the Editor

    Use the Active/Inactive switch at the bottom of the form.

    Best Practices

    • Testing new prompts before production deployment
    • Temporarily disabling problematic prompts
    • Archiving outdated prompts without deleting
    • A/B testing different prompt versions
    Ensure only one prompt per section is active:
    • Prevents conflicting analysis logic
    • Maintains consistent user experience
    • System may auto-deactivate others when you activate a new one

    Best Practices

    System Prompts:
    • Be specific about expertise domain
    • Define output expectations clearly
    • Include relevant context about CGIAR mission
    • Set appropriate tone for target audience
    User Templates:
    • Use clear, structured questions
    • Leverage variable injection for dynamic content
    • Specify output format requirements
    • Include evaluation criteria
    • Save frequently to create restore points
    • Use comments to document why changes were made
    • Test with Preview before activating
    • Keep descriptive prompt names
    • Review change history before major updates
    1. Draft new prompt as Inactive
    2. Share prompt ID with team via comments
    3. Collect feedback in comment threads
    4. Iterate based on preview outputs
    5. Activate only after team approval
    6. Monitor assessment results post-deployment

    Troubleshooting

    • Check that both System and User prompts are filled
    • Verify variable syntax: {{category_1}} not {category_1}
    • Ensure no special characters in JSON output format
    • Try shorter prompts - very long prompts may timeout
    • Check admin console for error messages
    • Verify the prompt is marked Active (green badge)
    • Check that Section matches the analysis stage
    • Ensure no other prompt in same section is active
    • Wait 1-2 minutes for cache refresh
    • Try creating a new test assessment
    • Check for validation errors in red text
    • Ensure required fields (Name, Section, System/User prompts) are filled
    • Verify you have admin permissions
    • Try refreshing the page if session expired
    • Check browser console for JavaScript errors

    Next Steps

    Build docs developers (and LLMs) love