How 05satyam/ai-ml works
1. Repository Shape and Purpose
This is a curated Python learning/cookbook repository, not a single deployable product. Its primary units are Jupyter notebooks, Markdown guides, and independent demo applications covering ML, RAG, agents, MCP, observability, and interview preparation. The root README.md is the navigation entry point; most examples are launched interactively from notebooks or directly as Python modules.
2. Executable Application Entry Points
A few directories contain service-like applications rather than notebooks:
• Multimodal RAG API: demo_applications/advance_rag/multimodal-rag/app/main.py, with HTTP routes in demo_applications/advance_rag/multimodal-rag/app/api/routes.py.
• Production-style RAG mock service: interview-prep/rag_service_mock_prod/app/main.py, orchestrated by interview-prep/rag_service_mock_prod/app/pipeline.py.
• MCP demos: demo_applications/mcp_handson/mcp_server_demo/app.py and demo_applications/mcp_handson/hello_world_of_mcp/simple_mcp_server.py.
• Standalone ML example: transformer training/inference through demo_applications/simple_transformer_addition/train.py and demo_applications/simple_transformer_addition/inference.py.
3. RAG Pipeline Patterns
RAG is the most substantial application theme. The multimodal app separates configuration, embedding creation, retrieval, and answer orchestration:
• demo_applications/advance_rag/multimodal-rag/app/core/config.py
• demo_applications/advance_rag/multimodal-rag/app/services/embeddings.py
• demo_applications/advance_rag/multimodal-rag/app/services/retriever.py
• demo_applications/advance_rag/multimodal-rag/app/services/rag_pipeline.py
The expected flow is source documents/images → embeddings/indexing → retrieval → LLM-grounded response exposed by API routes. Sample PDF/image inputs are local under demo_applications/advance_rag/multimodal-rag/data/.
Other RAG variants are self-contained notebooks: hybrid/vector search under demo_applications/simple-rag/, graph RAG under demo_applications/graph_based_applications/, and corrective RAG in demo_applications/advance_rag/CRAG/crag_code.ipynb.
4. Production-Style RAG Boundary
interview-prep/rag_service_mock_prod/ is the clearest reference architecture for a deployable RAG backend. It decomposes request handling, schemas, knowledge ingestion, vector storage, retrieval, LLM calls, and cross-cutting concerns:
• API/application boundary: interview-prep/rag_service_mock_prod/app/main.py, interview-prep/rag_service_mock_prod/app/schemas.py
• Retrieval/data boundary: interview-prep/rag_service_mock_prod/app/knowledge.py, interview-prep/rag_service_mock_prod/app/vectorstore.py, interview-prep/rag_service_mock_prod/app/retriever.py
• Runtime controls: interview-prep/rag_service_mock_prod/app/guardrails.py, interview-prep/rag_service_mock_prod/app/cache.py, interview-prep/rag_service_mock_prod/app/resilience.py, interview-prep/rag_service_mock_prod/app/tracing.py
This layout makes external LLM, cache, vector-store, and tracing integrations replaceable behind local modules.
5. Agent and MCP Implementations
Agent concepts are primarily taught through LangChain/LangGraph notebooks and citation-oriented agent cookbooks:
• demo_applications/agent-patterns-cookbooks/cite_rag_agent/01_react_pdf_policy_qa.ipynb
• demo_applications/agent-patterns-cookbooks/cite_rag_agent/02_plan_and_execute_pdf_policy_qa.ipynb
• demo_applications/agent-patterns-cookbooks/cite_rag_agent/claim_verifier.py
MCP examples establish a client/server and tool-hosting boundary. The richer server demo exposes separate echo, math, and GitHub-oriented servers, assembled from:
• demo_applications/mcp_handson/mcp_server_demo/mounted_servers.py
• demo_applications/mcp_handson/mcp_server_demo/github_server.py
• demo_applications/mcp_handson/mcp_server_demo/math_server.py
The policy-gated MCP agent adds tool-risk controls, LLM routing, tracing, and evaluation around potentially untrusted MCP tools: demo_applications/mcp_handson/policy_gated_mcp_agent/agent/run_agent.py, agent/policy.py, and servers/evil_server.py.
6. Runtime, Infrastructure, and External Dependencies
Python is the material runtime; dependencies are scoped either at repository root (requirements.txt) or per executable demo, such as demo_applications/advance_rag/multimodal-rag/requirements.txt and interview-prep/rag_service_mock_prod/requirements.txt. The mock RAG service includes container/Kubernetes deployment artifacts in interview-prep/rag_service_mock_prod/deploy/Dockerfile and deploy/k8s/deployment.yaml, with autoscaling in deploy/k8s/hpa.yaml.
External services/frameworks represented by the examples include OpenAI-compatible LLM routing, Pinecone vector search, LangChain/LangGraph, LlamaIndex, MCP tool servers, and Arize Phoenix observability. These are educational integrations, not repository-wide mandatory infrastructure.
Main entry points: README.md Repository guide · run_agent.py Policy-gated MCP agent · main.py Service API · pipeline.py RAG pipeline
Components 18
Learning content
Notebook and guide-based cookbook material.
- Repository guide · Root entry point to independent learning examples.
README.md - RAG notebook variants · Hybrid, graph, and corrective RAG exercises.
- Citation agent cookbooks · ReAct and plan-and-execute policy QA lessons.
demo_applications/agent-patterns-cookbooks/cite_rag_agent/01_react_pdf_policy_qa.ipynb
Multimodal RAG demo
Interactive API-backed multimodal retrieval example.
- RAG API routes
demo_applications/advance_rag/multimodal-rag/app/api/routes.py - Multimodal app
demo_applications/advance_rag/multimodal-rag/app/main.py - Answer pipeline
demo_applications/advance_rag/multimodal-rag/app/services/rag_pipeline.py - Retriever
demo_applications/advance_rag/multimodal-rag/app/services/retriever.py - Embeddings and index
demo_applications/advance_rag/multimodal-rag/app/services/embeddings.py - PDF and image inputs
Production RAG mock
Deployable reference backend with replaceable integrations.
- Service API · Request boundary using local schemas.
interview-prep/rag_service_mock_prod/app/main.py - RAG pipeline
interview-prep/rag_service_mock_prod/app/pipeline.py - Knowledge and retrieval · Local ingestion, vector-store, and retrieval adapters.
interview-prep/rag_service_mock_prod/app/retriever.py - Runtime controls · Guardrails, cache, resilience, and tracing wrap integrations.
interview-prep/rag_service_mock_prod/app/guardrails.py - Container and Kubernetes · Container deployment with autoscaling manifest.
interview-prep/rag_service_mock_prod/deploy/k8s/deployment.yaml
MCP and agents
Tool-server and policy-gated agent demonstrations.
- Mounted MCP servers · Composes echo, math, and GitHub-oriented tools.
demo_applications/mcp_handson/mcp_server_demo/mounted_servers.py - Policy-gated MCP agent · Routes tool use through policy, tracing, and evaluation.
demo_applications/mcp_handson/policy_gated_mcp_agent/agent/run_agent.py - Tool risk policy
demo_applications/mcp_handson/policy_gated_mcp_agent/agent/policy.py - Untrusted MCP tool
demo_applications/mcp_handson/policy_gated_mcp_agent/servers/evil_server.py
Connections 17
- Repository guide → RAG notebook variants: indexes
- Repository guide → Citation agent cookbooks: indexes
- Repository guide → Multimodal app: indexes
- Repository guide → Service API: indexes
- Multimodal app → RAG API routes: serves
- RAG API routes → Answer pipeline: submits queries
- Answer pipeline → Retriever: retrieves context
- Retriever → Embeddings and index: searches index
- PDF and image inputs → Embeddings and index: indexes
- Service API → RAG pipeline: handles requests
- RAG pipeline → Knowledge and retrieval: retrieves context
- Runtime controls → RAG pipeline: guards and observes
- Container and Kubernetes → Service API: deploys
- Policy-gated MCP agent → Tool risk policy: checks tool calls
- Tool risk policy → Untrusted MCP tool: gates access
- Policy-gated MCP agent → Mounted MCP servers: uses MCP tools
- Citation agent cookbooks → Policy-gated MCP agent: teaches agent patterns alongside