Agent Management
Agent Pre-Processor
The Agent Pre-Processor allows developers to run custom scripts before an agent is invoked. These scripts can access system memory and context variables to perform data transformation, validation, context preparation, and state preparation. The configured script runs automatically every time the agent’s run is initiated, ensuring consistent preprocessing of the agent’s input state. !!!note Currently, this feature is enabled on request.Common Use Cases
Some of the common use cases where agent pre-processor scripts can be useful are listed below.- Security: content moderation.
- Validation: Input normalization, schema enforcement, and type validations.
- Enrichment: Adding user metadata, timestamps, domain tags, etc.
- Customization: Domain-specific prompts, tool filtering, etc.
Adding a script
Click on Add Script to add a new pre-processor script. Write custom scripts in JavaScript or Python. The available keys are listed at the top. Along with these keys, context and memory variables are also accessible within the script.- input: The user input under processing.
- task_input: The structured payload or input passed to the agent for this execution.
- agent_prompt: The agent prompt used to guide the behavior and response of the agent.
- available_tools: Contains metadata about the tools, agents, and events that the agent is allowed to use. The contents vary based on the orchestration pattern configured for the app.