Retrieval-augmented generation was a breakthrough in how LLMs source data to form its responses. Originally, an LLM was limited to its training data and context window, leading to gaps in its knowledge and a high rate of hallucinations (attempts by the AI to come up with answers where they don't clearly exist). This new approach (coined "RAG") allows the LLM to combine its foundational data with outside sources, dramatically increasing the data connections it can draw from.

From a UX perspective, this was also a breakthrough in the user experience of AI, as users could now guide the data that the AI referenced. Whereas a model's training data is private and difficult to parse for specific references, RAG gives the user transparency into the other data the AI is using.

One of the first products to take advantage of this technology was Perplexity.ai, which broke through with its ability to provide contextual search results to users alongside an AI chatbot that the user could talk to in order to refine or expand its results.

Perplexity exposes the sources that it uses to synthesize its response to the user's inquiry, giving users an easy way to go directly to the source

This pattern soon caught on, supported by complementary patterns like citations and the wayfinding pattern of using an initial reference source to frame the first prompt iteration. As this pattern proliferated, it expanded to include new components, like the ability to connect multiple private sources for the AI to reference, while protecting their data from being incorporated into the LLM primary training data.

Giving users the ability to see and manage sources is standardizing as a pattern. Some tools offer pro accounts to add or expand the number of sources that can be references. ChatGPT, Notion, Github, and Microsoft are just some of the major players that allow users to connect the conversational LLM to their personal or proprietary data, helping to connect fragmented data across the enterprise and decreasing the amount of time users spend looking for answers and resources to common questions.

RAG use cases

The use cases for RAG seem almost infinite, from learning and development to sales intelligence to product management. Consider how integrating related patterns can help users even further:

  • Filtering sources by account or keyword could let employees ask questions about a specific account, from insights in Productboard, to notes in Salesforce, to account based marketing in Hubspot and more, combined with public knowledge. Could a team prompt the LLM for a summary? Or perhaps ask it to generate a microsite that the account team can easily reference?
  • Generating custom built courses for internal enablement around new features, referencing competitive and market research, product development and strategic docs, product marketing and technical writing, and supported by an internal framework on skills developed by learning professionals. Using this information, the AI could quiz employees on key details, record and grade practice demos for people getting ramped up, and help create personalized talk tracks for leaders on overall areas of weakness.
  • Combining sources across customers with a customer experience framework to support a voice of the customer program that mimics real customers as personas through AI Characters. Designers might pressure test initial concepts, working rapidly and iteratively with the AI through the first few days of the sprint while preparing a prototype for research and evaluation with actual customers. Using Gong recordings and other insight sources, a team might work backwards to identify the customers most likely to be experiencing the problems they are addressing, allowing account teams to proactively engage those customers so they feel like co-creators of a solution instead of waiting until the pain becomes acute.

Details and variations

  • Make the list of references visible to the user if possible
  • Add citations to the generated content so the user knows what was referenced where
  • Allow users to manage their references by adding or removing them based on their relevance
  • If internal references are mixed with internal ones, make that distinction clear, and allow them to limit their references to one or the other

Considerations

Positives

References as intent

Just as a reference source used in an initial prompt can point the AI in the right direction, adding or removing additional sources is a light-touch way of adjusting the AI's lens. Consider how sources could be combined with filters or parameters to adjust the AI's tone, sense of audience, technical depth, etc, almost like a form of token layering through the blending of source material.

Make references interactive

Combine references with patterns like citations to help users identify which aspects of its answer derive from where. Inline prompting can target what aspects of the reference the AI draws from, or replace a single reference without impacting the rest of the response a la inpainting.

Potential risks

The quality of the reference matters

Google exposed the biggest weakness of this pattern by connecting its search results to Reddit, home to troves of unvalidated or simply false information. From Pizza recipes that include glue to recommendations for how many rocks to consume in a day, Google has polluted its results using RAG references, making its AI tool a meme instead of a must-have. AI will parse sources for relevant facts, but it can't independently verify the information.

Use when:
The AI uses RAG to aggregate sources that the AI uses to craft or synthesize its result and the user wants to see and manage them.

Examples

ChatGPT can now connect directly to your GoogleDrive or OneDrive files as reference sources
Perplexity shows it reference sources alongside its results
References in Perplexity can be edited for subsequent prompts
The Notion AI connects with your base to pull relevant references in with its results
Leena offers RAG as a service, integrating directly with your knowledge base
Einstein Copilot uses the references connected to your Salesforce Instance to summarize its results
Salesforce Einstein users can adjust which references to pull from when auto-generating suggested responses for human-led support conversations
No items found.