Thursday, January 23, 2025

Retrieval Augmented Generation (RAG) and Role-Based Access Control (RBAC): A Quick Overview

Last update: 2024.01.25

These are personal research notes compiled after a brief exploration of retrieval augmented generation and access control implementations.

Extending LLM knowledge with new data sources is also known as Retrieval Augmented Generation (RAG). Here is the Wikipedia definition of RAG:

Retrieval Augmented Generation is a technique that grants generative artificial intelligence models information retrieval capabilities. It modifies interactions with a large language model so that the model responds to user queries with reference to a specified set of documents, using this information to augment information drawn from its own vast, static training data. 
If you plan to implement an LLM with RAG in your company, you will most likely need some form of access control as well. For example, it would not be advisable for an intern to gain access, through prompting, to information that is meant to be restricted to C-level executives.

The following article describes how to Implement Role-Based Access Control in RAG. The example uses Ollama (open-source tool for running LLM's locally).

Here is another article that describes Implementing simple role-based access control in LLM applications, though it's not clear which LLM or tools are used.

Related solutions

LM Studio

https://lmstudio.ai/

Pros:

  • Easy installation and setup
  • Runs various LLMs, entirely offline
  • Chat with local documents
  • Chat UI or an OpenAI API compatible local server
  • Free for personal use

Cons:

  • Not free for business use
  • Not open source
  • Doesn't support access control

open-webui

https://github.com/open-webui/open-webui

Pros:

  • Free and open source
  • Chat with several models simultaneously
  • Image generation
  • Web browsing capability
  • Huge community

Cons:

Other

Another interesting open-source front-end worth following is LibreChat.

Another commercial solution I haven't checked yet is kapa.ai. They say about themselves the following:

Kapa.ai turns your knowledge base into a reliable and production-ready LLM-powered AI assistant that answers technical product questions instantly and helps improve your documentation.

Vector databases that support RAG with access control include Pinecone [docs], which is commercial, and Supabase [docs], an open-source Firebase alternative.

Useful communities

https://www.reddit.com/r/LocalLLaMA/

No comments:

Post a Comment