Intent Classification for AI Search

Every search comes back labelled: news, tech, finance, academic or general. The label is computed by rules, in microseconds, and it costs nothing.

What the label is for

A search for "bitcoin price" and a search for "bitcoin whitepaper" want different things. The first wants a current number; the second wants a document. Both are the word "bitcoin", and only the rest of the query - and the shape of it - says which.

AgentSearch reads that shape and returns an intent field with every result. You can use it to route your own agent, to filter, to pick a prompt template, or to decide whether to read the full page or stop at the summary.

{ "query_id": "search_e6bb86e4b7ed", "intent": "tech", "results": [ ... ], "total_results": 5, "sources_used": ["web"] }

The five labels

📰

news

Current events, announcements, anything published recently and meant to be read today.

💻

tech

Code, documentation, error messages, library APIs, questions and answers.

💼

finance

Valuation, funding, market data, company information, earnings.

📚

academic

Papers, citations, research, methodology, datasets and benchmarks.

💬

general

Everything else - and the honest answer when the query does not clearly point anywhere. "What is the capital of France" is general, and saying so beats inventing a category.

Rules, not a model

This is worth being explicit about, because "intelligent routing" usually means something else. AgentSearch classifies a query with keyword and pattern rules: the words that appear in it, and how specific they are.

The rules are scored, and ties are broken by specificity - a finance query beats a general one when both match, because finance is the narrower category. Here is what a query does not do:

Over the labelled benchmark set, the rules land on 96.7 % against a target of 85 %. You can run the benchmark yourself:

python benchmarks/intent_routing_benchmark.py

The honest trade-off: rules will mislabel a query that carries its intent obliquely - "the thing after the war" for a historical event, say. When the rules are unsure, the answer is general, and the results are still returned. The label is a hint for your routing, not a gate on the answer.

Asking for the label on its own

If you want to know the intent of a query before you spend a search on it, there is an endpoint for that:

curl "https://agentsearch.tech/v1/search/intent/company%20valuation%20funding%20round" \ -H "Authorization: Bearer $AGENTSEARCH_API_KEY"
{"query": "company valuation funding round", "intent": "finance"}

Using it

The label is most useful as a branch in your own agent. A typical pattern:

result = search(query, limit=5) if result["intent"] in ("news", "finance"): # Recent and dated - read the page so the answer can cite a date. body = fetch(result["results"][0]["url"])["text"] elif result["intent"] == "tech": # Summaries are dense enough; do not spend a fetch. body = result["structured_markdown"] else: body = result["structured_markdown"]

Two things fall out of that. The agent spends a fetch only where a date or a quotation matters, and it never asks the caller to pick a source - the whole point of a classification layer is that the caller does not have to know the taxonomy in advance.

Why there is no source picker

Earlier versions of this product gathered results from several vertical data sources and let the caller choose which ones to query. That was a different product, and it was a worse one: the caller had to know which source held which kind of content, and a query that touched several sources paid for several round trips. The search now runs over the live web and returns what it found. The intent label stays - it is useful - but it labels the query, it does not pick a pipeline.

Try the classification yourself

Every response carries the label. The Free plan gives you 100 searches a month to look at them.

Get a free API key

Related: how results are scored, and the API reference.

See the intent in every response

100 searches and 20 page reads a month, free. No card.

Get API Key Free