The prompt
For the provided step-by-step plan, write all the necessary search queries to gather information from the web that the base model doesn't already know.
Write optimized search queries for each step of the plan, just like how you would write a Google search query. Use the most relevant keywords and phrases to find the best information since you'll be clicking on the first link.
also only ask for information if you think it's necessary, otherwise leave ask_user field empty.
Step-by-Step Plan:
{{ step_by_step_plan }}
Only respond in the following JSON format:
```
{
"queries": ["<QUERY 1>", "<QUERY 2>", "<QUERY 3>", ... ],
"ask_user": "<ASK INPUT FROM USER IF REQUIRED, OTHERWISE LEAVE EMPTY STRING>"
}
```
Example =>
```
{
"queries": ["How to do Bing Search via API in Python", "Claude API Documentation Python"],
"ask_user": "Can you please provide API Keys for Claude, OpenAI, and Firebase?"
}
```
Keywords for Search Query: {{ contextual_keywords }}
Rules:
- Only search for a maximum of 3 queries.
- Do not search anything that you already know (In your training data, in the base model). For example: You already know how to write a Python flask web server, it is in your data, so you shouldn't search how to do that.
- Do not search for information that is not relevant to the task at hand.
- Try to include contextual keywords into your search queries, adding relevant keywords and phrases to make the search queries as specific as possible.
- Only search for documentation, do not search basic how tos. Forbidden Queries: How to install XYZ, How to setup ABC, etc.
- Do not search for basic queries, only search for advanced and specific queries. You are allowed to leave the "queries" field empty if no search queries are needed for the step.
- DO NOT EVER SEARCH FOR BASIC QUERIES. ONLY SEARCH FOR ADVANCED QUERIES.
- YOU ARE ALLOWED TO LEAVE THE "queries" FIELD EMPTY IF NO SEARCH QUERIES ARE NEEDED FOR THE STEP.
- you only have to return one JSON object with the queries and ask_user fields. You can't return multiple JSON objects.
Only the provided JSON response format is accepted. Any other response format will be rejected. What it is
Devika's researcher prompt: for a step-by-step plan, return one JSON object with at most three specific search queries for information the model does not already know, plus an optional question for the user; basic how-to searches are forbidden and the queries list may be empty. The example on this page is copied from the same source file; we did not run it. The prompt text comes from the devika repository (MIT License, Copyright (c) 2024 stition). Licence: https://github.com/stitionai/devika/blob/main/LICENSE. Original author: stition (stitionai/devika). Changes by FoxaMind: none; the Jinja2 file is shown as in the source, with its {{ ... }} and {% ... %} tags.
Who it's for
- Developers adding web search to a coding agent
- Anyone who wants fewer, sharper searches from an LLM
برومبت الباحث في Devika: لخطة من خطوات، يعيد كائن JSON واحداً فيه ثلاثة استعلامات بحث محددة على الأكثر عن معلومات لا يعرفها النموذج مسبقاً، مع سؤال اختياري للمستخدم؛ استعلامات «كيف أفعل» الأساسية ممنوعة، ويجوز أن تكون قائمة الاستعلامات فارغة.
Examples
Example reply printed in the prompt
Prompt{
"queries": ["How to do Bing Search via API in Python", "Claude API Documentation Python"],
"ask_user": "Can you please provide API Keys for Claude, OpenAI, and Firebase?"
}Expected output: The sample reply printed in the source prompt. Not run by us.
Tips
- {{ step_by_step_plan }} is the plan and {{ contextual_keywords }} are keywords to include in the queries.
- "ask_user" stays an empty string unless the agent needs something from the user.
- The prompt says the first search result will be clicked, so each query should be precise.