-
Notifications
You must be signed in to change notification settings - Fork 8k
nlweb docs #24614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
aninibread
wants to merge
11
commits into
production
Choose a base branch
from
anni/nlweb
base: production
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
nlweb docs #24614
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c61cc5c
nlweb docs
aninibread d9cfebe
add link
aninibread dac2d0f
fix link
aninibread abf5e2f
fix
aninibread 6494066
Update src/content/docs/autorag/how-to/nlweb.mdx
aninibread 8c4f254
Update src/content/docs/autorag/how-to/nlweb.mdx
aninibread 9d92dbb
Update src/content/docs/autorag/how-to/nlweb.mdx
aninibread 7cc8dc0
Apply suggestions from code review
aninibread 59dd4cd
future change flow
aninibread 3aeb0af
update
aninibread fe962ee
embeddable snippet
aninibread File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
--- | ||
pcx_content_type: concept | ||
title: NLWeb | ||
sidebar: | ||
order: 1 | ||
--- | ||
|
||
Enable conversational search on your website with NLWeb and Cloudflare AutoRAG. This template crawls your site, indexes the content, and deploys NLWeb-standard endpoints to serve both people and AI agents. | ||
|
||
:::note | ||
This is a public preview ideal for experimentation. If you're interested in running this in production workflows, please contact us at [email protected]. | ||
::: | ||
|
||
## What is NLWeb | ||
|
||
[NLWeb](https://github.com/nlweb-ai/NLWeb) is an open project developed by Microsoft that defines a standard protocol for natural language queries on websites. Its goal is to make every website as accessible and interactive as a conversational AI app, so both people and AI agents can reliably query site content. It does this by exposing two key endpoints: | ||
|
||
- `/ask`: Conversational endpoint for user queries | ||
- `/mcp`: Structured Model Context Protocol (MCP) endpoint for AI agents | ||
|
||
## How to use it | ||
|
||
You can deploy NLWeb on your website directly through the AutoRAG dashboard: | ||
|
||
1. Log in to your [Cloudflare dashboard](https://dash.cloudflare.com/). | ||
2. Go to **Compute & AI** > **AutoRAG**. | ||
3. Select **Create AutoRAG**, then choose the **NLWeb Website** option. | ||
4. Select your domain from your Cloudflare account. | ||
5. Click **Start indexing**. | ||
|
||
Once complete, AutoRAG will crawl and index your site, then deploy an NLWeb Worker for you. | ||
|
||
## What this template includes | ||
|
||
Choosing the NLWeb Website option extends a normal AutoRAG by tailoring it for content‑heavy websites and giving you everything that is required to adopt NLWeb as the standard for conversational search on your site. Specifically, the template provides: | ||
|
||
- **Website as a data source:** Uses [Website](/autorag/configuration/data-source/website/) as data source option to crawl and ingest pages with the Rendered Sites option. | ||
- **Defaults for content-heavy websites:** Applies tuned embedding and retrieval configurations ideal for publishing and content‑rich websites. | ||
- **NLWeb Worker deployment:** Automatically spins up a Cloudflare Worker from the [NLWeb Worker template](https://github.com/cloudflare/templates). | ||
|
||
## What the Worker includes | ||
|
||
Your deployed Worker provides two endpoints: | ||
|
||
- `/ask` — NLWeb’s standard conversational endpoint | ||
- Powers the conversational UI at the root (`/`) | ||
- Powers the embeddable preview widget (`/snippet.html`) | ||
- `/mcp` — NLWeb’s MCP server endpoint for trusted AI agents | ||
|
||
These endpoints give both people and agents structured access to your content. | ||
|
||
## Using It on Your Website | ||
|
||
To integrate NLWeb search directly into your site you can: | ||
|
||
1. Find your deployed Worker in the [Cloudflare dashboard](https://dash.cloudflare.com/): | ||
- Go to **Compute & AI** > **AutoRAG**. | ||
- Select **Connect**, then go to the **NLWeb** tab. | ||
- Select **Go to Worker**. | ||
2. Add a [custom domain](/workers/configuration/routing/custom-domains/) to your Worker (for example, ask.example.com) | ||
3. Use the `/ask` endpoint on your custom domain to power the search (for example, ask.example.com/ask) | ||
|
||
You can also use the embeddable snippet to add a search UI directly into your website. For example: | ||
|
||
```html | ||
<!-- Add css on head --> | ||
<link rel="stylesheet" href="https://ask.example.com/nlweb-dropdown-chat.css"> | ||
<link rel="stylesheet" href="https://ask.example.com/common-chat-styles.css"> | ||
|
||
<!-- Add container on body --> | ||
<div id="docs-search-container"></div> | ||
|
||
<!-- Include JavaScript --> | ||
<script type="module"> | ||
import { NLWebDropdownChat } from 'https://ask.example.com/nlweb-dropdown-chat.js'; | ||
|
||
const chat = new NLWebDropdownChat({ | ||
containerId: 'docs-search-container', | ||
site: 'https://ask.example.com', | ||
placeholder: 'Search for docs...', | ||
endpoint: 'https://ask.example.com' | ||
}); | ||
</script> | ||
``` | ||
|
||
This lets you serve conversational AI search directly from your own domain, with control over how people and agents access your content. | ||
|
||
|
||
## Modifying or updating the Worker | ||
|
||
You may want to customize your Worker, for example, to adjust the UI for the embeddable snippet. In those cases, we recommend calling the `/ask` endpoint for queries and building your own UI on top of it, however, you may also choose to modify the Worker's code for the embeddable UI. | ||
|
||
If the NLWeb standard is updated, you can update your Worker to stay compatible and recieve the latest updates. | ||
|
||
The simplest way to apply changes or updates is to redeploy the Worker template: | ||
|
||
[](https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/templates/tree/main/nlweb-template) | ||
|
||
To do so: | ||
|
||
1. Select the **Deploy to Cloudflare** button from above to deploy the Worker template to your Cloudflare account. | ||
2. Enter the name of your AutoRAG in the `RAG_ID` environment variable field. | ||
3. Click **Deploy**. | ||
4. Select the **GitHub/GitLab** icon on the Workers Dashboard. | ||
4. Clone the repository that is created for your Worker. | ||
5. Make your modifications, then commit and push changes to the repository to update your Worker. | ||
|
||
Now you can use this Worker as the new NLWeb endpoint for your website. |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.