Skip to content
All articles

Prompt research at scale with an open model

To know whether AI assistants recommend you, you need the questions your customers actually ask them, per page, per intent and per language. Writing hundreds of those by hand does not work, and sending your page content and internal notes to a public AI API is not always allowed. Here is the workflow I use: an open model such as Qwen running on your own machine turns your sitemap into a realistic prompt set, which a tracker like Semrush or Peec AI then runs every day.

10 min read

1. Why you need prompts, not keywords

A keyword like 'italian restaurant berlin' is a fragment. A prompt is a situation: 'where can I take my parents for a quiet Italian dinner in Berlin on Sunday, one of them uses a wheelchair'. AI assistants answer the second kind, and whether you are recommended depends on details your pages may or may not cover: opening days, accessibility, price level, reservations. That is why AI visibility tools such as the Semrush AI Visibility Toolkit and Peec AI track prompts, not keywords: they run your prompt set against the assistants every day and record whether, where and how you are mentioned. The quality of what they tell you depends entirely on the prompts you give them. Ten generic prompts give you a vanity number. A few hundred prompts that mirror your real pages, intents and languages give you a map of where you win, where competitors win, and which third-party sources the assistants trust in your market.

From sitemap to experiments: a local open model such as Qwen writes realistic customer prompts per page inside your network, a person reviews a sample, and Semrush or Peec AI track how visible each page is in AI answers.
Prompt research pipeline with a local open model

2. Start from your sitemap

Your sitemap is the most honest list of what you want to be found for. Pull every URL, group them by template (location pages, product pages, category pages, guides) and pick the pages that carry revenue or leads. Each of those pages stands for an intent, and the intent is what the prompts should express. For each page, extract the few facts that make it distinct: title, the main heading, the city or segment, the price level, two or three features. That small context is all the model needs; you do not have to send whole pages. On a European hospitality platform I used exactly this approach for around 150 landing pages: deep links from the sitemap, a short fact sheet per page, then prompts generated per page. If you have thousands of similar pages, sample per template first and expand once the prompts prove useful.

bash
# All URLs from a sitemap (for a sitemap index, run it again on each listed sitemap)
curl -s https://www.example.com/sitemap.xml \
  | grep -o '<loc>[^<]*</loc>' | sed 's/<\/\?loc>//g' > urls.txt

# Count URLs per template (first path segment)
cut -d/ -f4 urls.txt | sort | uniq -c | sort -rn | head

3. Run an open model on your own machine

Prompt generation is a perfect job for an open-weight model: the task is narrow, the output is short, and quality is easy to review. Alibaba's Qwen family is a good default. The Qwen3.5 and Qwen3.6 models are published on Hugging Face under the Apache 2.0 license, in sizes from under one billion parameters to several hundred billion, and they handle German, Spanish and many other languages well. For a laptop, a 9B model through Ollama is enough to start; for better quality and many pages, a 27B model served with vLLM on one GPU. Both expose an OpenAI-compatible API, so the same script works against either. The reason to run it locally is not only cost. Legal and data protection teams want to know where page content, internal notes and customer context go and which provider processes them. With a local model the answer is simple: nowhere, it stays on your hardware.

bash
# Laptop: Ollama with a 9B Qwen model (OpenAI-compatible API on :11434/v1)
ollama pull qwen3.5:9b

# One GPU server: vLLM with a 27B Qwen model (OpenAI-compatible API on :8000/v1)
vllm serve Qwen/Qwen3.6-27B --max-model-len 16384

Interactive

What do your customers ask an AI?

Pick an industry and the intents you care about. These examples come from templates in your browser; real prompt research generates hundreds per page with an open model on your sitemap.

Industry

Intent

  1. What is the best restaurant in Munich?
  2. Which restaurant in Munich do locals recommend?
  3. Compare the top three restaurant options in Munich by price and reviews
  4. Your brand or another restaurant in Munich: which is better for a small team?
  5. Where can I book a restaurant in Munich for this weekend?
  6. Find a restaurant in Munich with availability tomorrow
All calculators and checklists

4. Generate prompts with a strict brief

The model will happily produce marketing sentences unless you stop it. Give it a strict brief: write as a real customer talking to an AI assistant, include a situation and at least one constraint, never mention the brand, vary the intent (discover, compare, decide, practical questions), and return JSON only. Ask for five to eight prompts per page and per language, generated natively in that language rather than translated, because people phrase things differently in German, Spanish and English. Keep the temperature moderate so the set has variety without nonsense. Then deduplicate across pages: near-identical prompts waste tracker budget, because AI visibility tools price by the number of prompts and models. Store page URL, intent, language and prompt in one table; that table is your audit trail and the import file for the tracker. Branded prompts ('is Example Bistro good for groups?') go into a separate set to check whether what assistants say about you is correct.

python
# pip install openai
# Generates customer-style prompts per page with a local model; nothing leaves your machine.
import csv, json
from openai import OpenAI

