Sign inSign up

saad469/ms-rags-all-in-one

By saad469

•Updated 4 months ago

Production RAG framework builder with live CLI and code generation.

Image
Languages & frameworks
1

202

saad469/ms-rags-all-in-one repository overview

⁠MS-RAGS(ALL-IN-ONE) - Production-Grade RAG Framework Builder

███╗   ███╗███████╗      ██████╗  █████╗  ██████╗
████╗ ████║██╔════╝      ██╔══██╗██╔══██╗██╔════╝
██╔████╔██║███████╗      ██████╔╝███████║██║  ███╗
██║╚██╔╝██║╚════██║      ██╔══██╗██╔══██║██║   ██║
██║ ╚═╝ ██║███████║      ██║  ██║██║  ██║╚██████╔╝
╚═╝     ╚═╝╚══════╝      ╚═╝  ╚═╝╚═╝  ╚═╝ ╚═════╝
                      MS-RAGS(ALL-IN-ONE)

A guided terminal CLI for building production RAG pipelines end to end.

Live Documentation⁠ · GitHub Repository⁠

Created by Muhammad Saad bin Mazhar.


⁠Overview

MS-RAGS(ALL-IN-ONE) is a production-grade, terminal-based interactive CLI framework for building Retrieval-Augmented Generation systems. It guides users through provider credentials, document ingestion, chunking, embeddings, vector storage, retrieval, reranking, compression, evaluation, observability, live querying, and final standalone code generation.

It is designed as a RAG workbench plus code generator. You make choices in the terminal, test the live pipeline, then export deployable Python code that matches those choices.


⁠Key Features

CategoryIncluded
RAG architecturesNaive, Advanced, Modular, Agentic, Self-RAG, CRAG, GraphRAG, HyDE, Multi-Query, RAG-Fusion, Step-Back, Parent-Child, Adaptive, Contextual Compression
LLM providersOpenAI, Anthropic, Cohere, HuggingFace, Google Gemini, Mistral AI, Groq, Together AI, Replicate, Azure OpenAI, AWS Bedrock, Ollama
Document typesPDF, DOCX, CSV, Excel, PPTX, HTML, Markdown, JSON, XML, URLs, YouTube, images/OCR, source code, SQL, MongoDB, ePub, RTF, text
ChunkingRecursive, fixed-size, semantic, sentence, paragraph, token, Markdown, HTML, code-aware, agentic, document-aware
EmbeddingsOpenAI, Cohere, HuggingFace local, HuggingFace hosted endpoint, Google, Mistral, Ollama local/self-hosted
Vector databasesChromaDB, FAISS, Pinecone, Qdrant, Weaviate, Milvus, Redis, PGVector, Elasticsearch, OpenSearch, Azure AI Search, MongoDB Atlas
RetrievalDense vector, BM25, TF-IDF, hybrid, MMR, ensemble, parent-child, multi-vector, self-query, time-weighted
Quality layersQuery enhancement, reranking, context compression, evaluation, tracing, structured logging
OutputStandalone Python pipeline and requirements file generated from the selected configuration

⁠Architecture

MS-RAGS(ALL-IN-ONE)
  -> Provider credentials
  -> RAG type selection
  -> Document types and loaders
  -> Chunking strategy and parameters
  -> Embedding model
  -> Vector database and live ingestion
  -> Query enhancement
  -> Retrieval strategy
  -> Reranking
  -> Context compression
  -> System prompt
  -> Evaluation
  -> Live query loop
  -> Standalone code generation

The framework is permission-first. Before state-changing work such as ingestion, external API usage, file reads, web fetching, or cloud database writes, MS-RAGS shows what will happen and asks the user to confirm.


⁠Installation

⁠Production Install
git clone https://github.com/M-SAAD-BIN-MAZHAR/ms-rags-all-in-one-.git
cd ms-rags-all-in-one-
python -m venv .venv

# Windows
.venv\Scripts\activate

# Linux / macOS
source .venv/bin/activate

pip install -e ".[production]"
ms-rags
⁠PyPI Install
pip install ms-rags-all-in-one
ms-rags
⁠Minimal Install
pip install -e .
⁠Selected Extras
pip install -e ".[pinecone,qdrant,ragas,langsmith,rerankers]"

⁠Docker Usage

Build the full production image:

docker build --build-arg INSTALL_EXTRAS=production -t saad469/ms-rags-all-in-one:1.0.0 .

