Overview
When working with custom agents in Narada, you can provide input variables beyond the simple prompt string. This allows for more sophisticated data passing and enables your custom agents to access structured information during execution.Video Walkthrough
Watch this demonstration of input variables in action:Default Behavior
When calling a custom agent with a simple prompt, the string becomes the$userQuery
variable:
$userQuery
= “Search for the latest AI research papers”
Providing Multiple Input Variables
To provide more than just the$userQuery
value, use the inputVariables=
format with a JSON object:
Variable Types
Input variables support basic JSON data types:Strings
Numbers
Booleans
Arrays
Complex nested objects are not supported yet. Use only basic data types (strings, numbers, booleans) and arrays of basic types.
Best Practices
1
Use Descriptive Variable Names
Choose clear, descriptive names for your input variables:
2
Include userQuery When Needed
If your custom agent expects a main user query, include it explicitly:
3
Validate JSON Format
Ensure your JSON is properly formatted. Use tools or linters to validate syntax:
4
Use Basic Data Types Only
Stick to basic data types - complex nested objects are not supported:
Next Steps
Parallel Execution
Learn how to run multiple custom agents with different input variables simultaneously
Error Handling
Implement robust error handling for custom agent workflows
Structured Output
Structure your output data with JSON schemas
API Reference
Explore the complete Window.agent() API documentation
Start with simple input variables and gradually add complexity as your custom agents become more sophisticated. This approach makes debugging easier and helps you understand which variables provide the most value.