Production RAG framework builder with live CLI and code generation.
202
███╗ ███╗███████╗ ██████╗ █████╗ ██████╗
████╗ ████║██╔════╝ ██╔══██╗██╔══██╗██╔════╝
██╔████╔██║███████╗ ██████╔╝███████║██║ ███╗
██║╚██╔╝██║╚════██║ ██╔══██╗██╔══██║██║ ██║
██║ ╚═╝ ██║███████║ ██║ ██║██║ ██║╚██████╔╝
╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝
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.
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.
| Category | Included |
|---|---|
| RAG architectures | Naive, Advanced, Modular, Agentic, Self-RAG, CRAG, GraphRAG, HyDE, Multi-Query, RAG-Fusion, Step-Back, Parent-Child, Adaptive, Contextual Compression |
| LLM providers | OpenAI, Anthropic, Cohere, HuggingFace, Google Gemini, Mistral AI, Groq, Together AI, Replicate, Azure OpenAI, AWS Bedrock, Ollama |
| Document types | PDF, DOCX, CSV, Excel, PPTX, HTML, Markdown, JSON, XML, URLs, YouTube, images/OCR, source code, SQL, MongoDB, ePub, RTF, text |
| Chunking | Recursive, fixed-size, semantic, sentence, paragraph, token, Markdown, HTML, code-aware, agentic, document-aware |
| Embeddings | OpenAI, Cohere, HuggingFace local, HuggingFace hosted endpoint, Google, Mistral, Ollama local/self-hosted |
| Vector databases | ChromaDB, FAISS, Pinecone, Qdrant, Weaviate, Milvus, Redis, PGVector, Elasticsearch, OpenSearch, Azure AI Search, MongoDB Atlas |
| Retrieval | Dense vector, BM25, TF-IDF, hybrid, MMR, ensemble, parent-child, multi-vector, self-query, time-weighted |
| Quality layers | Query enhancement, reranking, context compression, evaluation, tracing, structured logging |
| Output | Standalone Python pipeline and requirements file generated from the selected configuration |
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.
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
pip install ms-rags-all-in-one
ms-rags
pip install -e .
pip install -e ".[pinecone,qdrant,ragas,langsmith,rerankers]"
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.
Some local document extractors need system tools:
| Tool | Needed for |
|---|---|
| Poppler | PDF page inspection and UnstructuredPDFLoader |
| Tesseract OCR | scanned PDFs and image OCR |
| Java | Tabula PDF table extraction |
| Ghostscript | Camelot 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.
When you run ms-rags, the CLI guides you through:
Useful query-loop commands:
| Command | Action |
|---|---|
/config | Show the full pipeline configuration |
/settings or /edit | Edit live query enhancement, reranking, compression, or generation model |
/save | Save session JSON |
/help | Show commands |
/exit or /quit | Exit with confirmation |
MS-RAGS supports many RAG patterns:
Preset RAGs apply the downstream steps they need. Advanced and Modular modes keep the full module choices open.
Agentic RAG can enable permission-gated tools:
| Tool | Purpose |
|---|---|
| Web Search | Public web search through approved providers |
| Memory Systems | short-term, long-term, semantic, episodic, and user-profile memory |
| URL Fetch | read approved URLs from allowed domains |
| File Read | read approved local paths only |
| Document Summarization | summarize long tool or retrieval results |
| API Request | call 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 builds and queries a persistent knowledge graph from ingested chunks. It supports:
Supported graph stores include local JSON, Neo4j / Neo4j Aura, and Kuzu.
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:
This makes hybrid keyword plus vector retrieval possible even when the vector database only stores embeddings.
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.
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.
MS-RAGS includes structured runtime logs, visible terminal warnings, optional OpenTelemetry tracing, and live evaluation hooks.
Evaluation options include:
If an optional evaluator is unavailable or incompatible, the framework shows a visible warning instead of silently hiding the failure.
MS-RAGS is designed around explicit permission and safe secret handling:
Use a secret manager, Docker secrets, or environment variables for production credentials.
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
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.
MIT License. See LICENSE for details.
Muhammad Saad bin Mazhar
GitHub: M-SAAD-BIN-MAZHAR
Built with LangChain, LangGraph, Rich, and Hypothesis.
It helps you:
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:
What makes it different:
Typical workflow:
For production, pass API keys and backend settings through environment variables or a secret manager. Do not bake secrets into the image.
Content type
Image
Digest
sha256:c950cf65d…
Size
3.7 GB
Last updated
4 months ago
docker pull saad469/ms-rags-all-in-one