How to Set Up and Explore the Renumics RAG Demo

Feb 17, 2021 | Data Science

The Renumics RAG (Retrieval-Augmented Generation) offers an exciting way to enhance the exploration and visualization of RAG data. This guide will take you step-by-step through the installation and usage of this tool, making it accessible for developers and enthusiasts alike.

Installation: The Virtual Environment Setup

To start, you’ll need to set up a virtual environment in your project directory. Think of a virtual environment like your own personal workspace—messy workspaces can lead to mistakes, but a clean workspace allows for creativity!

  • For Linux/MacOS:
    python3.8 -m venv .venv
    source .venv/bin/activate
  • For Windows CMD:
    ..venv\Scripts\activate.bat
  • For Windows PowerShell:
    ..venv\Scripts\activate.ps1

Install Dependencies

Next, you’ll want to ensure that all necessary packages are installed correctly. Just like you wouldn’t start cooking without all the ingredients, don’t run your projects without the right dependencies!

  • Upgrade pip and install the RAG demo package:
  • pip install -IU pip setuptools wheel
  • For GPU Support:
    pip install renumics-rag[all]@git+https://github.com/Renumics/renumics-rag.git torch torchvision sentence-transformers accelerate
  • For CPU Support:
    # pip install renumics-rag[all]@git+https://github.com/Renumics/renumics-rag.git torch torchvision sentence-transformers accelerate --extra-index-url https://download.pytorch.org/whl/cpu

Local Setup

If you want to dive deeper and edit the project, clone the entire repository. This is similar to checking out a book from the library to make annotations and notes in the margins!

git clone git@github.com:Renumics/renumics-rag.git

Then, follow the virtual environment setup steps above again, and install in editable mode:

pip install -e .[all]

Configuration

Before you can start using the OpenAI models, you’ll need to create a configuration file. This is akin to setting up your workspace rules so that everything stays organized and runs smoothly.

For OpenAI Models:

OPENAI_API_KEY=Your OpenAI API key

For Azure Models:

OPENAI_API_TYPE=azure
OPENAI_API_VERSION=2023-08-01-preview
AZURE_OPENAI_API_KEY=Your Azure OpenAI API key
AZURE_OPENAI_ENDPOINT=Your Azure OpenAI endpoint

If using Hugging Face models, no .env file is necessary. You can manage settings directly in settings.yaml.

Usage: Indexing Your Data

Now comes the fun part! The first step is to index your documents to prepare them for question answering. Download the demo database or add your own data in a new docs directory.

Begin Indexing:

create-db

Usage: Questioning and Getting Answers

Once your documents are indexed, you can run questions like you’re putting a call out for help in a crowded room!

Retrieving Documents:

retrieve Your question here

Getting Answers:

answer Your question here

Launching the Web Application

To make everything visually accessible, start the web application. It’s like opening the door to your beautifully organized room, inviting others to explore!

app

This will open a new browser window where users can interact with the RAG system.

Interactive Exploration

As you ask questions and refine your queries, explore insights further using Renumics Spotlight.

Troubleshooting Ideas

If you encounter issues at any stage, check the following:

  • Ensure that your virtual environment is activated correctly.
  • Revisit the installation of dependencies – sometimes packages can be tricky!
  • Double-check your API keys and endpoints in your configuration file.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

If problems persist, consider seeking help on community forums or the project’s GitHub page.

Conclusion

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Now you’re ready to tackle the world of Retrievability in AI with Renumics RAG! Enjoy your explorations!

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox