Skip to main content

Config-driven enterprise RAG architecture generator for serverless infrastructure

Project description

RAGForge

Python 3.9+ License: MIT PyPI version

Config-driven enterprise RAG architecture generator for serverless infrastructure.

RAGForge transforms a single YAML configuration into a production-ready Retrieval-Augmented Generation pipeline. Define your data sources, chunking strategy, embedding model, and retrieval method — RAGForge handles the rest.

Features

  • Config-driven — Define your entire RAG pipeline in a single ragforge.yaml
  • Auto-adaptive chunking — Automatically selects chunking strategy based on document type (semantic for markdown, recursive for code)
  • Hybrid retrieval — Combines semantic similarity with BM25-style keyword matching for better recall
  • Pluggable embedders — Local dev embedder (zero API calls) or AWS Bedrock Titan Embed
  • FAISS vector store — In-memory similarity search with optional disk persistence, no external services needed
  • Minimal dependencies — Only pyyaml required; AWS, FAISS, and OpenSearch are optional
  • CLI interfaceragforge init, ingest, query, eval, deploy, status
  • Cost-aware — Built-in budget tracking and optimization recommendations

Installation

pip install substrai-ragforge

With optional dependencies:

# AWS Bedrock embeddings
pip install substrai-ragforge[aws]

# FAISS vector search
pip install substrai-ragforge[faiss]

# All optional dependencies
pip install substrai-ragforge[all]

Quickstart

1. Initialize a project

ragforge init --name my-rag-project

This creates a ragforge.yaml configuration file.

2. Configure your pipeline

project:
  name: my-rag-project
  version: "1.0.0"

data_sources:
  - name: documentation
    type: local
    config:
      path: ./docs
    file_types: [md, txt, pdf]

chunking:
  strategy: auto
  max_chunk_size: 512
  overlap: 50

embedding:
  model: bedrock/amazon.titan-embed-text-v2:0
  dimensions: 1024

storage:
  provider: faiss
  index_name: my-project-index

retrieval:
  method: hybrid
  semantic_weight: 0.7
  keyword_weight: 0.3
  top_k: 5

3. Ingest documents

ragforge ingest

4. Query your pipeline

ragforge query "How do I configure authentication?"

Python API

from ragforge.core.pipeline import RAGPipeline, Document

# From config file
pipeline = RAGPipeline.from_config("ragforge.yaml")

# Ingest documents
docs = [
    Document(content="Your document text...", source="doc.md", doc_type="md")
]
stats = pipeline.ingest(documents=docs)

# Query
results = pipeline.query("What is RAG?", top_k=5)
for result in results:
    print(f"[{result.score:.3f}] {result.content[:100]}")

Architecture

ragforge.yaml → Pipeline Orchestrator
                    ├── Chunkers (recursive, semantic, auto-select)
                    ├── Embedders (local dev, Bedrock Titan)
                    ├── Vector Store (FAISS, OpenSearch Serverless)
                    └── Retrievers (hybrid semantic + keyword)

Project Structure

src/ragforge/
├── core/           # Config parser, pipeline orchestrator
├── chunkers/       # Text chunking strategies
├── embedders/      # Embedding model integrations
├── storage/        # Vector store backends
├── retrievers/     # Retrieval and ranking strategies
├── ingestion/      # Document loading and preprocessing
├── evaluation/     # Quality metrics (MRR, NDCG, recall@k)
├── cost/           # Cost tracking and optimization
└── cli/            # Command-line interface

Development

# Clone and install in development mode
git clone https://github.com/substrai/ragforge.git
cd ragforge
pip install -e ".[dev]"

# Run tests
pytest

# Run specific test module
pytest tests/test_chunking.py -v

License

MIT License — see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

substrai_ragforge-0.1.0.tar.gz (28.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

substrai_ragforge-0.1.0-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

Details for the file substrai_ragforge-0.1.0.tar.gz.

File metadata

  • Download URL: substrai_ragforge-0.1.0.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for substrai_ragforge-0.1.0.tar.gz
Algorithm Hash digest
SHA256 712179548dbfa4bc2eb721313cd092568a55239031b6f08dcb749d1949dd9b2e
MD5 f050bf9fe87bc6b502f4e3378942fb90
BLAKE2b-256 7b79a5653dcbe4cb49c5c1eb71b7a633eacfac944576cdb950ba5fd4be08a671

See more details on using hashes here.

File details

Details for the file substrai_ragforge-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for substrai_ragforge-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aac7891533944b656054d6d02c792a8ec3a3256fce5876b60c64c9e760b0ad20
MD5 5d378efd9b8f0e45e3e55213a1f43dc7
BLAKE2b-256 8b16d6b9c1d2430fbd25f0cc8b88fda83b8ef12b8fafbab7fa3ffd78e7c68fd9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page