Context7 Platform -- Up-to-date docs for AI agents
CTX7-3160: Add Context7 Ask docs (#3404)
Enes Gulesef472a4912d5
diff --git a/docs/ask/dashboard.mdx b/docs/ask/dashboard.mdxnew file mode 100644index 00000000..6c6e9cbb--- /dev/null+++ b/docs/ask/dashboard.mdx@@ -0,0 +1,57 @@+---+title: Questions and Analytics+description: See what AI agents ask about your product, and which questions your site can't answer+---++Every question an agent sends to your site ends up in the Ask dashboard: **which agent asked it, whether your pages had an answer, and what the agent got back**. Open [context7.com/ask](https://context7.com/ask) and pick a site to see them.++---++## Analytics++The **Analytics** tab shows which agents ask your site, and what they ask. Pick the last 24 hours, 7 days or 30 days at the top.++<Frame caption="Question activity by agent, with the questions your site couldn't answer and the ones asked most.">+ <img+ src="/images/ask/dashboard/analytics.jpg"+ alt="Context7 Ask Analytics tab with a question activity chart by agent and the Unanswered and Most asked lists"+ />+</Frame>++| Card | What it shows |+| --------------------- | ---------------------------------------------------------------- |+| **Question activity** | Questions per day, split by agent |+| **Questions** | How many questions each agent asked |+| **Unanswered** | Questions that found nothing on your site |+| **Most asked** | The questions agents repeat most |+| **Recent questions** | The latest questions agents asked |++The **Unanswered** list is your to-do list. Each question in it is something agents wanted to know and your website didn't say. Add a page for it, and the next agent that asks gets an answer.++<Frame caption="Click View unanswered for the full list, most asked first.">+ <img+ src="/images/ask/dashboard/unanswered.jpg"+ alt="Context7 Ask Unanswered report listing the questions that found nothing on the site, most asked first"+ />+</Frame>++---++## Questions++The **Questions** tab lists every question, newest first. Search the questions, or filter them by agent. Click a question to read the answer the agent got back.++<Frame caption="Open a question to see exactly what the agent received.">+ <img+ src="/images/ask/dashboard/questions.jpg"+ alt="Context7 Ask Questions tab with one question opened to show the answer the agent received"+ />+</Frame>++Each question is marked **Answered** or **No match**. We keep questions for 60 days.++---++## Agents++Ask recognizes Claude, OpenAI, Perplexity, Cursor, OpenCode, Meta, Mistral and Grok by name. A question from a browser shows as **Browser**, and one from any other agent shows as **Unknown**.diff --git a/docs/ask/overview.mdx b/docs/ask/overview.mdxnew file mode 100644index 00000000..24d9f386--- /dev/null+++ b/docs/ask/overview.mdx@@ -0,0 +1,85 @@+---+title: Context7 Ask+sidebarTitle: Overview+description: See what AI agents ask about your product+---++**Context7 Ask** is an endpoint you add to your website. When an AI agent needs information about your product, it asks your website a question instead of crawling through your pages, and you see every question it asked.++People now ask AI agents about your product instead of reading your website. Ask shows you what those agents want to know, and which of their questions your website can't answer yet.++Ask is part of Context7 and free to use.++---++<Frame caption="Without Ask, agents crawl your pages. With Ask, they ask your site, and you see the question.">+ <img+ src="/images/ask/product/why.jpg"+ alt="Without Context7 Ask an agent is puzzled by your site; with Context7 Ask its question goes to your site and into your question log"+ />+</Frame>++## ❌ Without Context7 Ask++- ❌ AI agents crawl many pages to learn about your product+- ❌ You don't know why AI agents are visiting your website+- ❌ You don't know if AI agents found what they needed++## ✅ With Context7 Ask++- ✅ AI agents ask your site a question instead of crawling+- ✅ See every question AI agents ask about your product+- ✅ See which questions your website doesn't answer++---++## How it works++You add two things to your website: a verification tag in `<head>` and a short note at the top of `<body>`. People don't see the note, but agents that read your page do. It tells them that your site has a search endpoint:++```txt+https://context7.com/api/v2/ask?siteKey=ask_4f9c2e81a7b3d6e05c1f8a92&query=How+do+I+retry+webhooks+```++From there, it's three steps:++<Frame caption="Agents read your site, your site answers, and you see every question.">+ <img+ src="/images/ask/product/how-it-works.jpg"+ alt="The example Ask request above three cards: agents read your site, your site answers, you see all agent questions"+ />+</Frame>++| Step | What happens |+| -------------------------- | ------------------------------------------------------------------------------------------------- |+| **1. Agents read your site** | Claude, ChatGPT, Cursor and other agents find the endpoint in your page |+| **2. Your site answers** | Context7 searches your pages and returns the parts that answer the question, each with its URL |+| **3. You see the questions** | Every question shows up in the Ask dashboard, with the agent that asked it and the answer it got |++If nothing on your site answers a question, the agent is told so. It never gets a made-up answer, and you see the question in your **Unanswered** list.++Agents spend fewer tokens browsing your website, and you finally see what they're looking for.++---++## Plans++| Plan | Sites |+| ---------------- | -------- |+| Free | 3 |+| Pro & Enterprise | No limit |++There is no charge for questions or answers on any plan.++---++## Start here++<Columns cols={2}>+ <Card title="Quickstart" href="/ask/quickstart">+ Add your site and verify it in about 2 minutes.+ </Card>+ <Card title="Questions and analytics" href="/ask/dashboard">+ See what agents ask, and which questions have no answer.+ </Card>+</Columns>diff --git a/docs/ask/quickstart.mdx b/docs/ask/quickstart.mdxnew file mode 100644index 00000000..86487a2f--- /dev/null+++ b/docs/ask/quickstart.mdx@@ -0,0 +1,103 @@+---+title: Quickstart+description: Add Context7 Ask to your website in about 2 minutes+---++Setting up Ask takes two snippets: a **verification tag** that proves the site is yours, and a **hidden note** that tells agents where to ask their questions. Both go into the HTML your server returns.++<Tip>+ Using a coding agent? Click **Copy prompt for your agent** in the dashboard and paste it into Claude Code, Cursor or Codex. The prompt has both snippets with your site's key and opens a pull request for you.+</Tip>++---++## 1. Add your site++Open [context7.com/ask](https://context7.com/ask), click **Add your site** and enter your site's URL. If your pages live under a path, include it, like `https://example.com/docs`.++You need to be an owner or admin of the teamspace to add a site.++<Frame caption="The Site tab shows both snippets and checks your site for them.">+ <img+ src="/images/ask/dashboard/site.jpg"+ alt="Context7 Ask Site tab with the site URL, the verification tag, the hidden note and their status"+ />+</Frame>++---++## 2. Add the tag to `<head>`++The tag proves the site is yours. It's the same method search consoles use, so only someone who controls your page template can add it.++```html+<meta name="context7-site-verification" content="ask_4f9c2e81a7b3d6e05c1f8a92">+```++Add it to the shared layout of your site, so every page has it.++---++## 3. Add the note to `<body>`++Agents that read your page as text never see `<head>`, so the note goes at the top of `<body>`. It is hidden from people and from screen readers. Your design and page speed stay the same.++```html+<blockquote data-context7-ask="true" aria-hidden="true" style="position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0">+ <h2>Search</h2>+ <p>This site has a search endpoint: https://context7.com/api/v2/ask?siteKey=ask_4f9c2e81a7b3d6e05c1f8a92&query=<URL-encoded question>. ...</p>+</blockquote>+```++Copy the exact note from the dashboard. It has your site's key.++<Note>+ Keep the `data-context7-ask` attribute. If your site already has a visually hidden class, like Tailwind's `sr-only`, you can use it in place of the `style` attribute.+</Note>++<Warning>+ Both snippets have to be in the HTML your server returns. Don't add them with client-side JavaScript, because agents and the verification check don't run it.+</Warning>++---++## 4. Verify++Deploy your site, then click **Check again** in the dashboard. Context7 loads your site, looks for the tag and the note, and then reads your pages. Once that's done, agents get answers, and the **Site** tab shows your site's usage.++<Frame caption="Once verified, the Site tab shows daily requests and a test request you can copy.">+ <img+ src="/images/ask/dashboard/site-live.jpg"+ alt="Context7 Ask Site tab for a verified site with its usage chart and a test request"+ />+</Frame>++---++## Test it++You can ask your site a question yourself, from the **API** card on the **Site** tab or with curl:++```bash+curl "https://context7.com/api/v2/ask?siteKey=ask_4f9c2e81a7b3d6e05c1f8a92&query=How+do+I+retry+webhooks"+```++The response is plain text: the parts of your pages that answer the question, each with its URL. Your question shows up in the [Questions](/ask/dashboard) tab right away.++| Status | Meaning |+| ------ | ---------------------------------------------------------- |+| `200` | The answer, or a message that nothing on your site matched |+| `202` | Context7 is still reading your site. Try again shortly |+| `404` | No site is published for that key |++---++## Optional: llms.txt, markdown pages and headers++Some agents never read your HTML. They fetch `llms.txt`, a `.md` version of a page, or only the response headers. The prompt from **Copy prompt for your agent** adds the endpoint to all of these too:++- A **Search** section in `llms.txt` and `llms-full.txt`+- The same section at the end of each markdown page+- A `Link` header with `rel="search"` on every page response++These are optional. The tag and the note are all Context7 checks.diff --git a/docs/docs.json b/docs/docs.jsonindex 1b1cd0dd..2f139da6 100644--- a/docs/docs.json+++ b/docs/docs.json@@ -50,6 +50,11 @@"howto/rules", "howto/private-sources"]},+ {+ "group": "Ask",+ "expanded": false,+ "pages": ["ask/overview", "ask/quickstart", "ask/dashboard"]+ },{"group": "Account","expanded": false,diff --git a/docs/images/ask/dashboard/analytics.jpg b/docs/images/ask/dashboard/analytics.jpgnew file mode 100644index 00000000..a51fe816Binary files /dev/null and b/docs/images/ask/dashboard/analytics.jpg differdiff --git a/docs/images/ask/dashboard/questions.jpg b/docs/images/ask/dashboard/questions.jpgnew file mode 100644index 00000000..92b324abBinary files /dev/null and b/docs/images/ask/dashboard/questions.jpg differdiff --git a/docs/images/ask/dashboard/site-live.jpg b/docs/images/ask/dashboard/site-live.jpgnew file mode 100644index 00000000..c4dcb369Binary files /dev/null and b/docs/images/ask/dashboard/site-live.jpg differdiff --git a/docs/images/ask/dashboard/site.jpg b/docs/images/ask/dashboard/site.jpgnew file mode 100644index 00000000..80bfaf04Binary files /dev/null and b/docs/images/ask/dashboard/site.jpg differdiff --git a/docs/images/ask/dashboard/unanswered.jpg b/docs/images/ask/dashboard/unanswered.jpgnew file mode 100644index 00000000..bd13a25cBinary files /dev/null and b/docs/images/ask/dashboard/unanswered.jpg differdiff --git a/docs/images/ask/product/how-it-works.jpg b/docs/images/ask/product/how-it-works.jpgnew file mode 100644index 00000000..bdcb5be1Binary files /dev/null and b/docs/images/ask/product/how-it-works.jpg differdiff --git a/docs/images/ask/product/why.jpg b/docs/images/ask/product/why.jpgnew file mode 100644index 00000000..ce7b00ecBinary files /dev/null and b/docs/images/ask/product/why.jpg differ