Skip to main content
Glama

RAG Assistant — Groq + LangChain + MCP (2026 architecture)

An AI Engineer reference project: a Retrieval-Augmented Generation app with a governance layer, MCP exposure, and CI/CD deployment to Azure App Service.

Stack

Layer

Choice

LLM

Groq API (langchain-groq, e.g. llama-3.3-70b-versatile)

Orchestration

LangChain

Embeddings

sentence-transformers (local, no external embed API)

Vector store

FAISS, local file-based index (no SQL/DB server)

Frontend

Streamlit

Governance

Presidio (PII redaction) + moderation + JSONL audit log

Agent interop

MCP server exposing rag_query as a callable tool

CI/CD

GitHub Actions → Azure App Service (no Kubernetes)

Related MCP server: consulting-mcp-server

Architecture

                          ┌─────────────────────┐
                          │   Streamlit UI       │
                          │   (app.py)            │
                          └──────────┬───────────┘
                                     │
                     ┌───────────────▼────────────────┐
                     │      Governance Layer            │
                     │  (PII redaction, moderation,     │
                     │   audit logging)                  │
                     └───────────────┬────────────────┘
                                     │
              ┌──────────────────────┼───────────────────────┐
              │                      │                        │
   ┌──────────▼─────────┐  ┌─────────▼─────────┐   ┌──────────▼─────────┐
   │  Chunking            │  │  Embeddings         │   │  Vector Store (FAISS) │
   │  (rag/chunking.py)   │  │  (rag/embeddings.py)│   │  (rag/vector_store.py)│
   └──────────┬─────────┘  └─────────┬─────────┘   └──────────┬─────────┘
              │                      │                        │
              └──────────────────────┴────────────┬───────────┘
                                                    │
                                         ┌──────────▼─────────┐
                                         │  Retriever            │
                                         └──────────┬─────────┘
                                                    │
                                         ┌──────────▼─────────┐
                                         │  Groq LLM Generator  │
                                         └─────────────────────┘

   MCP Server (mcp/mcp_server.py) exposes the same pipeline as a
   `rag_query` tool for external agents/clients.

Setup

python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install -r requirements.txt
cp .env.example .env             # then add your GROQ_API_KEY

Run locally

streamlit run app.py

Run the MCP server

python -m mcp.mcp_server

Run tests

pytest tests/ -v

Deploy to Azure

  1. Create an Azure App Service (Linux, Python 3.11 runtime).

  2. Set the Startup Command to bash startup.sh.

  3. In App Service → Configuration → Application settings, add GROQ_API_KEY and any other values from .env.example.

  4. In your GitHub repo, add:

    • Secret AZURE_CREDENTIALS (a service-principal JSON from az ad sp create-for-rbac --sdk-auth).

    • Variable AZURE_WEBAPP_NAME with your App Service name.

  5. Push to main.github/workflows/azure-deploy.yml builds, tests, and deploys.

Notes on scope

  • No SQL database — the vector index is a local FAISS file persisted to data/vector_store/. Swap in a managed vector DB later if you need multi-instance scaling.

  • No Kubernetes — deployment target is Azure App Service (PaaS), which is simpler to operate for a single-container Streamlit app. Move to AKS only if you need pod-level autoscaling or a multi-service mesh.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    B
    maintenance
    Enables RAG-powered documentation search using OpenAI embeddings and Pinecone vector database. Provides an extensible framework for adding additional tools with support for both local STDIO and production HTTP transports.
    1
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    Exposes RAG and document intelligence pipelines as 8 composable tools for MCP-compatible clients, enabling querying, indexing, classifying, extracting, and assessing documents.
    1
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    Exposes a Retrieval-Augmented Generation pipeline as MCP tools, allowing users to index documents and query them through any MCP-compatible client like Claude or IDEs.
    -