From 8a48c3b7b0b87b0e62f804eb3f0b678d7ea6880e Mon Sep 17 00:00:00 2001 From: Chulong Li Date: Tue, 23 Sep 2025 11:08:20 +0000 Subject: [PATCH] Fix typos in rag.mdx under OSS LangChain --- src/oss/langchain/rag.mdx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/oss/langchain/rag.mdx b/src/oss/langchain/rag.mdx index 50c31891ee..36a3e6d700 100644 --- a/src/oss/langchain/rag.mdx +++ b/src/oss/langchain/rag.mdx @@ -127,7 +127,7 @@ Select a vector store: ## Preview -In this guide we’ll build an app that answers questions about the website's content. The specific website we will use is the [LLM Powered Autonomous +In this guide we'll build an app that answers questions about the website's content. The specific website we will use is the [LLM Powered Autonomous Agents](https://lilianweng.github.io/posts/2023-06-23-agent/) blog post by Lilian Weng, which allows us to ask questions about the contents of the post. @@ -289,7 +289,7 @@ trace](https://smith.langchain.com/public/a117a1f8-c96c-4c16-a285-00b85646118e/r ## Detailed walkthrough -Let’s go through the above code step-by-step to really understand what’s +Let's go through the above code step-by-step to really understand what's going on. ## 1. Indexing @@ -323,7 +323,7 @@ objects. :::python -In this case we’ll use the +In this case we'll use the [WebBaseLoader](/oss/integrations/document_loaders/web_base), which uses `urllib` to load HTML from web URLs and `BeautifulSoup` to parse it to text. We can customize the HTML -\> text parsing by passing @@ -331,7 +331,7 @@ in parameters into the `BeautifulSoup` parser via `bs_kwargs` (see [BeautifulSoup docs](https://beautiful-soup-4.readthedocs.io/en/latest/#beautifulsoup)). In this case only HTML tags with class “post-content”, “post-title”, or -“post-header” are relevant, so we’ll remove all others. +“post-header” are relevant, so we'll remove all others. ```python import bs4 @@ -410,7 +410,7 @@ into the context window of many models. Even for those models that could fit the full post in their context window, models can struggle to find information in very long inputs. -To handle this we’ll split the `Document` into chunks for embedding and +To handle this we'll split the `Document` into chunks for embedding and vector storage. This should help us retrieve only the most relevant parts of the blog post at run time. @@ -516,7 +516,7 @@ RAG applications commonly work as follows: ![retrieval_diagram](/images/rag_retrieval_generation.png) -Now let’s write the actual application logic. We want to create a simple +Now let's write the actual application logic. We want to create a simple application that takes a user question, searches for documents relevant to that question, passes the retrieved documents and initial question to a model, and returns an answer. @@ -744,7 +744,7 @@ for more advanced formulations. In the above [agentic RAG](#rag-agents) formulation we allow the LLM to use its discretion in generating a [tool call](/oss/langchain/models#tool-calling) to help answer user queries. This -is a good general purpose solution, but comes with some trade-offs: +is a good general-purpose solution, but comes with some trade-offs: | ✅ Benefits | ⚠️ Drawbacks | |-----------------------------------------------------------------------------|----------------------------------------------------------------------------| @@ -775,7 +775,7 @@ def prompt_with_context(state: AgentState) -> list[MessageLikeRepresentation]: docs_content = "\n\n".join(doc.page_content for doc in retrieved_docs) system_message = ( - "You are a helpful assistant. Use the following context in your reseponse:" + "You are a helpful assistant. Use the following context in your response:" f"\n\n{docs_content}" )