<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Langchain本地RAG系统从零搭建 on 有趣的AI</title>
    <link>http://www.wfcoding.com/series/langchain%E6%9C%AC%E5%9C%B0rag%E7%B3%BB%E7%BB%9F%E4%BB%8E%E9%9B%B6%E6%90%AD%E5%BB%BA/</link>
    <description>Recent content in Langchain本地RAG系统从零搭建 on 有趣的AI</description>
    <generator>Hugo -- 0.164.0</generator>
    <language>zh-CN</language>
    <copyright>火云</copyright>
    <lastBuildDate>Fri, 03 Oct 2025 00:00:00 +0000</lastBuildDate>
    <atom:link href="http://www.wfcoding.com/series/langchain%E6%9C%AC%E5%9C%B0rag%E7%B3%BB%E7%BB%9F%E4%BB%8E%E9%9B%B6%E6%90%AD%E5%BB%BA/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>[合集]Langchain本地RAG系统从零搭建</title>
      <link>http://www.wfcoding.com/articles/practice/01langchain%E6%9C%AC%E5%9C%B0rag%E7%B3%BB%E7%BB%9F%E4%BB%8E%E9%9B%B6%E6%90%AD%E5%BB%BA/</link>
      <pubDate>Thu, 10 Oct 2024 00:00:00 +0000</pubDate>
      <guid>http://www.wfcoding.com/articles/practice/01langchain%E6%9C%AC%E5%9C%B0rag%E7%B3%BB%E7%BB%9F%E4%BB%8E%E9%9B%B6%E6%90%AD%E5%BB%BA/</guid>
      <description>&lt;p&gt;此系列文章详细的阐述了如何从第一行代码开始搭建一个可以运行完全在本地服务器的&lt;code&gt;RAG&lt;/code&gt;(&lt;code&gt;Retrieval Augmented Generation&lt;/code&gt;)系统，包含了详细的步骤说明和代码，它是保姆级教程。&lt;br&gt;
它主要包含以下功能：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;使用本地大语言模型做语言翻译&lt;/li&gt;
&lt;li&gt;使用本地大语言模型做专业领域的知识问答&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&#34;position:relative;width:100%;height:315px;&#34;&gt;
  &lt;iframe src=&#34;assert/vuetify_langchian_rag_demo.mp4&#34; style=&#34;position:absolute;top:0;left:0;width:100%;height:100%;&#34; frameborder=&#34;0&#34; allowfullscreen&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;p&gt;从系统架构来看，本系统包含了前端、API网关、后台服务三大部分：
&lt;img loading=&#34;lazy&#34; src=&#34;assert/arch.png&#34; alt=&#34;基本架构&#34;  /&gt;
&lt;/p&gt;</description>
    </item>
    <item>
      <title>如何选择FAISS的索引类型</title>
      <link>http://www.wfcoding.com/articles/practice/0115/</link>
      <pubDate>Fri, 03 Oct 2025 00:00:00 +0000</pubDate>
      <guid>http://www.wfcoding.com/articles/practice/0115/</guid>
      <description>&lt;p&gt;在之前的文章中，我们系统性的介绍了 &lt;a href=&#34;http://wfcoding.com/articles/programmer/p13/&#34;&gt;嵌入和语义检索&lt;/a&gt; 以及 &lt;a href=&#34;http://wfcoding.com/articles/programmer/p14/&#34;&gt;向量相似度&lt;/a&gt;。&lt;br&gt;
