Skip to content

Commit 8fac45c

Browse files
Add new summaries
1 parent cd3559e commit 8fac45c

File tree

4 files changed

+326
-0
lines changed

4 files changed

+326
-0
lines changed
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
---
2+
layout: post
3+
---
4+
# What is NLWeb?
5+
- URL: [原文](https://glama.ai/blog/2025-06-01-what-is-nlweb)
6+
- Added At: 2025-06-06 02:01:28
7+
- [Link To Text](_posts/2025-06-06-what-is-nlweb_raw.md)
8+
9+
## TL;DR
10+
NLWeb是由微软开源的协议,旨在通过利用Schema.org结构化数据和模型上下文协议(MCP),为网站添加对话式AI接口。它通过多个LLM调用来处理查询,提供更精确的答案,并解决传统搜索的不足。虽然快速原型易于搭建,但大规模生产部署,优化成本以及维护数据新鲜度等方面仍面临挑战。对于已有结构化数据并寻求对话式搜索和AI代理访问的用户,NLWeb值得关注。
11+
12+
13+
## Summary
14+
1. **NLWeb定义**: Microsoft开源的NLWeb是一种为网站添加对话式接口的协议,利用Schema.org结构化数据并支持MCP(模型上下文协议),促进人机和机机通信。
15+
* **关键理念**: 将任何网站转变为人类和AI agent都能自然查询的对话式界面。
16+
17+
2. **问题解决**: NLWeb旨在解决当前网站结构化数据缺乏标准AI访问方式的问题,并改进传统搜索在上下文感知和多轮查询方面的不足。
18+
* **类比**: 类似于RSS对内容聚合的贡献,NLWeb为AI交互提供了一个标准协议。
19+
* **核心优势**: 利用LLM对Schema.org的理解,快速创建对话式接口。
20+
21+
3. **工作原理**: NLWeb采用双组件系统和查询处理流程。
22+
* **双组件系统**:
23+
- **协议层**: REST API ( `/ask` endpoint) 和 MCP server (`/mcp` endpoint),接受自然语言查询并返回 Schema.org JSON 响应。
24+
- **实现层**: 参考实现,编排多个LLM调用以进行查询处理。
25+
* **查询处理流程**:
26+
User Query → Parallel Pre-processing → Vector Retrieval → LLM Ranking → Response (包含 Relevancy Check, Decontextualization, Memory Detection) → Fast Track Path
27+
* **LLM调用**: 单个查询可能触发50+个定向LLM调用,用于查询去语境化、相关性评分、结果排序等。
28+
* **快速通道优化**: 在预处理期间并行启动检索,但结果会阻塞直到完成相关性检查。
29+
30+
4. **多LLM调用**: NLWeb将查询分解为多个小型、具体的LLM调用,而非一个大型提示。
31+
* **示例问题**:
32+
- "这个查询是关于菜谱的吗?"
33+
- "它是否引用了之前提到的内容?"
34+
- "用户是否要求记住饮食偏好?"
35+
- "这个特定结果的相关性如何?"
36+
* **主要优点**:
37+
- **无幻觉**: 结果仅来自实际数据库。
38+
- **更高精度**: 每个LLM调用都有一个清晰的任务可以做好。
39+
40+
5. **快速上手**: Microsoft提供了一个快速入门指南,用于设置带有Behind The Tech RSS feed的NLWeb服务器。
41+
* **步骤示例**:
42+
```bash
43+
git clone https://github.com/microsoft/NLWeb
44+
cd NLWeb
45+
python -m venv myenv
46+
source myenv/bin/activate
47+
cd code
48+
pip install -r requirements.txt
49+
# Configure (copy .env.template → .env, update API keys)
50+
# Load data
51+
python -m tools.db_load https://feeds.libsyn.com/121695/rss Behind-the-Tech
52+
# Run
53+
python app-file.py
54+
```
55+
* **验证**: 访问 `localhost:8000` 检查 NLWeb server 是否工作。
56+
* **CLI工具**: 仓库包含一个CLI工具来简化配置、测试和执行,但作者未能成功使用。
57+
58+
6. **Glama NLWeb服务器**: 作者构建了一个简单的NLWeb服务器,可以使用它来查询MCP服务器目录。
59+
* **示例请求**:
60+
```bash
61+
curl -X POST https://glama.ai/nlweb/ask \
62+
-H "Content-Type: application/json" \
63+
-d '{"query": "MCP servers for working with GitHub"}'
64+
```
65+
* **其他功能**: 能够继续对话,总结或生成结果。
66+
* **实施便利**: 已经存在MCP服务器的嵌入和向量存储,并且有调用LLM的方式。
67+
68+
7. **REST API**: NLWeb在`/ask``/mcp`端点支持两个API,参数基本相同。
69+
* **/mcp端点**: 返回MCP客户端可以使用的格式,并支持核心MCP方法。
70+
* **/ask端点**:
71+
- **参数**:
72+
- `query`: 自然语言问题
73+
- `site`: 限定到特定数据子集
74+
- `prev`: 逗号分隔的先前查询
75+
- `decontextualized_query`: 如果提供,则跳过去语境化
76+
- `streaming`: 启用SSE流式传输
77+
- `query_id`: 跟踪对话
78+
- `mode`: `list``summarize``generate`
79+
80+
8. **MCP集成**: NLWeb默认包含一个MCP服务器,可以配置Claude for Desktop与之通信。
81+
* **配置步骤**: 将相关配置添加到`claude_desktop_config.json`
82+
83+
9. **实施现实**: 拥有Schema.org markup或RSS feed可以快速运行一个基本原型。
84+
* **容易实现的**:
85+
- 加载RSS feeds或Schema.org数据
86+
- 使用提供的提示的基本搜索功能
87+
- 使用Qdrant进行本地开发
88+
* **需要更多努力的**:
89+
- 大规模生产部署
90+
- 优化每个查询的50多个LLM调用
91+
- 针对您的域的自定义提示工程
92+
- 维护向量存储和实时数据之间的数据新鲜度
93+
* **成本考量**: 需要考虑LLM调用的成本。
94+
95+
10. **是否应该关注**:
96+
* **应该**: 已经有结构化数据,需要超越关键词的对话式搜索,需要通过MCP进行程序化AI代理访问,以及可以试验早期阶段的技术。
97+
* **不应该**: 需要经过实战检验的生产代码,无法承担高昂的LLM API成本,内容结构不佳,以及期望即插即用的简易性。
98+
99+
11. **总结**: NLWeb作为战略方向比作为当前技术更有意义,由Schema.org、RSS和RDF的创建者R.V. Guha开发,证明了其可行性,但从原型到生产仍需努力。
100+
101+
Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
---
2+
layout: post
3+
---
4+
Title: What is NLWeb?
5+
6+
URL Source: https://glama.ai/blog/2025-06-01-what-is-nlweb
7+
8+
Markdown Content:
9+
Microsoft recently open-sourced [NLWeb](https://github.com/microsoft/NLWeb), a protocol for adding conversational interfaces to websites.[1](https://glama.ai/blog/2025-06-01-what-is-nlweb#user-content-fn-1) It leverages [Schema.org](https://schema.org/) structured data that many sites already have and includes built-in support for MCP (Model Context Protocol), enabling both human conversations and agent-to-agent communication.
10+
11+
**The key idea:** NLWeb creates a standard protocol that turns any website into a conversational interface that both humans and AI agents can query naturally.
12+
13+
**Want to try NLWeb?**
14+
15+
As part of writing this post, I've implemented NLWeb search for MCP servers. Refer to the "Glama NLWeb Server" section for examples.
16+
17+
What Problem Does NLWeb Solve?
18+
------------------------------
19+
20+
Currently, websites have structured data (Schema.org) but no standard way for AI agents or conversational interfaces to access it. Every implementation is bespoke. Traditional search interfaces struggle with context-aware, multi-turn queries.
21+
22+
NLWeb creates a standard protocol for conversational access to web content. Like RSS did for syndication, NLWeb does for AI interactions - one implementation serves both human chat interfaces and programmatic agent access.
23+
24+
The key insight: Instead of building custom NLP for every site, NLWeb leverages LLMs' existing understanding of Schema.org to create instant conversational interfaces.
25+
26+
The real power comes from multi-turn conversations that preserve context:
27+
28+
1. "Find recipes for dinner parties"
29+
2. "Only vegetarian options"
30+
3. "That can be prepared in under an hour"
31+
32+
Each query builds on the previous context - something traditional search interfaces struggle with.
33+
34+
How NLWeb Works
35+
---------------
36+
37+
### Two-Component System
38+
39+
1. **Protocol Layer**: REST API (`/ask` endpoint) and MCP server (`/mcp` endpoint) that accept natural language queries and return Schema.org JSON responses
40+
2. **Implementation Layer**: Reference implementation that orchestrates multiple LLM calls for query processing
41+
42+
### Query Processing Pipeline
43+
44+
User Query → Parallel Pre-processing → Vector Retrieval → LLM Ranking → Response ├─ Relevancy Check ├─ Decontextualization ├─ Memory Detection └─ Fast Track Path
45+
46+
In this flow, a single query may trigger 50+ targeted LLM calls for:
47+
48+
* Query decontextualization based on conversation history
49+
* Relevancy scoring against site content
50+
* Result ranking with custom prompts per content type
51+
* Optional post-processing (summarization/generation)
52+
53+
The "fast track" optimization launches a parallel path to retrieval (step 3) while pre-processing occurs, but results are blocked until relevancy checks complete[2](https://glama.ai/blog/2025-06-01-what-is-nlweb#user-content-fn-2).
54+
55+
### Video Explanation
56+
57+
After I wrote this article, I was sent this video which includes a great introduction to NLWeb by R.V. Guha (creator of Schema.org, RSS, and RDF):
58+
59+
### Why 50+ LLM Calls?
60+
61+
Instead of using one large prompt to handle everything, NLWeb breaks each query into dozens of small, specific questions:
62+
63+
* "Is this query about recipes?"
64+
* "Does it reference something mentioned earlier?"
65+
* "Is the user asking to remember dietary preferences?"
66+
* "How relevant is this specific result?"
67+
68+
This approach has two major benefits:
69+
70+
1. **No hallucination** - Results only come from your actual database
71+
2. **Better accuracy** - Each LLM call has one clear job it can do well
72+
73+
Think of it like having a team of specialists instead of one generalist.
74+
75+
Even if you don't use NLWeb, this pattern—using many focused LLM calls instead of one complex prompt—is worth borrowing.
76+
77+
Quick Start
78+
-----------
79+
80+
The best way to wrap your head around NLWeb is to try it out.
81+
82+
Microsoft provides a [quick start guide](https://github.com/microsoft/NLWeb/blob/main/docs/nlweb-hello-world.md) for setting up an example NLWeb server with [Behind The Tech](https://www.microsoft.com/en-us/behind-the-tech) RSS feed.
83+
84+
# Setup git clone https://github.com/microsoft/NLWeb cd NLWeb python -m venv myenv source myenv/bin/activate cd code pip install -r requirements.txt # Configure (copy .env.template → .env, update API keys) # Load data python -m tools.db_load https://feeds.libsyn.com/121695/rss Behind-the-Tech # Run python app-file.py
85+
86+
Go to [localhost:8000](http://localhost:8000/) and you should have a working NLWeb server.
87+
88+
I have also noticed that the repository contains a [CLI](https://github.com/microsoft/NLWeb/blob/main/docs/nlweb-cli.md) to simplify configuration, testing, and execution of the application. However, I struggled to get it working.
89+
90+
Once you have the server running, you can ask it questions like:
91+
92+
curl -X POST http://localhost:8000/ask \ -H "Content-Type: application/json" \ -d '{ "query": "tell me more about the first one", "prev": "find podcasts about AI,what topics do they cover" }'
93+
94+
which will return a JSON response like:
95+
96+
{ "query_id": "abc123", "results": [{ "url": "https://...", "name": "AI Safety with Stuart Russell", "score": 85, "description": "Discussion on alignment challenges...", "schema_object": { "@type": "PodcastEpisode", ... } }] }
97+
98+
### Glama NLWeb Server
99+
100+
As part of writing this post, I've built a simple NLWeb server using Node.js. You can use it to query our [MCP server](https://glama.ai/mcp/servers) directory:
101+
102+
curl -X POST https://glama.ai/nlweb/ask \ -H "Content-Type: application/json" \ -d '{"query": "MCP servers for working with GitHub"}'
103+
104+
As far as I can tell, this is the first ever public NLWeb endpoint!
105+
106+
Due to the volume of LLM calls, it takes a few seconds to respond.
107+
108+
or, if you want to continue the conversation:
109+
110+
curl -X POST https://glama.ai/nlweb/ask \ -H "Content-Type: application/json" \ -d '{ "query": "servers that can create PRs", "prev": "MCP servers for working with GitHub" }'
111+
112+
or, if you want to summarize the results:
113+
114+
curl -X POST https://glama.ai/nlweb/ask \ -H "Content-Type: application/json" \ -d '{ "query": "MCP servers for working with GitHub", "mode": "summarize" }'
115+
116+
Useful when you want an overview rather than just a list of results.
117+
118+
or, if you want to generate a response:
119+
120+
curl -X POST https://glama.ai/nlweb/ask \ -H "Content-Type: application/json" \ -d '{ "query": "MCP servers for working with GitHub", "mode": "generate" }'
121+
122+
This mode attempts to answer the question using the retrieved results (like traditional RAG)
123+
124+
Things that made it easy to implement:
125+
126+
* We have existing embeddings for every MCP server and a vector store
127+
* We already have a way to make LLM calls
128+
129+
A few questions came to mind as I was implementing this:
130+
131+
* It seems that NLWeb doesn't dictate where the `/ask` endpoint needs to be hosted—does it have to be `https://glama.ai/ask` or can it be `https://glama.ai/nlweb/ask`?
132+
* It wasn't super clear to me which Schema.org data is best suited to describe MCP servers.
133+
134+
Not surprisingly, the slowest part of the pipeline is the LLM calls.
135+
136+
REST API
137+
--------
138+
139+
Currently, NLWeb supports two APIs at the endpoints `/ask` and `/mcp`. The arguments are the same for both, as is most of the functionality. The `/mcp` endpoint returns the answers in format that MCP clients can use. The `/mcp` endpoint also supports the core MCP methods (`list_tools`, `list_prompts`, `call_tool` and `get_prompt`).
140+
141+
The `/ask` endpoint supports the following parameters:
142+
143+
| Parameter | Type | Description |
144+
| --- | --- | --- |
145+
| `query` | `string` | Natural language question |
146+
| `site` | `string` | Scope to specific data subset |
147+
| `prev` | `string` | Comma-separated previous queries |
148+
| `decontextualized_query` | `string` | Skip decontextualization if provided |
149+
| `streaming` | `bool` | Enable SSE streaming |
150+
| `query_id` | `string` | Track conversation |
151+
| `mode` | `string` | `list`, `summarize`, or `generate` |
152+
153+
Integrating with MCP
154+
--------------------
155+
156+
Since NLWeb includes an MCP server by default, you can configure Claude for Desktop to talk to NLWeb.
157+
158+
If you already have the NLWeb server running, this should be as simple as adding the following to your `~/Library/Application Support/Claude/claude_desktop_config.json` configuration:
159+
160+
{ "mcpServers": { "ask_nlw": { "command": "/Users/yourname/NLWeb/myenv/bin/python", "args": [ "/Users/yourname/NLWeb/code/chatbot_interface.py", "--server", "http://localhost:8000", "--endpoint", "/mcp" ], "cwd": "/Users/yourname/NLWeb/code" } } }
161+
162+
Implementation Reality
163+
----------------------
164+
165+
The documentation suggests you can get a basic prototype running quickly if you have existing Schema.org markup or RSS feeds.
166+
167+
**What's actually straightforward:**
168+
169+
* Loading RSS feeds or Schema.org data
170+
* Basic search functionality with provided prompts
171+
* Local development with Qdrant
172+
173+
**What requires more effort:**
174+
175+
* Production deployment at scale
176+
* Optimizing 50+ LLM calls per query (mentioned in docs)
177+
* Custom prompt engineering for your domain
178+
* Maintaining data freshness between vector store and live data
179+
180+
I already had a lot of these components in place, so I was able to get a basic prototype running in an hour. However, to make this production-ready, I'd need to think a lot more time about the cost of the LLM calls.
181+
182+
Should You Care?
183+
----------------
184+
185+
**Yes if:**
186+
187+
* You have structured data (Schema.org, RSS) already
188+
* You want to enable conversational search beyond keywords
189+
* You need programmatic AI agent access via MCP
190+
* You can experiment with early-stage tech
191+
192+
**No if:**
193+
194+
* You need battle-tested production code
195+
* You can't handle significant LLM API costs
196+
* Your content isn't well-structured
197+
* You expect plug-and-play simplicity
198+
199+
Bottom Line
200+
-----------
201+
202+
NLWeb is more interesting as a strategic direction than as current technology. NLWeb was conceived and developed by R.V. Guha (creator of Schema.org, RSS, and RDF), now a CVP and Technical Fellow at Microsoft[3](https://glama.ai/blog/2025-06-01-what-is-nlweb#user-content-fn-3). That's serious pedigree.
203+
204+
The O'Reilly prototype proves it's viable for content-heavy sites. The quick start shows it's approachable for developers. But "prototype in days" doesn't mean "production in weeks."
205+
206+
Think of it as an investment in making your content natively conversational. The technical foundation is solid—REST API, standard formats, proven vector stores. The vision is compelling. The code needs work.
207+
208+
Want to experiment? Clone the repo and try the quick start above.
209+
210+
Footnotes
211+
---------
212+
213+
1. [https://news.microsoft.com/source/features/company-news/introducing-nlweb-bringing-conversational-interfaces-directly-to-the-web/](https://news.microsoft.com/source/features/company-news/introducing-nlweb-bringing-conversational-interfaces-directly-to-the-web/)[](https://glama.ai/blog/2025-06-01-what-is-nlweb#user-content-fnref-1)
214+
215+
2. [https://github.com/microsoft/NLWeb](https://github.com/microsoft/NLWeb)[](https://glama.ai/blog/2025-06-01-what-is-nlweb#user-content-fnref-2)
216+
217+
3. [https://techcommunity.microsoft.com/blog/azure-ai-services-blog/nlweb-pioneer-qa-oreilly/4415299](https://techcommunity.microsoft.com/blog/azure-ai-services-blog/nlweb-pioneer-qa-oreilly/4415299)[](https://glama.ai/blog/2025-06-01-what-is-nlweb#user-content-fnref-3)
218+

data.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,5 +370,11 @@
370370
"title": "[ On | No ] syntactic support for error handling - The Go Programming Language",
371371
"url": "https://go.dev/blog/error-syntax",
372372
"timestamp": 1749175237
373+
},
374+
{
375+
"month": "202506",
376+
"title": "What is NLWeb?",
377+
"url": "https://glama.ai/blog/2025-06-01-what-is-nlweb",
378+
"timestamp": 1749175326
373379
}
374380
]

summary.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
读取 bookmark-collection 中的书签,使用 jina reader 获取文本内容,然后使用 LLM 总结文本。详细实现请参见 process_changes.py。需要和 bookmark-collection 中的 Github Action 一起使用。
33

44
## Summarized Bookmarks
5+
- (2025-06-06) [What is NLWeb?](_posts/202506/2025-06-06-what-is-nlweb.md)
56
- (2025-06-06) [[ On | No ] syntactic support for error handling - The Go Programming Language](_posts/202506/2025-06-06-%5B-on-no-%5D-syntactic-support-for-error-handling---the-go-programming-language.md)
67
- (2025-06-05) [利用GitHub Actions自动对仓库内图片进行无损压缩](_posts/202506/2025-06-05-%E5%88%A9%E7%94%A8github-actions%E8%87%AA%E5%8A%A8%E5%AF%B9%E4%BB%93%E5%BA%93%E5%86%85%E5%9B%BE%E7%89%87%E8%BF%9B%E8%A1%8C%E6%97%A0%E6%8D%9F%E5%8E%8B%E7%BC%A9.md)
78
- (2025-06-04) [Hugo使用Shortcode插入bilibili、Youtube视频](_posts/202506/2025-06-04-hugo%E4%BD%BF%E7%94%A8shortcode%E6%8F%92%E5%85%A5bilibili%E3%80%81youtube%E8%A7%86%E9%A2%91.md)

0 commit comments

Comments
 (0)