Tag and push:

docker tag saad469/ms-rags-all-in-one:1.0.0 saad469/ms-rags-all-in-one:latest
docker login
docker push saad469/ms-rags-all-in-one:1.0.0
docker push saad469/ms-rags-all-in-one:latest

Run interactively:

docker run --rm -it --env-file .env -v "%cd%:/workspace" saad469/ms-rags-all-in-one:1.0.0

PowerShell:

docker run --rm -it `
  --env-file .env `
  -v "${PWD}:/workspace" `
  saad469/ms-rags-all-in-one:1.0.0

Do not bake API keys into the image. Use environment variables, an .env file, Docker secrets, or your deployment platform's secret manager.


⁠External Tools

Some local document extractors need system tools:

ToolNeeded for
PopplerPDF page inspection and UnstructuredPDFLoader
Tesseract OCRscanned PDFs and image OCR
JavaTabula PDF table extraction
GhostscriptCamelot PDF table extraction

If you do not want local PDF/OCR dependencies, use LlamaParse with LLAMA_CLOUD_API_KEY when sending documents to a managed parser is acceptable.


⁠Workflow

When you run ms-rags, the CLI guides you through:

  1. LLM provider credentials
  2. RAG architecture
  3. document types
  4. loaders and extractors
  5. chunking strategy
  6. embedding model
  7. vector database connection
  8. live ingestion approval
  9. query enhancement
  10. retrieval strategy
  11. reranking
  12. context compression
  13. system prompt
  14. evaluation
  15. runtime build
  16. live query loop
  17. code generation

Useful query-loop commands:

CommandAction
/configShow the full pipeline configuration
/settings or /editEdit live query enhancement, reranking, compression, or generation model
/saveSave session JSON
/helpShow commands
/exit or /quitExit with confirmation

⁠RAG Types

MS-RAGS supports many RAG patterns:

  • Naive RAG for simple grounded QA
  • Advanced RAG for configurable production pipelines
  • Modular RAG for expert composition
  • Agentic RAG for tool-using workflows
  • Self-RAG for relevance and grounding checks
  • Corrective RAG for web-search fallback
  • GraphRAG for knowledge-graph retrieval
  • HyDE RAG for hypothetical-document retrieval
  • Multi-Query RAG for query expansion
  • RAG-Fusion for reciprocal-rank fusion
  • Step-Back RAG for abstracted query reasoning
  • Parent-Child RAG for precise child search with larger parent context
  • Adaptive RAG for query routing
  • Contextual Compression RAG for reducing retrieved context

Preset RAGs apply the downstream steps they need. Advanced and Modular modes keep the full module choices open.


⁠Agentic Tools

Agentic RAG can enable permission-gated tools:

ToolPurpose
Web SearchPublic web search through approved providers
Memory Systemsshort-term, long-term, semantic, episodic, and user-profile memory
URL Fetchread approved URLs from allowed domains
File Readread approved local paths only
Document Summarizationsummarize long tool or retrieval results
API Requestcall approved REST APIs with allowed methods and base URLs

These tools are deny-by-default. Users approve credentials, domains, file paths, methods, limits, and storage paths.


⁠GraphRAG

GraphRAG builds and queries a persistent knowledge graph from ingested chunks. It supports:

  • entity extraction
  • relationship extraction
  • graph persistence
  • community summaries
  • local query mode
  • global query mode
  • hybrid graph plus vector evidence retrieval

Supported graph stores include local JSON, Neo4j / Neo4j Aura, and Kuzu.


⁠Keyword Stores

Hybrid retrieval needs raw searchable text in addition to vectors. For cloud vector databases such as Pinecone, Qdrant, Weaviate, Milvus, and MongoDB Atlas, MS-RAGS asks where to store keyword text.

Supported keyword stores:

  • SQLite
  • PostgreSQL
  • Elasticsearch
  • OpenSearch
  • memory-only for development

This makes hybrid keyword plus vector retrieval possible even when the vector database only stores embeddings.


⁠Generated Code

At the end of the workflow, MS-RAGS can generate standalone output:

ms_rag_output/
  pipeline.py
  requirements.txt
  .env

The generated pipeline supports:

python pipeline.py --ingest --sources ./docs/
python pipeline.py --query "What does this document say?"
python pipeline.py

Generated code reads credentials from environment variables. Real secrets are not written into generated Python files.


⁠Environment Variables

Example .env:

OPENAI_API_KEY=
ANTHROPIC_API_KEY=
COHERE_API_KEY=
HUGGINGFACEHUB_API_TOKEN=
GOOGLE_API_KEY=
MISTRAL_API_KEY=
GROQ_API_KEY=
OLLAMA_BASE_URL=http://localhost:11434
OLLAMA_MODEL_NAME=llama3

PINECONE_API_KEY=
QDRANT_URL=
QDRANT_API_KEY=
WEAVIATE_URL=
WEAVIATE_API_KEY=

LANGCHAIN_API_KEY=
LANGFUSE_PUBLIC_KEY=
LANGFUSE_SECRET_KEY=

MS_RAG_OTEL_ENABLED=1
OTEL_SERVICE_NAME=ms-rags-all-in-one
OTEL_ENVIRONMENT=production
OTEL_EXPORTER_OTLP_ENDPOINT=

Never commit .env files containing real credentials.


⁠Observability And Evaluation

MS-RAGS includes structured runtime logs, visible terminal warnings, optional OpenTelemetry tracing, and live evaluation hooks.

Evaluation options include:

  • RAGAS
  • DeepEval
  • TruLens
  • LangSmith
  • Langfuse
  • Arize Phoenix
  • ARES-compatible scoring
  • RAGEval-style scoring
  • RAGBench-compatible scoring
  • CI/CD gates
  • LangGraph trace export
  • monitoring export

If an optional evaluator is unavailable or incompatible, the framework shows a visible warning instead of silently hiding the failure.


⁠Security

MS-RAGS is designed around explicit permission and safe secret handling:

  • secrets are not written into generated code
  • session JSON stores sanitized markers instead of raw keys
  • logs redact secret-like fields
  • agent tools require allowlists
  • external services require explicit credentials
  • ingestion and database writes require user confirmation

Use a secret manager, Docker secrets, or environment variables for production credentials.


⁠Project Structure

ms_rag/
  cli/          interactive setup and query loop
  config/       credential management
  ingestion/    loaders, chunking, embeddings, vector DB connectors
  query/        enhancement, retrieval, reranking, compression
  llm/          LLM factory, LCEL chains, LangGraph workflows
  evaluation/   evaluators and metric runners
  codegen/      standalone pipeline generation
  session/      save/load support
  ui/           banner, prompts, architecture visibility
  utils/        validation, retry, logging, telemetry, cleanup

⁠Development

pip install -e ".[dev]"
pytest tests/ -v

For production feature testing:

pip install -e ".[production]"

Redis and ARES are intentionally separate extras because their upstream dependency families can conflict with the modern HuggingFace and provider stack.


⁠License

MIT License. See LICENSE for details.


⁠Author

Muhammad Saad bin Mazhar

GitHub: M-SAAD-BIN-MAZHAR⁠


Built with LangChain, LangGraph, Rich, and Hypothesis.

MS-RAGS(ALL-IN-ONE) is a guided, permission-first CLI for building production RAG systems end to end.

It helps you:

  • choose the right LLM provider and embedding model
  • select loaders and extractors for different document types
  • configure chunking, retrieval, reranking, and compression
  • connect to local or cloud vector databases
  • test the live RAG pipeline in the terminal
  • generate standalone deployable Python code from the exact selections you made

The framework is designed for real production use, not just demos. It shows users what is happening at each step, asks for permission before state-changing actions, and keeps secrets out of generated code.

Key features:

  • many LLM providers
  • many vector databases
  • hybrid keyword + vector retrieval
  • agentic and graph-based RAG flows
  • structured logging and observability
  • secure credential handling
  • standalone code export
  • Docker-friendly and PyPI-friendly release flow

What makes it different:

  • step-by-step guided setup instead of a black-box installer
  • visible runtime feedback in the terminal
  • user-controlled credentials and allowlists
  • support for both local and hosted services
  • generated apps that reflect the exact configuration the user selected

Typical workflow:

  1. pick a model and provider
  2. choose document types and loaders
  3. configure chunking and embeddings
  4. connect a vector database
  5. test retrieval live
  6. tune reranking, compression, and evaluation
  7. export standalone code for deployment

For production, pass API keys and backend settings through environment variables or a secret manager. Do not bake secrets into the image.

Tag summary

Content type

Image

Digest

sha256:c950cf65d…

Size

3.7 GB

Last updated

4 months ago

docker pull saad469/ms-rags-all-in-one