Building AI agents from first principles.
No frameworks. No abstractions.
Pure Python cognitive architectures
that perceive, remember, decide, and act.
I don't use LangChain. I don't use LangGraph. I build every cognitive layer from
raw Python — because understanding
HOW an agent thinks is more valuable than
knowing which library to import.
8 milestones from first principles to production agents — click any node to explore
01
Foundation
From Transformers to Agentic AI
Attention mechanisms, token prediction, positional encoding — then the leap from reactive RAG to autonomous agents with goals, memory, and tool access.
"An LLM predicts the next token. An agent decides the next ACTION. Understanding both changes everything."
02
The Cognitive Stack
4-Layer Agentic Architecture
Modular Python files for each cognitive layer — perception.py, memory.py, decision.py, action.py — wired together with Pydantic schemas.
"This is not a framework. This is a cognitive architecture. Each layer is an independent module with its own prompt, its own Pydantic schema, and its own responsibility."
03
Tools & MCP
MCP Protocol & Agentic Tool Use
MCP servers/clients from scratch. Tool-use pipelines where the agent decides WHICH tool to call, WITH what parameters, and VALIDATES the result through structured JSON planning.
"MCP replaces 1000 custom integrations with 1 protocol. Retrieval is an agentic STEP — perceived, validated, stored. Not a blind prepend to the prompt."
04
Reasoning
Planning, CoT & State Management
Chain-of-thought reasoning, three planning strategies (Conservative, Exploratory, Fallback), self-reflection, and the "boring JSON" ERORLL state pattern for debugging non-deterministic LLMs.
"The plan emerges from structured reasoning across multiple LLM calls. Tracking every snapshot in plain JSON makes debugging possible."
05
Memory
Memory, RAG & Knowledge Graphs
Session persistence, cross-conversation memory, hybrid retrieval combining dense vectors with knowledge graph triplets. RetrieverAgent, TripletAgent, GraphAgent, CriticAgent working together.
"Dense retrieval finds similar text. Graph retrieval finds structured relationships. Together, agents can REASON about knowledge — not just recall it."
06
Eyes & Hands
Browser Agent & Computer Agent
BrowserAgent with DOM perception, accessibility trees, screenshot analysis for the web. ComputerAgent with GUI control, system commands, and file manipulation for the OS.
"BrowserAgent gave my agent eyes for the web. ComputerAgent gave it hands for the entire operating system. Together — full digital autonomy."
07
Orchestration
Multi-Agent Systems & Super Agent
System of minds — Perception, Decision, and Executor as independent agents coordinated through structured state handoff. 8+ specialized agent types with production-grade agent_loop4. Competitive with commercial systems.
"It's no longer one brain doing everything — it's a system of minds. Each agent is modular, reusable, goal-driven, and stateless."
08
Production & Beyond
Cloud Deployment & Robotics Bridge
Full AWS deployment with production infrastructure. Then the leap to physical: SO-100 robot arms, LeRobot framework, imitation learning, ROS2 — where software agents meet the real world.
"Software agents think. Robot agents MOVE. Bridging the two is where the next decade of AI lives."
> sagar.architecture()
Inside My Agent's Brain
The 4-layer cognitive stack — hover any component to see data flow through the system live
Perception
Memory
Decision
Action
Tools
Validation
> import nothing
No Frameworks. First Principles.
Same task. Two philosophies. One lets you see everything. The other doesn't.
Don't just read about AI — break it, poke it, watch it learn. All running live in your browser.
Live
Agent Decision Loop
Watch a cognitive agent think in real-time — Perceive, Decide, Act, Repeat. Tweak the reasoning depth and see how decisions change.
Cognitive Stack4-LayerLive
Live
Neural Net Sandbox
Crank the learning rate, add neurons, and watch a neural network draw decision boundaries around your data in real-time. Break it on purpose — it's fun.
BackpropDecision BoundaryInteractive
Live
Tool Calling Simulator
Give an agent a task and watch it pick the right tool, build the JSON call, execute it, and validate the result. This is how MCP actually works.
MCPTool UseJSON Planning
Live
Attention X-Ray
Peek inside a transformer's brain. Switch between attention heads and watch words light up as they attend to each other. This is the mechanism behind every LLM.
TransformerMulti-HeadHeatmap
Live
RL Maze Runner
Drop an agent in a maze and watch it stumble, learn, and eventually speedrun to the goal. The reward curve tells the whole story — from chaos to convergence.
Q-LearningExplorationReward Curve
Live
Multi-Agent Arena
Three specialized agents — Planner, Researcher, Executor — collaborate on a task with live message passing. Watch consensus emerge from chaos.
Multi-AgentCoordinationState Handoff
Demo
> sagar.shipped()
What I've Shipped
Featured
WebsiteBuilder Agent — Screenshot to Website
AI-powered multi-agent pipeline that transforms screenshots and text descriptions into production-ready websites using Gemini Vision. Features 6-phase orchestration, interactive refinement, and real-time WebSocket streaming.
India's first bilingual Chrome extension for AI-powered webpage analysis. Summarize, extract topics, detect page type, and chat with any webpage in English or Hindi. Powered by Gemini 2.0 Flash, fully privacy-first with no server uploads.
Multimodal VLM combining Gemma-270M + CLIP ViT-Large/14, trained on full LLaVA-Instruct-150K (157K samples). LoRA fine-tuned with only 18.6M trainable params (3.4% of 539M total), achieving 53.8% VQA accuracy. Trained on A100 in ~9 hours.
GemmaCLIPLoRALLaVAPyTorch LightningMLflow
Featured
MLOps Agent — Natural Language Deployment
Say “deploy ResNet50” and watch the entire pipeline execute autonomously. Natural language interface for MLOps automation — treating traditional ML models as zero-autonomy agents within a unified AgentOps framework.
Progressively complex CNNs achieving 99.4%+ accuracy on MNIST under 8K params and strong CIFAR-10 results using advanced augmentation.
PyTorchCNNBatchNormDropoutAugmentation
ResNet50 on ImageNet — Multi-GPU
Trained ResNet50 from scratch on full ImageNet using multi-GPU on AWS, achieving 75%+ top-1 accuracy within a $25 budget.
PyTorchResNetAWS EC2Multi-GPUImageNet
GPT from Scratch — Decoder-Only Transformer
GPT-style decoder-only transformer with causal masking, RoPE embeddings, trained on custom corpus with attention visualization.
PyTorchTransformersRoPECausal MaskingWandB
Stable Diffusion — Latent Diffusion
Latent diffusion models with VAE encoder/decoder, U-Net denoiser, and CLIP text conditioning for text-to-image generation.
DiffusersVAEU-NetCLIPHuggingFace
Featured
Hospital RL Simulation — Self-Driving Cars
Built an RL simulation where cars learn to drive autonomously in a hospital environment. Agents trained via reward shaping to navigate roads, avoid obstacles, and reach destinations safely.
PyTorchRLSimulationPPOReward ShapingPygame
RL Agent: CartPole to Continuous Control
Trained RL agents using DQN, PPO, and DDPG across discrete and continuous environments with reward curve visualization.
PyTorchGymnasiumPPODDPGActor-Critic
Featured
70B LLM Pretraining & Instruction Tuning
End-to-end pretraining of a 70B parameter LLM with model parallelism, gradient checkpointing, RLHF pipeline and vLLM deployment.
PyTorchDeepSpeedvLLMRLHFQATAWS
> sagar.skills()
Skills & Tooling
From cognitive architectures to production infrastructure