Infrastructure Setup

Set up your cloud infrastructure to power your RAG applications with RAGaaS.

Overview

RAGaaS follows a privacy-focused architecture where you maintain complete control over your data infrastructure. This guide will help you set up and configure the required components:

  1. Document Storage: Where your processed documents and content are stored
  2. Vector Database: Where embeddings are stored for semantic search and hybrid search
  3. Embedding Model: Which model to use for generating embeddings

File Storage Setup

Your file storage is where RAGaaS stores processed content, chunks, and metadata. We support any S3-compatible storage service, giving you flexibility in your choice of provider.

Choosing a File Storage Provider

Here's a comparison of supported providers to help you choose:

  • Name
    Cloudflare R2 (Recommended)
    Description
    • Free egress (no data transfer costs) - Simple setup process - Global availability - S3-compatible API
  • Name
    AWS S3
    Description
    • Extensive features - Global infrastructure - Integration with AWS services
    • Pay for egress
  • Name
    Google Cloud Storage
    Description
    • Strong performance - Global infrastructure - Integration with GCP - Pay for egress
  • Name
    MinIO
    Description
    • Self-hosted option - Complete control - Open-source - Requires maintenance

Follow these steps to set up your storage with Cloudflare R2:

  1. Create a Bucket

    • Log in to your Cloudflare Dashboard
    • Navigate to R2 from the sidebar
    • Click "Create Bucket"
    • Choose a unique name (e.g., "ragaas-docs-acmecorp")
    • Select your preferred region
  2. Generate API Credentials

    • Go to R2 > API > Manage API Tokens
    • Click "Create API Token"
    • Select "Object Read & Write" permissions
    • Click "Create API Token"
    • Note down the endpoint URL, Access Key ID, and Secret Access Key
  3. Configure Your Namespace

    {
      "fileStorageConfig": {
        "provider": "S3_COMPATIBLE",
        "bucket": "your-bucket-name",
        "endpoint": "your-endpoint-url",
        "credentials": {
          "accessKeyId": "your-access-key-id",
          "secretAccessKey": "your-secret-access-key"
        },
        "region": "auto"
      }
    }
    

Alternative File Storage Setup

If using a different S3-compatible provider:

  1. Create a bucket in your chosen provider
  2. Generate API credentials with read/write permissions
  3. Use the same configuration structure, updating:
    • endpoint with your provider's S3 endpoint
    • region with your chosen region
    • credentials with your provider's keys

Vector Database

The vector database stores embeddings for semantic search or hybrid search. Currently, we support Pinecone, with more options coming soon like Qdrant, Chroma, and more.

Pinecone Setup Guide

  1. Create a Pinecone Account

    • Sign up at Pinecone
    • Free tier available for development
    • Choose Starter plan for production
  2. Create an Index

    • Click "Create Index"
    • Choose a descriptive name (e.g., "ragaas-acmecorp")
    • Select "Serverless" for automatic scaling
    • Choose your preferred cloud provider and region
  3. Configure Index Settings Choose dimensions based on your embedding model:

    ModelDimensionsBest For
    OpenAI text-embedding-3-small1536Most use cases, good balance
    OpenAI text-embedding-3-large3072Highest accuracy, higher cost
    Cohere embed-english-v3.01024English-focused, cost-effective
    Cohere embed-multilingual-v3.01024Multilingual, best for non-English
    Jina jina-embeddings-v31024Best for long documents
  4. Choose Metric Type

    • Use "dotproduct" if you need hybrid search (recommended)
    • Use "cosine" if you only need semantic search
  5. Get Your Credentials

    • Save your index host URL
    • Create an API key from "API Keys" section
    • Store both securely
  6. Configure Your Namespace

    {
      "vectorStorageConfig": {
        "provider": "PINECONE",
        "apiKey": "your-pinecone-api-key",
        "indexHost": "your-index-host"
      }
    }
    

Troubleshooting

Common Storage Issues

Access Denied

  • Verify API token has correct permissions
  • Check bucket name matches exactly
  • Confirm endpoint URL is correct
  • Validate credentials are active

Vector Database Issues

Dimension Mismatch

  • Verify index dimensions match model dimensions
  • Check embedding model configuration
  • Note: Cannot change after creation
  • Create new index if needed

Hybrid Search Not Working

  • Verify index uses "dotproduct" metric type
  • Note: "cosine" metric type only supports semantic search
  • Cannot change metric type after creation
  • Create new index with "dotproduct" if needed

Getting Help

You can contact support at [email protected] and we'll help you get set up.