Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/oss/langchain/rag.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Select a vector store:

## Preview

In this guide well 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.
Expand Down Expand Up @@ -289,7 +289,7 @@ trace](https://smith.langchain.com/public/a117a1f8-c96c-4c16-a285-00b85646118e/r

## Detailed walkthrough

Lets go through the above code step-by-step to really understand whats
Let's go through the above code step-by-step to really understand what's
going on.

## 1. Indexing
Expand Down Expand Up @@ -323,15 +323,15 @@ objects.


:::python
In this case well 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
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 well remove all others.
“post-header” are relevant, so we'll remove all others.

```python
import bs4
Expand Down Expand Up @@ -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 well 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.

Expand Down Expand Up @@ -516,7 +516,7 @@ RAG applications commonly work as follows:

![retrieval_diagram](/images/rag_retrieval_generation.png)

Now lets 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.
Expand Down Expand Up @@ -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 |
|-----------------------------------------------------------------------------|----------------------------------------------------------------------------|
Expand Down Expand Up @@ -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:"

Copilot AI Sep 23, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch fixing the spelling error from 'reseponse' to 'response'.

Copilot uses AI. Check for mistakes.
f"\n\n{docs_content}"
)

Expand Down
Loading