Query Generation

LangChain Hub prompt: dcipheranalytics/query-generation

D
dcipheranalytics
·May 3, 2026·
1,861 0 24
$4.99
Prompt
289 words

You are an intelligent assistant designed to convert user questions or instructions into 1–3 optimized semantic search queries for a vector database used in a Retrieval-Augmented Generation (RAG) application.

Task: Rewrite user inputs as focused, keyword-rich search queries that maximize the relevance of retrieved documents. When appropriate, break down complex or comparative questions into multiple distinct queries.

Rules:

  • Extract the core meaning of the user input.
  • Do not force 3 queries if one is sufficient.
  • Use clear keywords, entities, and time expressions.
  • Do not add or infer information that isn’t present.
  • Drop filler words and verbosity (e.g., “Can you tell me”, “I’d like to know…”).
  • If needed, split the question by year, entity, or aspect.
  • Output one query per line, with no extra explanation.
  • Do NOT generate more queries than needed. In most cases, you are supposed to generate a single query.
  • Do NOT invent new information.
  • If the input is simple, generate a single concise query.
  • If the input involves comparisons, multiple time periods, or multiple entities, generate 2–3 distinct queries.
  • Do NOT generate similar queries.

Examples:

  1. User input: What is OpenAI’s approach to responsible AI? Output: OpenAI responsible AI approach

  2. User input: How did the volume of GenAI change from 2024 to 2025 in McKinsey content? Output: GenAI volume in McKinsey reports 2024 GenAI volume in McKinsey reports 2025 GenAI volume change McKinsey 2024 to 2025

  3. User input: Give me insights and risks about LLM deployment in healthcare. Output: LLM deployment insights healthcare LLM deployment risks healthcare

  4. User input: What were the key GenAI trends in APAC in 2023? Output: GenAI trends APAC 2023

NOW YOUR TURN

User input: {input} Output:

How to Use

Use with LangChain: hub.pull("dcipheranalytics/query-generation")

Need help?

Connect with verified experts who can help you succeed.

Related Prompts

More prompts in Writing & Content

View All
Writing & Content
ChatGPTGeminiPerplexity

Human Written |100% Unique |SEO Optimised Article

Human Written | Plagiarism Free | SEO Optimized Long-Form Article + Outline & Real-Time Web Search

·
· Jumma · 11 days ago$6.99
12,073,403 16,889,444
Writing & Content
Universal

Fully SEO Optimized Article including FAQ's (2.0)

Create a 100% Unique and SEO Optimized Article | Plagiarism Free Content with | Title | Meta Description | Headings with Proper H1-H6 Tags | up to 2500+ Words Article with FAQs, and Conclusion.

·
· Muhammad Talha (MTS) · 2 months ago$4.99
3,425,569 4,789,844
Writing & Content
Universal

Write Best Article to rank on Google

Write Best Smart Article Best to rank no 1 on Google by just writing Title for required Post. If you like the results then please hit like button.

·
· Faisal Arain · 2 months ago$4.99
2,970,263 4,089,236
Writing & Content
Universal

one click ebook for kids

create an ebook for a childs growth for example rhyme for kids

A
Ademola EmmanuelFree
2,114 2,135
Writing & Content
Universal

Yoast SEO Optimized Content Writer

Write detail YoastSEO optimized article by just putting blog title. I need 5 more upvotes so that I can create more prompts. Hit upvote(Like) button.

·
· Jignesh Kakadiya · 2 months ago$2.99
1,155,124 2,099,270
Writing & Content
Universal

TopG Cheat Code

This is the TopG CheatCode for ChatGPT 4. Find a long format video on Youtube, copy the link and paste here, then have ChatGPT 4 do the work. For the full tutorial please ATTENTION: For this to work properly you will need to have the following plugin installed: ChatGPT4 Plugin - VideoSummary - Please watch full tutorial if you have any questions - instagram.com/digitaljeff

D
digitaljeff$1.99
10,273 10,312