client = OpenAI(base_url="http://localhost:11434/v1", api_key="ollama")  # vLLM: http://localhost:8000/v1
MODEL = "qwen3.5:9b"

BRIEF = """You write questions that real customers ask an AI assistant.
Page facts: {facts}
Write {n} prompts in {lang}. Each prompt: a real situation plus at least one constraint
(budget, date, group size, accessibility, location...). Never mention the brand.
Vary intent: discover, compare, decide, practical.
Return JSON only: [{{"intent": "...", "prompt": "..."}}]"""

pages = [  # in practice: built from your sitemap and page titles
    {"url": "https://www.example.com/berlin/italian", "facts": "Italian restaurant, Berlin Mitte, mid-price, terrace, step-free access, groups up to 12"},
]

seen, rows = set(), []
for page in pages:
    for lang in ["English", "German", "Spanish"]:
        out = client.chat.completions.create(
            model=MODEL, temperature=0.7,
            messages=[{"role": "user", "content": BRIEF.format(facts=page["facts"], n=6, lang=lang)}],
        ).choices[0].message.content
        start, end = out.find("["), out.rfind("]") + 1
        for item in json.loads(out[start:end]):
            key = item["prompt"].lower().strip()
            if key not in seen:  # drop exact duplicates across pages
                seen.add(key)
                rows.append([page["url"], lang, item["intent"], item["prompt"]])

with open("prompts.csv", "w", newline="") as f:
    csv.writer(f).writerows([["url", "language", "intent", "prompt"], *rows])
print(len(rows), "prompts written to prompts.csv")

Tip from practice

Ask the model for the intent label together with each prompt. It makes deduplication and tagging in the tracker trivial, and you can see at a glance if one intent dominates.

5. Review a sample by hand

Generated prompts are a draft, not a result. Read at least one in ten, and all of them for your top pages. Delete prompts that nobody would type, that leak the brand, that are too broad ('best restaurant') or that the page cannot possibly answer. Check each language with a native speaker for ten minutes; it is the cheapest quality gain in the whole process. Watch for a model bias toward one intent, usually 'compare', and rebalance. Then decide how many prompts you can afford to track: trackers charge per prompt and per AI model, so put the budget where the revenue is and keep a longer list for quarterly spot checks. Document the brief and the model version you used. When you regenerate in three months, you want to know whether a change in visibility comes from your work or from a different prompt set.

6. Load the set into a tracker

Now the prompts go where they are run every day. In the Semrush AI Visibility Toolkit, prompt tracking monitors specific high-value prompts on platforms such as ChatGPT and Google AI Mode and updates daily, while prompt research and competitor research show which questions mention you and your competitors. Peec AI lets you add your own prompts, organize them with tags, choose countries and models, and runs each prompt once every 24 hours on every model you select, reporting visibility, position and sentiment. Use the intent and page from your table as tags, so you can later filter 'decide' prompts for one template, or compare languages. Add three to five named competitors from the start; share of voice only means something against real alternatives. Which tool fits depends on your market and budget: if your team already lives in Semrush for SEO, its toolkit keeps everything in one place; Peec AI is strong when you need many models and countries side by side.

7. Read the trend and the cited sources

AI answers are not deterministic. The same prompt can mention you today and not tomorrow, so single days mean nothing. Look at two- to four-week trends per intent and template, and at share of voice against your named competitors. The most actionable data is often not your own visibility but the sources the assistants cite when they recommend someone: review platforms, booking and comparison portals, directories, media. Those are the places where your facts need to be complete and consistent, and sometimes where a partnership or a listing pays off faster than any change on your own site. Also read what the assistants say about you on the branded prompts: wrong opening hours, outdated prices or a closed location are fixable, but only once you see them. Turn each pattern into an experiment with a hypothesis, an owner and a date.

8. Close the loop and automate the boring part

The workflow pays off when it runs without you. Regenerate prompts when the sitemap changes, for new pages only, with the same brief and model version, and review the new ones. Export the tracker data monthly into a short report: visibility and share of voice per intent, the top cited sources, the experiments started and their effect. Pair it with the AI-referred visits from your analytics and Google's generative AI performance report in Search Console, so you can see whether visibility turns into traffic and leads. All of this can run as a scheduled job or an agent routine that opens a pull request or a ticket with the new prompts and the report, while a person approves what goes live. That is how the hospitality engagement was set up: baseline first, prompt research for around 150 landing pages with a language model, loaded up to the tracker's limit, then a monthly trend review feeding ten prioritized experiments.

Takeaway

A local open model turns your sitemap into the questions customers really ask, privately and cheaply; the tracker turns those questions into a trend you can act on.

More articles

    Get in touch

    Tell me what you're building. I'll reply within 1–2 business days.

    Dominik Heinrich
    Company
    MADO Consulting

    Available worldwide, remote. On-site on request, depending on the country.

    I reply within 1–2 business days. Free slots: see the calendar

    Opens Calendly's booking calendar here. Loading it sends data to Calendly (see Impressum).