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

WeakBetter
”Find information about machine learning""production RAG benchmarks enterprise deployment technical whitepapers 2023"
"Cancer research""CAR-T cell therapy B-cell lymphoma phase III outcomes FDA briefing documents 2023"
"Stock data""Apple quarterly earnings financial statements SEC filings"
"Database optimization""PostgreSQL time-series query tuning indexing partitioning benchmarks”

Split complex queries

Instead of one broad query, run several focused ones - you’ll get more precise results.
// Instead of this:
{ "query": "Everything about company ABC including competitors, financials, and news" }

// Run these:
{ "query": "Company ABC main competitors market share analysis" }
{ "query": "ABC Corp quarterly revenue growth 2024" }
{ "query": "ABC recent acquisitions strategic partnerships" }

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.
response = valyu.search(
    "GPT-4 vs GPT-3 training efficiency, inference optimisation, benchmark comparisons",
    max_num_results=10,
    relevance_threshold=0.6,
    included_sources=["academic"],  # preset, expands to arXiv/PubMed/etc.
    category="machine learning",
    instructions="Prioritise peer-reviewed and preprint sources over blog posts",
    start_date="2024-01-01",
    end_date="2024-12-31",
)

System prompt for AI agents

Add this to your agent’s system prompt so it queries Valyu well:
Valyu Search covers web, research papers, financial data, and proprietary datasets in real time.
When querying:
- Use focused, specific queries with domain-specific terms
- Specify source types when needed (e.g. "academic papers", "SEC filings")
- Split complex research into multiple targeted queries
- Be precise about time ranges when relevant
- Do NOT use search operators (site:, OR, AND, quotes) - Valyu is semantic, not keyword
  • 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