Hostname: page-component-77f85d65b8-8wtlm Total loading time: 0 Render date: 2026-03-26T15:46:52.245Z Has data issue: false hasContentIssue false

Emerging trends: a gentle introduction to RAG

Published online by Cambridge University Press:  20 September 2024

Kenneth Ward Church*
Affiliation:
Northeastern University, Boston, MA, USA
Jiameng Sun
Affiliation:
Northeastern University, Boston, MA, USA
Richard Yue
Affiliation:
Northeastern University, Boston, MA, USA
Peter Vickers
Affiliation:
Northeastern University, Boston, MA, USA
Walid Saba
Affiliation:
Northeastern University, Boston, MA, USA
Raman Chandrasekar
Affiliation:
Northeastern University, Boston, MA, USA
*
Corresponding author: Kenneth Ward Church; Email: k.church@northeastern.edu
Rights & Permissions [Opens in a new window]

Abstract

Retrieval-augmented generation (RAG) adds a simple but powerful feature to chatbots, the ability to upload files just-in-time. Chatbots are trained on large quantities of public data. The ability to upload files just-in-time makes it possible to reduce hallucinations by filling in gaps in the knowledge base that go beyond the public training data such as private data and recent events. For example, in a customer service scenario, with RAG, we can upload your private bill and then the bot can discuss questions about your bill as opposed to generic FAQ questions about bills in general. This tutorial will show how to upload files and generate responses to prompts; see https://github.com/kwchurch/RAG for multiple solutions based on tools from OpenAI, LangChain, HuggingFace transformers and VecML.

Information

Type
Emerging Trends
Creative Commons
Creative Common License - CCCreative Common License - BY
This is an Open Access article, distributed under the terms of the Creative Commons Attribution licence (https://creativecommons.org/licenses/by/4.0/), which permits unrestricted re-use, distribution, and reproduction in any medium, provided the original work is properly cited.
Copyright
© The Author(s), 2024. Published by Cambridge University Press
Figure 0

Table 1. RAG summaries are longer than tl;dr summaries from Semantic Scholar

Figure 1

Figure 1. The query (top line) is followed by recommendations.

Figure 2

Table 2. OCR errors are more challenging for spaCy than RAG