Query Formulation
Query formulation refers to the process of structuring, refining, and optimizing search inputs to retrieve relevant information. In modern llm-driven architectures, this concept has expanded beyond simple keyword matching to include semantic understanding and iterative refinement within agentic-workflow loops.
Core Principles
- Lexical vs. Semantic: Traditional query formulation relies on bm25 for lexical scoring, while modern approaches integrate vector embeddings for semantic similarity.
- Agentic Context: In agentic search, query formulation is not a one-time action but a dynamic process occurring “inside an agent loop,” where the agent iteratively refines queries based on intermediate results.
- Resurgence of BM25: Despite the dominance of dense retrieval, lexical methods like bm25 have shown “unreasonable effectiveness” in specific agentic contexts, particularly for precise keyword matching and handling rare terms.
Key Insights from Recent Research
- BM25 in Agentic Search: Recent analysis highlights the unexpected utility of bm25 in LLM-driven agentic search, challenging the assumption that dense retrieval always outperforms lexical methods.
- Hybrid Approaches: Effective query formulation often combines bm25 for exact match recall with vector search for semantic relevance.
- Agent Loop Dynamics: The effectiveness of query formulation is heavily dependent on the agent’s ability to interpret feedback and adjust search strategies in real-time.