Skip to main content
Version: 2.0.0

Supavec Integration

A powerful document question-answering system that combines Supavec's RAG capabilities with Gaia's language understanding. This system enables intelligent conversations with your documents through semantic search and natural language processing.

image image

info

The complete source code and detailed instructions for setting up and running this example can be found in the Gaia Cookbook repository.

Project Structure

The project is divided into two main parts:

  1. Backend: Handles file uploads, text uploads, and communication with the Supavec and Gaia APIs.
  2. Frontend: Provides a user interface for uploading files, listing uploaded files, and interacting with the chat interface.

Key Components

  • Frontend Layer: React application with real-time updates and file management
  • Backend API: Express.js server handling request orchestration
  • Document Processing: Supavec API for document chunking and embedding
  • Language Model: Gaia API for contextual question answering
  • Data Flow: Bidirectional communication with optimized response streaming

API Endpoints

  • POST /api/upload: Uploads a file to Supavec.
  • POST /api/upload-text: Uploads text content to Supavec.
  • GET /api/files: Retrieves a list of uploaded files.
  • POST /api/search: Searches embeddings based on a query and file IDs.
  • POST /api/ask: Asks a question about documents using Gaia.

Getting Started

Prerequisites

  • Node.js and npm installed on your machine.
  • Get your Supavec API key from the dashboard
  • Run your own local node using Gaia

Installation

  1. Clone the repository:
    git clone https://github.com/your-username/gaia-supavec.git
    cd gaia-supavec
  2. Install backend dependencies:
    cd backend
    npm install
  3. Install frontend dependencies:
    cd ../frontend
    npm install

Running the Project

  1. Start the backend server:
    cd backend
    npm start
  2. Start the frontend development server:
    cd ../frontend
    npm start
  3. Open your browser and navigate to http://localhost:3000 to access the application.

Usage

  1. Upload Documents: Use the file upload interface to upload PDF or text files.
  2. List Files: View the list of uploaded files.
  3. Ask Questions: Select files and ask questions about their content using the chat interface.

Resources

  • Supavec team for the RAG infrastructure (@supavec on github)
  • Gaia for the simple infra to launch local LLMs or use Public nodes.
info

The complete source code and detailed instructions for setting up and running this example can be found in the Gaia Cookbook repository.