Skip to main content
Source Code: src/gaia/rag/sdk.py
Component: RAGSDK - Document Q&A with RAG Module: gaia.rag.sdk Import: from gaia.rag.sdk import RAGSDK, RAGConfig, RAGResponse, quick_rag

Overview

RAGSDK provides document retrieval and Q&A capabilities using Retrieval-Augmented Generation (RAG). It supports PDF, text, CSV, JSON, and code files with intelligent chunking, VLM-enhanced image extraction, and vector search via FAISS. Key Features:
  • Multi-format support (PDF, TXT, MD, CSV, JSON, code files)
  • VLM-based image text extraction from PDFs
  • Intelligent semantic chunking
  • Hardware-accelerated embeddings (NPU/GPU via Lemonade)
  • Per-file search optimization
  • Automatic caching with content hashing
  • LRU memory management

API Specification

RAGConfig

RAGResponse

RAGSDK

Quick Function


Usage Examples

Example 1: Basic Document Q&A

Example 3: Code Documentation


Testing Requirements


Dependencies


RAGSDK Technical Specification