随笔分类 -  GenAI

摘要:While iframe-based UI components provide rich, visual interfaces, they need a way to communicate back to the host application to trigger actions, requ 阅读全文
posted @ 2026-02-09 14:32 Zhentiw 阅读(4) 评论(0) 推荐(0)
摘要:When iframes load in AI chat, the host application doesn't know when they're ready to receive data or handle interactions. Without this handshake, use 阅读全文
posted @ 2026-02-02 14:23 Zhentiw 阅读(7) 评论(0) 推荐(0)
摘要:While raw HTML and Remote DOM provide great ways to create UI components, they have limitations when it comes to building truly complex, interactive a 阅读全文
posted @ 2026-01-30 15:03 Zhentiw 阅读(7) 评论(0) 推荐(0)
摘要:While raw HTML gives us visual interfaces, it has limitations when it comes to creating truly interactive and consistent user experiences. Raw HTML re 阅读全文
posted @ 2026-01-29 14:53 Zhentiw 阅读(4) 评论(0) 推荐(0)
摘要:MCP UI enables servers to send rich, interactive user interfaces along with their responses, transforming AI chat from text-only interactions into vis 阅读全文
posted @ 2026-01-29 14:51 Zhentiw 阅读(6) 评论(0) 推荐(0)
摘要:n a web application, the buttons, links, and data that you see change based on the context. Whether the user is currently logged in, whether there is 阅读全文
posted @ 2026-01-27 14:48 Zhentiw 阅读(12) 评论(0) 推荐(0)
摘要:It's common that there are some operation are taking longer time, in such cases, we need to consider: Report progress Allow cancellation The Model Con 阅读全文
posted @ 2026-01-26 15:06 Zhentiw 阅读(4) 评论(0) 推荐(0)
摘要:Modern AI applications often need to generate new content (whether that's text, images, or more) on demand. This process is called sampling: asking a 阅读全文
posted @ 2026-01-23 14:43 Zhentiw 阅读(4) 评论(0) 推荐(0)
摘要:Modern AI applications often need to collect structured input from users at key moments in a workflow. Elicitation in the Model Context Protocol (MCP) 阅读全文
posted @ 2026-01-22 14:47 Zhentiw 阅读(5) 评论(0) 推荐(0)
摘要:Sometimes there are common workflows for people using your MCP server you want to make easier for users. You may not want your users to have to write 阅读全文
posted @ 2026-01-20 15:06 Zhentiw 阅读(4) 评论(0) 推荐(0)
摘要:Embedded resource:In Tools, you can also embed the resouce as additional information. https://modelcontextprotocol.io/specification/2025-06-18/server/ 阅读全文
posted @ 2026-01-19 14:35 Zhentiw 阅读(5) 评论(0) 推荐(0)
摘要:In previous exercises, you learned how to extend your MCP server with tools—server-defined functions that let clients perform actions or retrieve data 阅读全文
posted @ 2026-01-17 19:31 Zhentiw 阅读(3) 评论(0) 推荐(0)
摘要:什么是 Agent 基础篇Agent概念 不是指的 AI 智能体,而是指代理服务器。 代理服务器充当用户和模型交流的中间人。 Agent: 狭义:代理服务器 广义:AI智能体(AI Agent) 什么是AI Agent AI Agent,中文称之为“AI智能体”,本质上是能自主感知环境,进行规划与决 阅读全文
posted @ 2025-11-19 15:08 Zhentiw 阅读(37) 评论(0) 推荐(0)
摘要:在使用 LangChain 构建大模型应用时,提示词(Prompt)设计是第一步。但直接写死字符串容易出错、复用性差,也不利于维护。这时候就该用上 LangChain 提供的 Prompt Template —— 一个专为语言模型设计的提示词模板工具。 快速上手 无变量,纯字符串模板 import 阅读全文
posted @ 2025-10-18 17:55 Zhentiw 阅读(57) 评论(0) 推荐(0)
摘要:在实际开发 AI 应用的过程中,我们经常会遇到重复输入的情况: 同一用户多次询问相同的问题 刷新页面或误触按钮触发了相同请求 不同用户提出了内容高度相似的问题 如果每次都让大模型重新生成响应,不仅效率低下,还会带来不必要的计算成本。为了解决这个问题,我们可以引入“缓存机制”。 启用缓存的好处 提升响 阅读全文
posted @ 2025-10-18 17:05 Zhentiw 阅读(20) 评论(0) 推荐(0)
摘要:LoRA 英文全称为 Low-Rank Adaptation,中文:“低秩适配器” 秩的概念 英文 Rank 中文:秩 所谓秩,指的就是一个矩阵中 真正包含的信息量 有多少。 🙋小红买了 3 个苹果 4 个桃子,花了 18 元,小明买了 2 个苹果 3 个桃子,花了 13 元,请问苹果和桃子各多少 阅读全文
posted @ 2025-10-13 13:52 Zhentiw 阅读(36) 评论(0) 推荐(0)
摘要:英文:Fine-tuning 中文:大模型微调 大模型的构建其实分为 2 个阶段: 预训练(pre-training):此阶段模型会在 大规模、多样化的数据集 上进行训练,从而形成全面的语言理解能力。 微调(fine-tuning):在规模较小的 特定任务或特定领域数据集 上对模型进行 针对性的训练 阅读全文
posted @ 2025-10-13 13:52 Zhentiw 阅读(37) 评论(0) 推荐(0)
摘要:RAG架构演进 RAG 的概念和思想最早是在 2020 年由 Meta 公司的技术团队在文章 “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks” 中正式提出的,用于给当时已经开始出现的大型预训练语言模型提供来自外部的 阅读全文
posted @ 2025-10-12 16:42 Zhentiw 阅读(59) 评论(0) 推荐(0)
摘要:RAG经典架构: 数据索引 读取外挂语料库的时候,语料库是一个 pdf 文件,需要一个额外的依赖:pdf-parse 转化为向量嵌入:nomic-embed-text function getEmbedding(text) { const res = await fetch("http://loca 阅读全文
posted @ 2025-10-12 16:41 Zhentiw 阅读(20) 评论(0) 推荐(0)
摘要:远程通信方式 通信方式: Stdio: 推荐,高效、简洁、本地 Streamable HTTP: 远程 前置知识 SSE 全称 Server-Sent Events,中文是“服务器发送事件”。是一种基于 HTTP 的单向通信协议,由浏览器发起连接,服务器可以持续不断地向客户端推送数据。 你可以把它想 阅读全文
posted @ 2025-10-06 14:22 Zhentiw 阅读(151) 评论(0) 推荐(0)