Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:666ghj BettaFish Search Query Generation

From Leeroopedia
Knowledge Sources
Domains Information_Retrieval, NLP, LLM_Prompting
Last Updated 2026-10-08 00:00 GMT

Overview

Technique that uses an LLM to translate a section description into a targeted search query, bridging the gap between high-level research intent and low-level search tool parameters.

Description

Search Query Generation addresses the vocabulary mismatch problem: the language used to describe a research topic (e.g., "AI in education") may not match the language used in source documents (e.g., "智能教育系统", "edtech AI"). By using an LLM to generate search queries from section descriptions, the system can produce queries that are more likely to retrieve relevant results from the target data source.

This approach also enables query adaptation: different data sources (databases, web APIs, news feeds) benefit from different query formulations. The LLM can be instructed via system prompts to tailor queries for each source type.

Usage

Use this principle when building research systems that need to bridge between human-authored content descriptions and machine-executable search queries. It is particularly valuable when the search targets domain-specific databases or APIs with different query syntax requirements.

Theoretical Basis

The query generation follows a semantic-to-lexical translation:

q=LLMsearch(title,content,context)

Where the LLM is prompted to produce a query q that maximizes retrieval relevance for the described topic.

Pseudo-code Logic:

# Abstract pattern (NOT real implementation)
query = llm.generate_search_query(
    title=section.title,
    content=section.description,
    source_type="database"  # or "web_api", "news_feed"
)
results = search_tool(query)

Related Pages

Implemented By

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment