Skip to content

Commit d35ff83

Browse files
bene2k1RoRoJ
andauthored
Apply suggestions from code review
Co-authored-by: Rowena Jones <[email protected]>
1 parent bb72b38 commit d35ff83

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tutorials/how-to-implement-rag/index.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ In this comprehensive guide, you will learn how to implement RAG using LangChain
1717
LangChain simplifies the process of enhancing language models with retrieval capabilities, allowing developers to build scalable, intelligent applications that access external datasets effortlessly. By leveraging LangChain’s modular design and Scaleway’s cloud services, you can unlock the full potential of Retrieval-Augmented Generation.
1818

1919
## What you will learn
20-
- How to embed text using a sentence transformer using ***Scaleway Manage Inference***
20+
- How to embed text using a sentence transformer with ***Scaleway Manage Inference***
2121
- How to store and query embeddings using ***Scaleway’s Managed PostgreSQL Database*** with pgvector
2222
- How to manage large datasets efficiently with ***Scaleway Object Storage***
2323

@@ -26,10 +26,10 @@ LangChain simplifies the process of enhancing language models with retrieval cap
2626
- A Scaleway account logged into the [console](https://console.scaleway.com)
2727
- [Owner](/identity-and-access-management/iam/concepts/#owner) status or [IAM permissions](/identity-and-access-management/iam/concepts/#permission) allowing you to perform actions in the intended Organization
2828
- A valid [API key](/identity-and-access-management/iam/how-to/create-api-keys/)
29-
- [Inference Deployment](/ai-data/managed-inference/how-to/create-deployment/): Set up an inference deployment using [sentence-transformers/sentence-t5-xxl](/ai-data/managed-inference/reference-content/sentence-t5-xxl/) on an L4 instance to efficiently process embeddings.
30-
- [Inference Deployment](/ai-data/managed-inference/how-to/create-deployment/) with the large language model of your choice.
31-
- [Object Storage Bucket](/storage/object/how-to/create-a-bucket/) to store all the data you want to inject into your LLM model.
32-
- [Managed Database](/managed-databases/postgresql-and-mysql/how-to/create-a-database/) to securely store all your embeddings.
29+
- An [Inference Deployment](/ai-data/managed-inference/how-to/create-deployment/): set it up using [sentence-transformers/sentence-t5-xxl](/ai-data/managed-inference/reference-content/sentence-t5-xxl/) on an L4 instance to efficiently process embeddings.
30+
- An [Inference Deployment](/ai-data/managed-inference/how-to/create-deployment/) with the large language model of your choice.
31+
- An [Object Storage Bucket](/storage/object/how-to/create-a-bucket/) to store all the data you want to inject into your LLM model.
32+
- A [Managed Database](/managed-databases/postgresql-and-mysql/how-to/create-a-database/) to securely store all your embeddings.
3333

3434
## Configure your development environment
3535

@@ -311,7 +311,7 @@ for r in rag_chain.stream("Your question"):
311311

312312
- Query execution: Finally, we stream the output of the RAG chain for a specified question, printing each response with a slight delay for better readability.
313313

314-
### Query the RAG system with you own prompt template
314+
### Query the RAG system with your own prompt template
315315

316316
Personalizing your prompt template allows you to tailor the responses from your RAG (Retrieval-Augmented Generation) system to better fit your specific needs. This can significantly improve the relevance and tone of the answers you receive. Below is a detailed guide on how to create a custom prompt for querying the system.
317317

@@ -327,7 +327,7 @@ llm = ChatOpenAI(
327327
api_key=os.getenv("SCW_SECRET_KEY"),
328328
model=deployment.model_name,
329329
)
330-
prompt = """Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer. Always finish your answer by "Thank you for asking". {context} Question: {question} Helpful Answer:"""
330+
prompt = """Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer. Always finish your answer with "Thank you for asking". {context} Question: {question} Helpful Answer:"""
331331
custom_rag_prompt = PromptTemplate.from_template(prompt)
332332
retriever = vector_store.as_retriever()
333333
custom_rag_chain = create_stuff_documents_chain(llm, custom_rag_prompt)
@@ -362,6 +362,6 @@ In this tutorial, we explored essential techniques for efficiently processing an
362362

363363
Furthermore, you can continually enhance your RAG system by implementing mechanisms to retain chat history. Keeping track of past interactions allows for more contextually aware responses, fostering a more engaging user experience. This historical data can be used to refine your prompts, adapt to user preferences, and improve the overall accuracy of responses.
364364

365-
By integrating Scaleway’s Managed Object Storage, PostgreSQL with pgvector, and LangChain’s embedding tools, you have the foundation to build a powerful RAG system that scales with your data while offering robust information retrieval capabilities. This approach equips you with the tools necessary to handle complex queries and deliver accurate, relevant results efficiently.
365+
By integrating Scaleway Object Storage, Managed Database for PostgreSQL with pgvector, and LangChain’s embedding tools, you have the foundation to build a powerful RAG system that scales with your data while offering robust information retrieval capabilities. This approach equips you with the tools necessary to handle complex queries and deliver accurate, relevant results efficiently.
366366

367367
With ongoing refinement and adaptation, your RAG system can evolve to meet the changing needs of your users, ensuring that it remains a valuable asset in your AI toolkit.

0 commit comments

Comments
 (0)