Skip to main content
Valyu uses semantic search, not keyword matching. Better queries mean more relevant results and fewer hallucinations downstream. This guide covers how to write them.

The rules

  • Be specific. “transformer attention mechanism computational complexity” beats “AI research”.
  • Keep it short. Aim for under 400 characters. Strip filler words; lead with keywords.
  • One topic per query. Split complex research into separate, focused calls.
  • Name the source type when it matters, e.g. “SEC filings”, “academic papers”.
  • No operators. Do not use site:, AND, OR, or quotes - they don’t apply to semantic search.
If a human is querying the API directly (not through an LLM tool call), set is_tool_call=false for better human-readable results.

Weak vs better queries

Split complex queries

Instead of one broad query, run several focused ones - you’ll get more precise results.

Pair queries with parameters

Put key details in the query text, then use parameters as hard filters. The instructions field (max 500 chars) steers ranking in natural language; category (max 500 chars) gives a topical hint.

System prompt for AI agents

Add this to your agent’s system prompt so it queries Valyu well:
  • Too vague - “AI research” returns unfocused results. Use specific technical terms.
  • No source type - “Stock data” might return news instead of statements. Say what you need.
  • Asking for too much - “Everything about quantum computing” returns surface-level content. Narrow it.
  • Mixing topics - One topic per query; multiple topics dilute precision.
  • Too many words - Strip filler; keyword-focused queries are more precise.
  • Wrong source assumptions - Popular isn’t always best. “Attention is All You Need” is foundational but weak for understanding modern LLMs.
Stringing many queries together to answer one question? DeepResearch does the planning, searching, verifying, and writing for you on top of this same engine - usually cheaper than orchestrating it by hand.

Next steps

Search quickstart

Get your first search running

API reference

All parameters and response formats