Recipe catalog / search-intent-kind
Classify search intent
What is the searcher behind query trying to do: learn, reach a site, buy, compare before buying, or find something nearby?
You map keywords to page types, route queries to different result layouts, or audit whether content matches the intent behind the terms it targets.
Explore this recipe interactively ยท Source and implementation guide
Use search-intent-kind in TypeScript
Install with npm install jev-recipes. Requires Node.js 22.9 or newer and ES modules. Set TYPESAFE_API_KEY in your server environment for live calls, which send input to TypeSafe and use API quota. See the installation guide.
import { searchIntentKind } from 'jev-recipes/search-intent-kind';
const result = await searchIntentKind({
"query": "best noise cancelling headphones under 200 vs sony wh-1000xm5",
"minConfidence": 0.8
});
console.log(result);
Input contract
| Field | Type | Needed |
|---|---|---|
| query | string | Required |
| minConfidence | number | Optional |
Full input and result schemas
{
"input": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"query": {
"type": "string"
},
"minConfidence": {
"type": "number",
"minimum": 0,
"maximum": 1
}
},
"required": [
"query"
]
},
"result": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"model": {
"type": "string"
},
"usage": {
"type": "object",
"properties": {
"input_tokens": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"output_tokens": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"input_tokens",
"output_tokens"
],
"additionalProperties": false
},
"status": {
"type": "string",
"enum": [
"ready",
"review"
]
},
"verdict": {
"type": "string",
"enum": [
"informational",
"navigational",
"transactional",
"commercial",
"local",
"unclear"
]
},
"confidence": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"probabilities": {
"type": "object",
"propertyNames": {
"type": "string",
"enum": [
"informational",
"navigational",
"transactional",
"commercial",
"local",
"unclear"
]
},
"additionalProperties": {
"type": "number",
"minimum": 0,
"maximum": 1
},
"required": [
"informational",
"navigational",
"transactional",
"commercial",
"local",
"unclear"
]
}
},
"required": [
"model",
"usage",
"status",
"verdict",
"confidence",
"probabilities"
],
"additionalProperties": false
}
}Saved example result
This hand-authored response demonstrates the contract. It is not a model accuracy measurement. Run it without an API key: npx jev-recipes demo search-intent-kind.
{
"model": "demo-fixture",
"usage": {
"input_tokens": 0,
"output_tokens": 0
},
"status": "ready",
"verdict": "commercial",
"confidence": 0.86,
"probabilities": {
"informational": 0.03,
"navigational": 0.01,
"transactional": 0.06,
"commercial": 0.86,
"local": 0.01,
"unclear": 0.03
}
}
Evaluation evidence
No verified live accuracy measurement is available. Evaluate representative cases before using this decision in your workflow.
Use the evaluation guide to measure this decision on your own labeled cases.
Limitations
- Classifies from the wording of the query alone; it does not see search history, location, or result pages.
- Short or ambiguous queries often carry several intents. Treat the probabilities, not only the verdict, as the signal.
Related recipes
- turn-intent: Use turn-intent to classify what a user wants from a single message in a conversation.
- query-specificity: Use query-specificity to judge how narrow or broad a query is rather than what the searcher wants to do.