Your comprehensive learning journey through modern Machine Learning, Deep Learning, and Artificial Intelligence - from fundamentals to production systems.
This repository is a complete educational resource that bridges theory with practice, covering everything from foundational neural networks to cutting-edge AI agent systems and production ML deployment. Each project is designed to be hands-on, practical, and production-ready, with clear documentation, video tutorials, and runnable code.
- AI Agents
- Deep Learning with Keras
- PyTorch Projects
- LLM Fine-Tuning
- RAG Systems
- Real-World Production Projects
- MCP Protocol
- AI Security Engineering
- Getting Started
Location: AiAgents/AgentFrameworkBenchmark/
A production-grade comparison of 7 major AI agent frameworks implementing identical multi-agent systems to provide objective, real-world benchmarks.
Watch on YouTube - Complete framework comparison and implementation guide
- LangChain/LangGraph (π₯ 284/360) - Best overall, maximum flexibility
- OpenAI Agents (π₯ 277/360) - Minimal code, native MCP support
- CrewAI (π₯ 249/360) - Rapid prototyping, simple delegation
- LlamaIndex (227/360) - Balanced workflow architecture
- AutoGen (195/360) - Enterprise async infrastructure
- Semantic Kernel (178/360) - Microsoft ecosystem integration
- Vanilla Python - Baseline with zero framework overhead
- β Agent Orchestration - Multi-agent coordination and routing
- β Tool Integration - Custom tool creation and execution
- β State Management - Complex state handling across agents
- β Memory Management - Persistent conversation history
- β MCP Server Integration - Model Context Protocol support
- β Production Features - Guardrails, token tracking, structured output
Each implementation includes:
- Orchestrator Agent - Routes queries to specialized agents
- Legal Expert Agent - Handles law and legal topics
- Operational Agent - Manages programming and general queries
- Tools - Weather API, calculator, web search
- MCP Integration - Extended capabilities via Model Context Protocol
Location: Keras/
Production-ready deep learning implementations using TensorFlow and Keras, from fundamentals to advanced architectures.
Path: Keras/ImageClassificationWithMLP/
- Dataset: MNIST handwritten digits
- Architecture: Multi-layer perceptron with Dropout and BatchNormalization
- Features: TensorBoard integration, Visualkeras architecture diagrams
- Tools: Dense layers, functional API, comprehensive logging
Path: Keras/transformers/text_generation/
- Task: Natural language generation from scratch
- Architecture: Complete Transformer implementation
- Components: Multi-head self-attention, positional encoding, feed-forward networks
- Features: Custom training loop, text preprocessing, generation sampling
Path: Keras/transformers/kv_cache_for text_gen/
- Optimization: Key-Value cache for efficient inference
- Performance: Dramatically reduced computation during generation
- Architecture: Modified Transformer with caching mechanism
- Use Case: Production LLM inference optimization
Path: Keras/transformers/time_series_forecast/
- Task: Stock price prediction using Transformers
- Data: Synthetic financial time series
- Architecture: Transformer adapted for sequential prediction
- Features: Temporal embeddings, MinMax scaling, visualization
Key Learning Points:
- Building Transformers from scratch in Keras
- Multi-head attention mechanisms
- Positional encoding strategies
- KV cache optimization techniques
- Adapting Transformers for different domains
Location: Pytotch/CnnImageClassification/
- Dataset: 70,000 images of 10 clothing categories
- Architecture: 2-layer CNN with BatchNorm
- Conv2d(1β16) + BatchNorm + ReLU + MaxPool
- Conv2d(16β32) + BatchNorm + ReLU + MaxPool
- Fully Connected (512β10)
- Performance: ~85-90% validation accuracy
- Features:
- Automatic dataset download
- GPU acceleration support
- Model checkpointing
- Training visualization
- Real-time progress monitoring
Key Learning Points:
- Convolutional neural networks fundamentals
- Batch normalization for training stability
- PyTorch DataLoader and Dataset classes
- Model training and evaluation pipelines
Location: LLMFineTuning/
State-of-the-art techniques for efficiently fine-tuning large language models for specific tasks.
Path: LLMFineTuning/all_peft_tecniques_from_scratch/
Complete implementation of Parameter-Efficient Fine-Tuning methods:
- LoRA (Low-Rank Adaptation) - Inject trainable low-rank matrices
- Prefix Tuning - Learn soft prompts prepended to inputs
- Adapter Layers - Small bottleneck layers inserted into models
- IAΒ³ (Infused Adapter by Inhibiting and Amplifying Inner Activations)
Why PEFT?
- Train only 0.1-1% of model parameters
- Reduce memory requirements by 90%
- Maintain performance close to full fine-tuning
- Enable multi-task learning with parameter isolation
Path: LLMFineTuning/GRPO_REASONING_UNSLOTH/
Advanced reasoning capabilities through Gradient-based Reward Policy Optimization:
- Model: Google Gemma 3 1B with 4-bit quantization
- Technique: GRPO (combines PPO benefits with gradient-based optimization)
- Task: Mathematical reasoning with structured outputs
- Features:
- LoRA rank-32 adaptation
- 4-bit quantization for memory efficiency
- vLLM acceleration for fast inference
- Structured reasoning format (
<reasoning>and<answer>tags)
Performance Gains:
- Models learn to show reasoning steps
- Improved accuracy on complex problems
- Better interpretability of model decisions
Path: LLMFineTuning/SFT_HF_TOOL_CHOICE/
Teaching models to intelligently select tools:
- Model: HuggingFace SmolLM2-135M
- Task: Tool selection based on user queries
- Dataset: 10,000 synthetic examples with tool annotations
- Technique: Supervised Fine-Tuning with custom special tokens
- Use Case: Building function-calling capabilities in smaller models
Real-World Application:
- Enable LLMs to use external tools (calculators, APIs, databases)
- Reduce reliance on large models for specialized tasks
- Build cost-effective AI assistants
Location: Rag/
Production-ready Retrieval-Augmented Generation systems that enhance LLM responses with external knowledge.
Path: Rag/dartboard/
Balanced Relevance and Diversity Retrieval
Based on the paper: "Better RAG using Relevant Information Gain"
Key Innovation:
- Problem: Standard top-k retrieval returns redundant documents
- Solution: Optimize combined relevance-diversity score
- Result: Non-redundant, comprehensive context for LLMs
Features:
- Configurable relevance/diversity weights
- Production-ready modular design
- FAISS vector store integration
- Oversampling for better candidate selection
Algorithm:
combined_score = diversity_weight * diversity + relevance_weight * relevanceWhen to Use:
- Dense knowledge bases with overlapping information
- Queries requiring diverse perspectives
- Avoiding echo chambers in retrieval
Path: Rag/hybrid_multivector_knowledge_graph_rag/
The Most Advanced RAG System - 11+ Graph Traversal Algorithms
Revolutionary Features:
- Knowledge Graph Engineering with Neo4j
- Multi-Vector Embeddings for nuanced retrieval
- 11+ Graph Traversal Algorithms:
- K-hop Limited BFS
- Depth-Limited DFS
- A* Search with heuristics
- Beam Search
- Uniform Cost Search (UCS)
- Context-to-Cypher query generation
- LLM-powered intelligent filtering
Architecture:
- Vector Retrieval - Initial similarity search
- Graph Traversal - Navigate knowledge relationships
- Entity Extraction - LLM-powered entity identification
- Dynamic Querying - Context-aware Cypher generation
- Intelligent Ranking - Multi-factor relevance scoring
Why Knowledge Graphs?
- Discover hidden connections across concepts
- Follow chains of reasoning
- Understand complex relationships
- Navigate multi-hop queries intelligently
Use Cases:
- Research and academic knowledge bases
- Legal document analysis
- Scientific literature review
- Complex domain expertise systems
Path: Rag/vision_rag/
Multimodal RAG for Documents with Images
Capabilities:
- PDF Processing - Extract text and images from documents
- Image Embeddings - CLIP-based visual understanding
- Unified Retrieval - Search across text and images simultaneously
- PostgreSQL + pgvector - Scalable vector storage
- Docker Deployment - Production-ready containerization
Architecture:
- Text extraction and chunking
- Image extraction and captioning
- Dual embedding spaces (text + vision)
- Unified query interface
- Relevance-based ranking
Use Cases:
- Architectural design documents
- Scientific papers with diagrams
- Product catalogs
- Technical manuals
- Medical imaging reports
Location: RealWorldProjects/CyberAttackPrediction/
Enterprise-grade cloud-native ML system for real-time network threat detection.
- Application Load Balancer - HTTPS/HTTP traffic distribution
- Auto Scaling Groups - Elastic capacity management
- EC2 Instances - Ubuntu 22.04 LTS compute
- Target Groups - Health-checked backend pools
- Security Groups - Network isolation and access control
- IAM Roles - Least-privilege security model
- AWS CodePipeline - Automated deployment workflows
- AWS CodeBuild - Application compilation and testing
- AWS CodeDeploy - Zero-downtime deployments
- S3 Artifact Storage - Build artifact management
- GitHub Integration - Source control via CodeStar
Multi-Stage Pipeline:
- Data Preprocessing - Mixed numerical/categorical feature handling
- AutoEncoder - Learn normal traffic patterns, detect anomalies
- Feature Selection (ORC) - Dynamic relevance-based feature selection
- SGD Classification - Final attack prediction
- Incremental Learning - Continuous model improvement
Performance:
- Real-time prediction (<1s response time)
- High accuracy on network attack detection
- Scalable to high traffic volumes
- Web Dashboard - Real-time monitoring UI
- Network Agent - Scapy-based packet capture
- Feature Extraction - Flow-level statistics
- RESTful API - Health checks and metrics
- Prediction API - RESTful inference endpoint
- Model Management - Load balancing and versioning
- Batch Training - Scheduled model updates
- Metrics Tracking - Performance monitoring
CloudFormation Template Features:
- Complete infrastructure as code
- Parameterized for easy customization
- Automatic DNS and SSL certificate setup
- Multi-AZ high availability
- Auto-scaling based on CPU utilization
What Gets Deployed:
βββββββββββββββββββββββββββββββββββββββββββ
β Application Load Balancer β
β (HTTPS + HTTP) β
ββββββββββββ¬βββββββββββββββ¬ββββββββββββββββ
β β
ββββββββΌβββββββ βββββΌβββββββββββ
β Monitor App β β ML Service β
β Auto Scalingβ β EC2 Instanceβ
β Group β β β
βββββββββββββββ ββββββββββββββββ
Network Security:
- TLS 1.3 encryption
- VPC isolation
- Security group restrictions
- IAM role-based access
Location: RealWorldProjects/RedAmon/
Full README | Full Disclaimer | Video Tutorial
An AI-powered agentic red team framework that automates offensive security operations β from reconnaissance to exploitation to post-exploitation β with zero human intervention.
DISCLAIMER: This tool is intended for authorized security testing, educational purposes, and research only. Unauthorized access to computer systems is illegal. By using this tool, you accept full responsibility for your actions.
| Component | Purpose |
|---|---|
| Automated Reconnaissance | Subdomain discovery, port scanning, HTTP probing, technology fingerprinting, vulnerability scanning |
| Graph Database | Neo4j-powered attack surface visualization and relationship mapping |
| AI Agent Orchestration | LangGraph-based autonomous decision making with ReAct pattern |
| MCP Tool Integration | Security tools (Naabu, Nuclei, Metasploit) exposed via Model Context Protocol |
| Web Interface | Next.js dashboard for visualization and AI chat interaction |
| Test Environments | Intentionally vulnerable systems (guinea pigs) for safe testing |
- End-to-end automation: From domain input to exploitation
- 9000+ Nuclei vulnerability templates
- Metasploit integration for exploitation and post-exploitation
- Human-in-the-loop approval for dangerous operations
- Multi-tenant support with user/project isolation
Location: MCPFromScratch/
Full README | π₯ Video Tutorial
Learn to build intelligent client-server AI systems from the ground up.
- Tools - Calculator, database queries, text-to-SQL conversion
- Prompts - Reusable LLM interaction templates
- Resources - Configuration and data access
- WebSocket Support - Real-time bidirectional communication
- Authentication - API key validation and quota management
- Natural Language Understanding - Parse user queries
- Tool Discovery - Automatically detect available capabilities
- Dynamic Selection - Choose appropriate tools based on context
- Conversational Interface - Friendly user interactions
- OpenAI Integration - LLM-powered intelligence
Protocol Flow:
Client Server
β β
ββββ Connect (WS) βββββββββΊ
β β
ββββ Initialize βββββββββββΊ
βββββ Capabilities βββββββββ€
β β
ββββ Call Tool ββββββββββββΊ
βββββ Result βββββββββββββββ€
β β
ββββ Get Prompt βββββββββββΊ
βββββ Template βββββββββββββ€
- Model Context Protocol - Custom AI communication protocol
- WebSocket Sessions - Persistent connections for real-time interaction
- Schema Validation - Pydantic for robust data handling
- Async Programming - Modern Python concurrency with asyncio
- API Design - RESTful and WebSocket patterns
- Understand the Protocol - How clients and servers communicate
- Build the Server - Implement tools, prompts, and resources
- Create the Client - Build an intelligent agent
- Integration - Connect components via WebSocket
- Enhancement - Add custom tools and capabilities
Perfect for:
- Understanding AI agent architectures
- Building custom LLM-powered tools
- Learning modern async Python
- Designing extensible AI systems
Location: AISecurityEngineering/
Comprehensive security engineering documentation using the STRIDE threat modeling framework, covering traditional web security and AI/LLM-specific attack vectors.
STRIDE is a threat modeling framework developed by Microsoft:
| Category | Description |
|---|---|
| S - Spoofing | Identity falsification attacks |
| T - Tampering | Unauthorized data modification |
| R - Repudiation | Denying performed actions |
| I - Information Disclosure | Exposing sensitive data |
| D - Denial of Service | Making systems unavailable |
| E - Elevation of Privilege | Gaining unauthorized access |
- Brute Force Attacks, Credential Stuffing, Session Hijacking
- JWT Token Theft, Replay Attacks, Phishing
- Email/IP Spoofing, Clickjacking, SSRF
- Subdomain Takeover, LLM Prompt Injection (LLM01:2025)
- SQL Injection, XSS, CSRF, Parameter Tampering
- Supply Chain Attacks
- LLM Data Poisoning (LLM04:2025), Improper Output Handling (LLM05:2025)
- Misinformation (LLM09:2025), LLM Supply Chain (LLM03:2025)
- Sensitive Information Disclosure (LLM06:2025)
- Vector/Embedding Weaknesses (LLM08:2025)
- Unbounded Consumption (LLM10:2025)
- Excessive Agency (LLM08:2025)
Each document includes:
- Overview Mermaid Diagrams - Visual attack flows
- 4 Real-World Attack Scenarios - Step-by-step attack chains
- Python PoC Scripts - Proof-of-concept code for lab testing
- AI/ML-Enhanced Attack Techniques - How adversaries leverage AI
- Mitigation Strategies - Defensive countermeasures
Who It's For:
- Security researchers and penetration testers
- Developers learning secure coding practices
- AI/ML engineers understanding LLM vulnerabilities
- Security teams building threat models
- Python 3.8+ (3.10 recommended)
- pip or conda for package management
- Git for version control
- OpenAI API Key (for LLM-powered projects)
- Docker (optional, for containerized projects)
# Clone the repository
git clone https://github.com/samugit83/TheGradientPath.git
cd TheGradientPath
# Choose a project and navigate to it
cd <project_directory>
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Follow project-specific README for next stepsEach project includes:
- requirements.txt - Python dependencies
- README.md - Detailed documentation
- Video Tutorial - Step-by-step guide (where available)
- Jupyter Notebooks - Interactive exploration
TheGradientPath is designed around these principles:
Every concept is accompanied by runnable code. Learn by doing, not just reading.
All implementations follow best practices and are designed for real-world use, not just tutorials.
Each project includes detailed explanations, architecture diagrams, and video tutorials.
Start with fundamentals (MLP, CNN) and progress to advanced systems (multi-agent RAG, production ML).
All code uses open-source libraries and can run on consumer hardware.
Beginner
ββ Keras MLP Image Classification
ββ PyTorch CNN Fundamentals
ββ Basic RAG (Dartboard)
Intermediate
ββ Transformer Text Generation
ββ LLM Fine-Tuning (SFT)
ββ Multi-vector RAG
ββ MCP Protocol
Advanced
ββ Knowledge Graph RAG
ββ GRPO Reasoning
ββ Vision RAG
ββ AI Agent Frameworks
Expert
ββ Production ML System
ββ Agent Framework Benchmark
ββ All PEFT Techniques
- GitHub Issues - Report bugs or request features
- Discussions - Ask questions and share insights
- Video Comments - Engage on YouTube tutorials
Contributions are welcome! Whether it's:
- Bug fixes
- Documentation improvements
- New features or projects
- Code quality enhancements
To contribute:
- Fork the repository
- Create a feature branch
- Commit your changes
- Open a pull request
Many projects include companion video tutorials:
- AI Agent Framework Benchmark - 7 frameworks compared
- ML Cyber Attack Prediction - Production ML system
- MCP From Scratch - Build intelligent client-server systems
Subscribe for more! Weekly deep dives into AI, ML, and production systems.
Samuele Giampieri
AI Engineer specializing in Knowledge Graphs, NLP, and AI-Driven Systems
Passionate about bridging cutting-edge research with practical applications. Expertise spans:
- Knowledge graphs and graph neural networks
- Multi-agent systems and orchestration
- RAG architectures and information retrieval
- Production ML deployment and MLOps
- GitHub: github.com/samugit83
- LinkedIn: AI/ML discussions and networking
- YouTube: Weekly AI and ML tutorials
- Email: Consulting and collaboration inquiries
- β Star this repository if you find it helpful
- π Like the videos on YouTube
- π Subscribe for weekly content
- π¬ Share your projects and feedback
- π€ Contribute improvements
This project is part of TheGradientPath educational initiative. Free to use for learning, research, and commercial applications.
Special thanks to:
- The open-source community for incredible tools and libraries
- Researchers publishing papers and sharing knowledge
- Students and practitioners providing feedback
- Everyone contributing to democratizing AI education
Built with β€οΈ by Samuele Giampieri
Follow the gradient toward mastery, one project at a time.
Last Updated: October 2025