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.
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:
- Backend: Handles file uploads, text uploads, and communication with the Supavec and Gaia APIs.
- 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
- Clone the repository:
git clone https://github.com/your-username/gaia-supavec.git
cd gaia-supavec - Install backend dependencies:
cd backend
npm install - Install frontend dependencies:
cd ../frontend
npm install
Running the Project
- Start the backend server:
cd backend
npm start - Start the frontend development server:
cd ../frontend
npm start - Open your browser and navigate to
http://localhost:3000
to access the application.
Usage
- Upload Documents: Use the file upload interface to upload PDF or text files.
- List Files: View the list of uploaded files.
- 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.