Query tools
Overview
AI agents can query the Item Service using the following tools:
- Related Query Tool: generates related queries
- Graph Query Tool: generates findWithRelatedGraph queries
Click on one of the tools for more information.
Related query Tool
The Related Query tool is used to generate Item Service related queries such as:
$findInCollections$findWithRelated$findWithRelatedGraph
Note: Before using the tool, you must configure the necessary schema definitions in the Item Service.
For more information, refer to the How to set up a related query tool page.
Graph query tool
The Graph Query Tool is used to generate an Item Service $findWithRelatedGraph query.
The Related Query Tool can also produce this type of query. However, the Graph Query tool is specifically optimized for generating $findWithRelatedGraph queries, whereas the Related Query Tool can generate a broader range of related queries.
Note: When working with
$findWithRelatedGraphqueries you can use either tool.
For more information, refer to the How to set up a Graph query tool page.
Notes on schema reliance
To generate queries with accuracy, Item Service query tools require the relevant schema data for the RelatedItems to query.
GetSchemaDefinitionsTool
To get best results, when you create an agent, pair the query tool with GetSchemaDefinitionsTool.
Notes on schemas
For GetSchemaDefinitionsTool to produce accurate results, create schemas that describe the RelatedItems in a NamedUserCollection and add those schemas to the namespace's SchemaDefinition.
For more information, see Schemas.