Tools
Overview
An AI tool is a functional AI component used by agents to retrieve or transform data.
To equip an agent with a tool, simply add the tool to the agent's _tools array.
There are two types of Tool:
- System Tool: Built into the platform
- Custom Tool: A tool you create on the platform
A tool has the following characteristics:
- Acts as a utility that helps agents perform specific tasks such as fetching data from platform services
- Enables RAG
- Is configured with clear usage instructions and input parameters
System tools
The following System Tools are available:
- Platform API Tools: Tools that expose the Read API calls from platform API
- Query tools: Generate queries for collections and their related items in the Item Service based on schemas defined in the namespace and user input
- RelatedQueryTool Generates related queries
- GraphQueryTool Generates findWithRelatedGraph queries
- Code Assistant Tool: Generates or updates JavaScript code using the Platform's JavaScript libraries.
Custom tools
You can create your own custom tools. For more information, see Custom Tools.
Schemas and SchemaDefinitions
Schemas provide crucial context for the AI Service to generate more accurate and relevant Item Service queries for your tools. For more information, see Schemas.
Equipping an Agent with a tool
To equip an agent with a tool, do the following:
- Create an agent. See code example below for details.
- List the tool you want in the
_toolsarray.
const queryAgent = IafAISvc.createAgents([{
_name: "Graph Query Agent",
_background: "Uses the GetSchemaDefinitionsTool to get the schema, then pass the prompt and schema to GraphQueryTool tool and return the output of GraphQueryTool",
_userType: "graph_query_agent_1",
_type: "user_agent",
_namespaces: [
"workspace_m8NrvPU3"
],
_config: {
_model: "gpt-4o",
_provider: "openai"
},
_tools: [
"GetSchemaDefinitionsTool",
"MyCustomTool"
]
}]);