What is the Prestart Tool?

The Prestart Tool is a powerful feature that allows you to dynamically enhance your AI agent’s prompt with additional instructions from an external source before the node begins execution. This tool makes a GET request to a specified URL and incorporates the response into the agent’s prompt, enabling real-time customization and context-aware interactions.
The Prestart Tool executes before the node starts, ensuring that any additional instructions are available to the AI agent from the very beginning of the conversation or task.

How It Works

1

URL Configuration

Configure a URL endpoint that your server will monitor for GET requests from the Prestart Tool.
2

GET Request Execution

Before the node starts, the Prestart Tool automatically sends a GET request to your specified URL.
3

Response Processing

Your server responds with additional instructions or context that should be added to the AI agent’s prompt.
4

Prompt Enhancement

The response is seamlessly integrated into the agent’s prompt, enriching its context and capabilities for the upcoming interaction.

Use Cases

The Prestart Tool is particularly useful for:

Dynamic Context Loading

Load user-specific information, preferences, or context from your database before the conversation begins.

Real-time Configuration

Adjust agent behavior based on current system status, feature flags, or operational parameters.

Personalization

Customize the agent’s tone, knowledge base, or available actions based on user profiles or session data.

Conditional Instructions

Provide different instruction sets based on time of day, user location, or business logic.

Setup Guide

1. Prepare Your Endpoint

Create an endpoint on your server that responds to GET requests with the additional prompt instructions:
# Example Flask endpoint
@app.route('/prestart-instructions', methods=['GET'])
def get_prestart_instructions():
    # Your logic to determine additional instructions
    additional_instructions = {
        "instructions": "Today is a holiday, so provide extra friendly greetings and mention our special holiday offers.",
        "context": "Current promotion: 20% off all services",
        "tone": "festive and welcoming"
    }
    return jsonify(additional_instructions)

2. Configure the Prestart Tool

1

Access Tool Configuration

Navigate to your agent’s tool configuration section in the dashboard.
2

Add Prestart Tool

Select “Prestart Tool” from the available tool options.
3

Enter URL

Provide the complete URL to your endpoint that will return the additional instructions.
4

Test Configuration

Use the test feature to verify that your endpoint is responding correctly.

3. Response Format

Your endpoint should return a JSON response with the additional prompt instructions. The tool supports various formats:
{
  "instructions": "Additional instructions for the AI agent",
  "context": "Relevant context information",
  "rules": ["Rule 1", "Rule 2", "Rule 3"],
  "personality": "Adjust agent personality if needed"
}
Keep your response concise and focused. The Prestart Tool is designed for prompt enhancement, not large data transfers.

Best Practices

Ensure your endpoint has proper error handling and returns a valid response within a reasonable timeframe to avoid delays in agent initialization.

Response Time Optimization

  • Keep your endpoint response time under 2 seconds
  • Implement caching for frequently requested data
  • Use efficient database queries and API calls

Security Considerations

  • Implement proper authentication if sensitive data is involved
  • Use HTTPS for secure communication
  • Validate and sanitize any dynamic content before including it in prompts

Content Guidelines

  • Keep additional instructions relevant and specific
  • Avoid overwhelming the agent with too much additional context
  • Structure your response in a clear, actionable format

Error Handling

The Prestart Tool includes built-in error handling:
  • Network Errors: If the URL is unreachable, the tool will skip the enhancement and proceed with the default prompt
  • Timeout: Requests that take longer than the configured timeout will be cancelled
  • Invalid Response: Non-JSON or malformed responses will be ignored with appropriate logging

Examples

E-commerce Agent Enhancement

{
  "instructions": "Current inventory shows low stock on popular items. Suggest alternatives when items are unavailable.",
  "promotion": "Flash sale: 30% off electronics until midnight",
  "shipping": "Free shipping available for orders over $50"
}

Support Agent Context Loading

{
  "context": "Customer has premium subscription, last contact was about billing issue (resolved)",
  "priority": "high-value customer",
  "available_actions": ["refund", "credit", "escalate", "technical_support"]
}

Time-sensitive Instructions

{
  "instructions": "After hours: Inform customers that live support resumes at 9 AM EST",
  "emergency_contact": "For urgent issues, direct to emergency hotline: 1-800-URGENT",
  "automated_actions": ["schedule_callback", "create_ticket"]
}

Troubleshooting

The Prestart Tool empowers you to create more dynamic, context-aware AI agents that can adapt their behavior based on real-time information from your systems, providing a more personalized and effective user experience.