本文将在&lt;strong&gt;语义检索&lt;/strong&gt;领域探讨更加接近实战的话题：如何如何选择FAISS的索引类型。&lt;br&gt;
&lt;strong&gt;Faiss&lt;/strong&gt; 是一个用于高效相似性搜索和密集向量聚类的库。它使用 C++ 编写，并提供了完整的 Python 封装。 可以在 CPU 上运行，只是一些最有用的算法是在 GPU 上实现的。它的主要功能是：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;k-NN 检索&lt;/strong&gt;: 不仅返回最近的邻居，还返回第二近、第三近、……、第 k 近的邻居；&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;批量处理&lt;/strong&gt;: 一次搜索多个向量，而不是一次搜索一个。 对于许多索引类型，这比一个接一个地搜索向量更快；&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;以精度换取速度&lt;/strong&gt;: 以 10% 的不正确结果为代价，换取 10 倍的速度或使用更少的内存；&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;范围搜索&lt;/strong&gt;：返回查询点给定半径内的所有元素；&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;本地存储&lt;/strong&gt;： 将索引存储在磁盘上而不是在 RAM 中；&lt;/li&gt;
&lt;li&gt;&amp;hellip;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;</description>
    </item>
    <item>
      <title>用图形验证码增强用户认证安全性[python&#43;vuetify]</title>
      <link>http://www.wfcoding.com/articles/practice/0114/</link>
      <pubDate>Sun, 05 Jan 2025 00:00:00 +0000</pubDate>
      <guid>http://www.wfcoding.com/articles/practice/0114/</guid>
      <description>&lt;p&gt;这里通过代码讲述了使用&lt;code&gt;python&lt;/code&gt;生成以及校验图片验证码，增强用户认证安全性的过程。&lt;br&gt;
客户端则使用 &lt;code&gt;vue3&lt;/code&gt; 和 &lt;code&gt;vuetify3&lt;/code&gt; 框架使用后台API生成的图片验证码。&lt;/p&gt;
&lt;p&gt;&lt;img loading=&#34;lazy&#34; src=&#34;image/01.jpg&#34; alt=&#34;图片验证码&#34;  /&gt;
&lt;/p&gt;</description>
    </item>
    <item>
      <title>[python]实现可以自动清除过期条目的缓存</title>
      <link>http://www.wfcoding.com/articles/practice/0113/</link>
      <pubDate>Sat, 04 Jan 2025 00:00:00 +0000</pubDate>
      <guid>http://www.wfcoding.com/articles/practice/0113/</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;由于有缓存图片验证码的需要，所以我找了一些开源的缓存想直接使用，结果要么太老旧，要么太复杂，要么和 &lt;code&gt;fastAPI&lt;/code&gt; 整合有问题，所以才想到自己写一个简单的，够用就好。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;本文讲述了如何实现一个简单的内存缓存，他可以把过期的键值自动清除，在缓存验证码等场合应该很好用。&lt;/p&gt;</description>
    </item>
    <item>
      <title>基于OAuth2.0和JWT规范实现安全易用的用户认证</title>
      <link>http://www.wfcoding.com/articles/practice/0112/</link>
      <pubDate>Wed, 01 Jan 2025 00:00:00 +0000</pubDate>
      <guid>http://www.wfcoding.com/articles/practice/0112/</guid>
      <description>&lt;p&gt;遵循&lt;code&gt;OAuth2.0&lt;/code&gt;和&lt;code&gt;JWT&lt;/code&gt;规范实现用户认证，不但具有很好的实用性，还能提供很不错的安全保障。&lt;br&gt;
本文结合实用的代码讲述了基于&lt;code&gt;OAuth2.0&lt;/code&gt;和&lt;code&gt;JWT&lt;/code&gt;，在前后端分离的系统中，实现用户使用方便而又安全可靠的用户认证的基本思路。&lt;/p&gt;</description>
    </item>
    <item>
      <title>基于FastAPI和JWT实现OAuth2用户认证</title>
      <link>http://www.wfcoding.com/articles/practice/0111/</link>
      <pubDate>Sun, 01 Dec 2024 00:00:00 +0000</pubDate>
      <guid>http://www.wfcoding.com/articles/practice/0111/</guid>
      <description>&lt;p&gt;本文阐述了如何基于&lt;code&gt;FastAPI&lt;/code&gt;框架实现 &lt;code&gt;OAuth2&lt;/code&gt;用户认证，其中使用哈希算法对密码进行了加密，使用 &lt;code&gt;JWT&lt;/code&gt; 持有令牌。&lt;br&gt;
附带完整的代码，避免大家再次踩坑。&lt;/p&gt;</description>
    </item>
    <item>
      <title>使用FastAPI实现简单的OAuth2的Password和Bearer验证</title>
      <link>http://www.wfcoding.com/articles/practice/0110/</link>
      <pubDate>Sun, 01 Dec 2024 00:00:00 +0000</pubDate>
      <guid>http://www.wfcoding.com/articles/practice/0110/</guid>
      <description>&lt;p&gt;本文讲述了基于&lt;code&gt;FastAPI&lt;/code&gt;框架，实现实现简单的&lt;code&gt;OAuth2&lt;/code&gt;的Password和Bearer验证。&lt;br&gt;
附带完整的代码，避免大家再次踩坑。&lt;/p&gt;</description>
    </item>
    <item>
      <title>使用FastAPI实现微服务API网关</title>
      <link>http://www.wfcoding.com/articles/practice/0109/</link>
      <pubDate>Thu, 14 Nov 2024 00:00:00 +0000</pubDate>
      <guid>http://www.wfcoding.com/articles/practice/0109/</guid>
      <description>&lt;p&gt;本文阐述了基于&lt;code&gt;FastAPI&lt;/code&gt;实现一个&lt;code&gt;API网关&lt;/code&gt;的详细步骤，这样未来可以不断的在服务端像搭积木一样添加各种服务。&lt;br&gt;
我们即将实现下面的简单的微服务架构，目前它只实现了请求转发功能：
&lt;img loading=&#34;lazy&#34; src=&#34;image/arch.png&#34; alt=&#34;api gateway架构&#34;  /&gt;
&lt;/p&gt;</description>
    </item>
    <item>
      <title>用FastAPI做langchain本地大模型的API</title>
      <link>http://www.wfcoding.com/articles/practice/0108/</link>
      <pubDate>Tue, 05 Nov 2024 00:00:00 +0000</pubDate>
      <guid>http://www.wfcoding.com/articles/practice/0108/</guid>
      <description>&lt;p&gt;本文讲述了如何使用&lt;code&gt;FastAPI&lt;/code&gt;和&lt;code&gt;langchain&lt;/code&gt;框架，包装本地大模型&lt;code&gt;llama3.1&lt;/code&gt;，实现&lt;mark&gt;语言翻译&lt;/mark&gt;功能的API。&lt;br&gt;
相对于 &lt;code&gt;Flask&lt;/code&gt; ，使用&lt;code&gt;FastAPI&lt;/code&gt;做接口要简便得多。&lt;/p&gt;</description>
    </item>
    <item>
      <title>用Flask做langchain服务的API</title>
      <link>http://www.wfcoding.com/articles/practice/0107/</link>
      <pubDate>Sun, 03 Nov 2024 00:00:00 +0000</pubDate>
      <guid>http://www.wfcoding.com/articles/practice/0107/</guid>
      <description>&lt;p&gt;本文讲述了如何使用一个利用本地大模型&lt;code&gt;llama3.1&lt;/code&gt;实现&lt;mark&gt;语言翻译&lt;/mark&gt;功能的API。&lt;br&gt;
它用&lt;code&gt;flask&lt;/code&gt;很轻松的&lt;mark&gt;将langchian服务开放为API&lt;/mark&gt;，结合&lt;code&gt;flasgger&lt;/code&gt;&lt;mark&gt;给文档添加注释并生成playground&lt;/mark&gt;，并且使用&lt;code&gt;jsonschema&lt;/code&gt;&lt;mark&gt;做json数据校验&lt;/mark&gt;，轻松验证接口参数。&lt;br&gt;
麻雀虽小，但五脏俱全，应该对&lt;strong&gt;langchain入门者&lt;/strong&gt;有较大帮助。&lt;/p&gt;</description>
    </item>
    <item>
      <title>使用LangServe做API开放本地大模型的能力</title>
      <link>http://www.wfcoding.com/articles/practice/0106/</link>
      <pubDate>Sun, 27 Oct 2024 00:00:00 +0000</pubDate>
      <guid>http://www.wfcoding.com/articles/practice/0106/</guid>
      <description>&lt;p&gt;&lt;code&gt;LangServe&lt;/code&gt;可以轻松的将&lt;code&gt;langchain&lt;/code&gt;的能力包装为接口，为前端提供服务。本文通过一个简单的应用演示&lt;code&gt;LangServe&lt;/code&gt;如何使用。&lt;/p&gt;</description>
    </item>
    <item>
      <title>基于langchain和本地大模型以及会话式检索增强生成技术实现知识问答</title>
      <link>http://www.wfcoding.com/articles/practice/0105/</link>
      <pubDate>Thu, 10 Oct 2024 00:00:00 +0000</pubDate>
      <guid>http://www.wfcoding.com/articles/practice/0105/</guid>
      <description>&lt;p&gt;本文概述了基于langchian框架和对话式增强生成（&lt;code&gt;Conversational RAG&lt;/code&gt;(&lt;code&gt;Retrieval Augmented Generation&lt;/code&gt;)）技术实现知识问答。&lt;br&gt;
具体来说，系统&lt;mark&gt;自动记录聊天历史&lt;/mark&gt;，并把它作为上下文提供给大模型，这样它让大模型产生了“记忆”，可以“理解”和关联上下文，体验更好。&lt;br&gt;
此样例程序使用本地部署的&lt;code&gt;nomic-embed-text&lt;/code&gt;模型做嵌入检索，使用本地部署的&lt;code&gt;llama3.1&lt;/code&gt;做回答内容生成。&lt;/p&gt;</description>
    </item>
    <item>
      <title>基于langchain和本地大模型以及会话式检索增强生成技术实现知识问答</title>
      <link>http://www.wfcoding.com/articles/practice/0104/</link>
      <pubDate>Wed, 09 Oct 2024 00:00:00 +0000</pubDate>
      <guid>http://www.wfcoding.com/articles/practice/0104/</guid>
      <description>&lt;p&gt;本文讲述了基于&lt;code&gt;langchian&lt;/code&gt;框架，使用本地部署的&lt;code&gt;nomic-embed-text&lt;/code&gt;模型做嵌入检索、&lt;code&gt;llama3.1&lt;/code&gt;做回答内容生成的知识问答系统实例。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;会话式检索增强生成，即：&lt;code&gt;Conversational RAG&lt;/code&gt;。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;nomic-embed-text&lt;/code&gt;：一个高性能开放嵌入模型，具有较大的标记上下文窗口。这个模型只有274M，但实际做嵌入和检索时，感觉&lt;strong&gt;比llama3好&lt;/strong&gt;。&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;p&gt;通过对比测试使用历史聊天记录和不使用历史聊天记录两种情况，我们可以明显看出来使用历史聊天记录的优点：它让大模型产生了“记忆”，可以“理解”和关联上下文，体验更好。&lt;/p&gt;
&lt;/blockquote&gt;</description>
    </item>
    <item>
      <title>使用langchain&#43;本地lamma3.1&#43;本地chroma做RAG系统</title>
      <link>http://www.wfcoding.com/articles/practice/0103/</link>
      <pubDate>Tue, 01 Oct 2024 00:00:00 +0000</pubDate>
      <guid>http://www.wfcoding.com/articles/practice/0103/</guid>
      <description>&lt;p&gt;本文详细讲述了如何使用&lt;code&gt;langchain&lt;/code&gt;+本地&lt;code&gt;lamma3.1&lt;/code&gt;+本地&lt;code&gt;chroma&lt;/code&gt;做&lt;code&gt;RAG&lt;/code&gt;系统。&lt;/p&gt;</description>
    </item>
    <item>
      <title>在langchian中使用本地部署的llama3.1大模型</title>
      <link>http://www.wfcoding.com/articles/practice/0102/</link>
      <pubDate>Tue, 01 Oct 2024 00:00:00 +0000</pubDate>
      <guid>http://www.wfcoding.com/articles/practice/0102/</guid>
      <description>&lt;p&gt;本文讲述如何在&lt;code&gt;langchian&lt;/code&gt;中使用本地部署的&lt;code&gt;llama3.1&lt;/code&gt;大模型。&lt;/p&gt;</description>
    </item>
    <item>
      <title>在Visual Studio Code中配置venv</title>
      <link>http://www.wfcoding.com/articles/practice/0101/</link>
      <pubDate>Tue, 01 Oct 2024 00:00:00 +0000</pubDate>
      <guid>http://www.wfcoding.com/articles/practice/0101/</guid>
      <description>&lt;p&gt;介绍如何在Visual Studio Code中配置venv&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
