software-mansion-labs/react-native-rag

Private, local RAGs. Supercharge LLMs with your own knowledge base.

What it solves

React Native RAG provides a framework for implementing Retrieval-Augmented Generation (RAG) directly on mobile devices. It allows developers to supercharge LLMs with a local knowledge base, ensuring that AI responses are private and efficient by keeping data and inference on-device.

How it works

The library is built with a modular architecture consisting of four primary interfaces: LLM, Embeddings, VectorStore, and TextSplitter. Developers can use these components separately or together via a high-level useRAG hook or a RAG class for orchestration. It supports on-device inference via the @react-native-rag/executorch plugin and local vector store persistence using @react-native-rag/op-sqlite for SQLite-based storage.

Who it’s for

Mobile developers using React Native who want to integrate private, local AI capabilities and semantic search into their applications without relying on cloud-based LLM services.

Highlights

  • On-device Inference: Uses ExecuTorch to run models locally for privacy and speed.
  • Modular Design: Allows swapping or implementing custom versions of the LLM, embeddings, and vector store components.
  • Persistence: Supports saving and managing vector stores locally via SQLite.
  • Flexible Integration: Offers a hook-based approach for simple setups and a class-based approach for advanced control.

Related

  • Project
  • Project
  • Project
  • Dispatch
  • Project