Skip to main content

The way to build RAG — modular, configurable, plugin-based

Project description

ragway

The way to build RAG.

Install

pip install ragway

Quickstart

from ragway import RAG
import asyncio, pathlib
pathlib.Path("example_docs").mkdir(exist_ok=True); pathlib.Path("example_docs/intro.md").write_text("# RAG\nRetrieval-Augmented Generation combines retrieval with generation.", encoding="utf-8")
rag = RAG(llm="openai", api_key="YOUR_OPENAI_KEY")
print(asyncio.run(rag.ingest("example_docs")), asyncio.run(rag.query("What is RAG?")))

Why ragway

  • Compared to LangChain: smaller public surface, fewer framework abstractions, explicit config and component wiring.
  • Compared to LlamaIndex: direct control over retrieval/rerank/vectorstore choices without committing to one indexing model.
  • For production code: you can start simple with RAG(...), then move to YAML config and provider-specific tuning without rewriting app code.

What You Can Swap

Component Options
LLM anthropic, openai, mistral, groq, llama, local
Vectorstore faiss, chroma, pinecone, weaviate
Retrieval vector, bm25, hybrid, multi_query, parent_document
Reranker cohere, bge, cross_encoder (or None)
Chunking fixed, recursive, semantic, sliding_window, hierarchical
Pipeline naive, hybrid, self, long_context, agentic

Install Options

# Base package
pip install ragway

# Provider extras
pip install ragway[anthropic]
pip install ragway[openai]
pip install ragway[mistral]
pip install ragway[groq]
pip install ragway[cohere]
pip install ragway[pinecone]
pip install ragway[weaviate]
pip install ragway[faiss]
pip install ragway[chroma]
pip install ragway[llama]
pip install ragway[bge]

# Bundles
pip install ragway[all-cloud]
pip install ragway[all-local]
pip install ragway[all]
pip install ragway[dev]

Config File Example

version: "1.0"
pipeline: hybrid

plugins:
  llm:
    provider: groq
    model: llama-3.1-8b-instant
    api_key: ${GROQ_API_KEY}
    temperature: 0.2
    max_tokens: 512

  embedding:
    provider: openai
    model: text-embedding-3-small
    api_key: ${OPENAI_API_KEY}
    batch_size: 32

  vectorstore:
    provider: faiss
    index_name: rag-lab
    top_k: 5

  retrieval:
    strategy: hybrid
    top_k: 5
    rrf_k: 60

  reranker:
    enabled: true
    provider: cohere
    api_key: ${COHERE_API_KEY}
    top_k: 3

  chunking:
    strategy: recursive
    chunk_size: 512
    overlap: 50
from ragway import RAG
import asyncio

rag = RAG.from_config("rag.yaml")
print(asyncio.run(rag.query("Summarize the key idea.")))

Links

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

ragway-0.1.0.tar.gz (2.4 MB view details)

Uploaded Source

Built Distribution

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

ragway-0.1.0-py3-none-any.whl (114.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ragway-0.1.0.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for ragway-0.1.0.tar.gz
Algorithm Hash digest
SHA256 072aba6b134aecce9df0d05cbcd1dae4615f91b16fd78ec3ef05a6b8bdb38167
MD5 b9fc966db1557183e5058ccc69b14b18
BLAKE2b-256 328b189bfbe9d870a9b3effe5edf197c8f48bdb47bb8a8a642f162f2ff9897d1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ragway-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 114.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for ragway-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e5a9d1fe5002c2872c986102f297b79a23a1e19fe3894e3abe575f93da0657b9
MD5 d838aa5ddbe4f8dde1a8703f4080c998
BLAKE2b-256 b7359df8cf9e1ac2c4ffc1320de0e3fca674eaac8e3cb74fa64bbb34cdf93e6e

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