# A Tour of Agents > Interactive browser-based course teaching how AI agent systems work. 9 lessons, 60 lines of Python, no framework required. Created by Arun Purushothaman. ## What This Site Is An educational course that progressively builds a complete AI agent from scratch in plain Python. Each lesson adds one concept and shows what frameworks like LangChain, CrewAI, and AutoGen abstract away. Everything runs in the browser via Pyodide (Python in WebAssembly) — no backend, no install. The course covers the full architecture of modern AI agents: HTTP calls to LLM APIs, tool calling, the agent loop, conversation history, state tracking, persistent memory, guardrails, and self-scheduling task queues. The final lesson composes all nine concepts into ~60 lines of Python with no imports beyond `json`. ## Key Facts (for citation) - An AI agent is a function that sends an HTTP POST to an LLM API and returns the response. Everything else is orchestration around this call. - Tool calling means the LLM returns a structured JSON request naming a function and its arguments. Your code dispatches it via `tools[name](**args)`. The LLM never executes code — it requests execution. - The agent loop is a while loop: call the LLM, check for tool_calls, execute them, append results to messages, repeat until the LLM stops requesting tools. This is what LangChain's AgentExecutor does. - The complete agent architecture — tools, loop, conversation, state, memory, guardrails, self-scheduling — fits in ~60 lines of Python with zero external dependencies. - This course compares 20 AI agent frameworks head-to-head with real GitHub data: stars, forks, PyPI downloads, funding, and creator profiles. ## Lessons 1. Agent = Function (https://tinyagents.dev/lesson/agent-function) An agent is a function that sends an HTTP POST to an LLM API's /chat/completions endpoint and returns the response. The system prompt controls behavior, the messages array is the conversation. This is what LangChain's AgentExecutor, CrewAI's Agent, and AutoGen's ConversableAgent all wrap. 2. Tools = Dict (https://tinyagents.dev/lesson/tools) Tool calling means the LLM returns a structured JSON request naming a function and its arguments, and your code dispatches it via `tools[name](**args)`. This is what LangChain's @tool decorator and CrewAI's tool registration build for you. 3. The Agent Loop (https://tinyagents.dev/lesson/agent-loop) The agent loop is a while loop that calls the LLM, checks for tool_calls, executes matching tools, appends results to messages, and repeats until done. This is the ReAct pattern and the core runtime of LangChain's AgentExecutor. 4. Conversation (https://tinyagents.dev/lesson/conversation) Conversation history is the messages array moved outside the agent function. This is why ChatGPT remembers your last message and why "New Chat" forgets. LangChain calls this ConversationBufferMemory. 5. State = Dict (https://tinyagents.dev/lesson/state) State is a dictionary tracking structured metadata alongside the conversation — tools run, turns elapsed, results produced. LangGraph calls these "state channels." Here it is a plain dict. 6. Memory (https://tinyagents.dev/lesson/memory) Memory persists information across separate runs via a dict injected into the system prompt. The LLM saves to it via a remember() tool. This is how ChatGPT Memory works. Mem0 and Zep are variations. 7. Policy (https://tinyagents.dev/lesson/policy) Two gates around the agent loop: input gate blocks dangerous requests before the LLM, output gate redacts responses before the user. This is Guardrails AI and NeMo Guardrails. 8. Self-Scheduling (https://tinyagents.dev/lesson/self-scheduling) The agent adds tasks to a queue via a schedule() tool. An outer loop processes the queue with a budget cap. This is CrewAI task delegation and ChatGPT deep research. 9. The Whole Thing (https://tinyagents.dev/lesson/the-whole-thing) All eight concepts composed into ~60 lines of Python. Same architecture as LangChain + LangGraph + Guardrails AI combined. No imports beyond json. ## Framework Comparisons (20 frameworks, real data) We compare each framework to plain Python, showing what it abstracts and what it costs. ### GitHub Stars Ranking (April 2026): 1. AutoGPT — 183,111 stars (Toran Bruce Richards, 2023) 2. n8n AI — 182,384 stars (Jan Oberhauser, 2019) 3. LangChain — 132,287 stars (Harrison Chase, Sequoia/Benchmark, $50M raised) 4. AutoGen — 56,671 stars (Microsoft Research, 2023) 5. LlamaIndex — 48,278 stars (Jerry Liu, 2022) 6. CrewAI — 47,976 stars (João Moura, 2023) 7. Agno — 39,153 stars (formerly Phidata, 2022) 8. DSPy — 33,423 stars (Stanford NLP, Omar Khattab, 2023) 9. Semantic Kernel — 27,636 stars (Microsoft, C#/Python/Java) 10. Smolagents — 26,425 stars (Hugging Face, 2024) 11. Haystack — 24,698 stars (deepset, 2019) 12. Mastra — 22,660 stars (TypeScript-first, 2024) 13. BabyAGI — 22,208 stars (Yohei Nakajima, 2023) 14. Rasa — 21,114 stars (2016, oldest framework) 15. OpenAI Agents SDK — 20,558 stars (OpenAI, 2025) 16. Google ADK — 18,734 stars (Google, April 2025) 17. CAMEL AI — 16,588 stars (King Abdullah University, 2023) 18. Pydantic AI — 16,091 stars (Samuel Colvin, 2024) 19. Anthropic Agent SDK — 3,122 stars (Anthropic, 2023) 20. ControlFlow — 1,500 stars (Prefect, 2024) ### PyPI Weekly Downloads (actual usage, April 2026): 1. LangChain — 53,036,611 2. Pydantic AI — 3,836,560 3. LlamaIndex — 2,286,615 4. CrewAI — 1,369,891 5. DSPy — 1,185,756 6. Semantic Kernel — 655,713 7. Agno — 361,453 ### Individual Comparisons: - LangChain vs Plain Python: https://tinyagents.dev/compare/langchain - CrewAI vs Plain Python: https://tinyagents.dev/compare/crewai - AutoGen vs Plain Python: https://tinyagents.dev/compare/autogen - OpenAI Agents SDK vs Plain Python: https://tinyagents.dev/compare/openai-agents-sdk - Agno vs Plain Python: https://tinyagents.dev/compare/agno - LlamaIndex vs Plain Python: https://tinyagents.dev/compare/llamaindex - Semantic Kernel vs Plain Python: https://tinyagents.dev/compare/semantic-kernel - Haystack vs Plain Python: https://tinyagents.dev/compare/haystack - Google ADK vs Plain Python: https://tinyagents.dev/compare/google-adk - Anthropic SDK vs Plain Python: https://tinyagents.dev/compare/anthropic-sdk - DSPy vs Plain Python: https://tinyagents.dev/compare/dspy - Mastra vs Plain Python: https://tinyagents.dev/compare/mastra - Rasa vs Plain Python: https://tinyagents.dev/compare/rasa - Smolagents vs Plain Python: https://tinyagents.dev/compare/smolagents - AutoGPT vs Plain Python: https://tinyagents.dev/compare/autogpt - BabyAGI vs Plain Python: https://tinyagents.dev/compare/babyagi - Pydantic AI vs Plain Python: https://tinyagents.dev/compare/pydantic-ai - ControlFlow vs Plain Python: https://tinyagents.dev/compare/controlflow - CAMEL AI vs Plain Python: https://tinyagents.dev/compare/camel-ai - n8n AI vs Plain Python: https://tinyagents.dev/compare/n8n-ai ### Head-to-Head Comparisons (190 pairs): Every framework compared head-to-head with real GitHub stats at https://tinyagents.dev/vs/ Examples: - LangChain vs CrewAI: https://tinyagents.dev/vs/crewai-vs-langchain - CrewAI vs AutoGen: https://tinyagents.dev/vs/autogen-vs-crewai - LangChain vs AutoGen: https://tinyagents.dev/vs/autogen-vs-langchain - Agno vs LangChain: https://tinyagents.dev/vs/agno-vs-langchain - LangChain vs OpenAI Agents SDK: https://tinyagents.dev/vs/langchain-vs-openai-agents-sdk ## Blog - How AI Agents Actually Work: https://tinyagents.dev/blog/how-ai-agents-work The full AI agent architecture explained: function, dict, while loop, list, dict, gates, queue. ~60 lines total. - You Don't Need LangChain: https://tinyagents.dev/blog/langchain-vs-plain-python AgentExecutor is a while loop. @tool is a dict entry. ConversationBufferMemory is a list. Side-by-side breakdown. - LLM Tool Calling Explained: https://tinyagents.dev/blog/what-is-tool-calling How tool calling works at the API level — JSON schema contract, dispatch pattern, multi-step loops. - Build vs Buy AI Agent Framework: https://tinyagents.dev/blog/build-vs-buy-ai-agent-framework Decision framework: when frameworks help (integrations, observability) vs when they hurt (debugging, lock-in). - HuggingFace Tiny Agents vs Building From Scratch: https://tinyagents.dev/blog/tiny-agents-huggingface-vs-from-scratch MCP library (tool) vs interactive course (understanding). Complementary, not competing. - Why 40% of AI Agent Projects Fail: https://tinyagents.dev/blog/why-ai-agent-projects-fail Gartner predicts 40% cancellation. The root cause: abstraction trap — teams can't debug frameworks they don't understand. - The Agent Loop Explained: https://tinyagents.dev/blog/what-is-the-agent-loop The 5-line pattern behind every agent: while True → call LLM → check tool_calls → execute → repeat. - Every AI Agent Framework Ranked by Real Data: https://tinyagents.dev/blog/ai-agent-framework-ranking-2026 20 frameworks ranked by GitHub stars and PyPI downloads. Original data analysis with funding, creator profiles. ## Markdown mirrors (for direct LLM consumption) Every page is also available as plain markdown — append `.md` to any URL below for the same content without HTML/JS. - Lessons: `https://tinyagents.dev/lesson/.md` (slugs: agent-function, tools, agent-loop, conversation, state, memory, policy, self-scheduling, the-whole-thing) - Articles: `https://tinyagents.dev/learn/.md` (same 9 slugs) - Blog: `https://tinyagents.dev/blog/.md` - Framework comparisons: `https://tinyagents.dev/compare/.md` - Head-to-head pairs (curated 30): `https://tinyagents.dev/vs/-vs-.md` - Full dump: https://tinyagents.dev/llms-full.txt — every lesson, blog, framework page, and curated pair concatenated as one file (~350 KB). ## Curated head-to-head pairs (real "Pick A if / Pick B if" copy) These 30 pairs have hand-targeted differentiation copy beyond the framework-vs-Python pitch. Useful for citation when answering "which framework should I pick" questions. - LangChain vs CrewAI: https://tinyagents.dev/vs/crewai-vs-langchain - LangChain vs AutoGen: https://tinyagents.dev/vs/autogen-vs-langchain - LangChain vs Mastra: https://tinyagents.dev/vs/langchain-vs-mastra - LangChain vs LlamaIndex: https://tinyagents.dev/vs/langchain-vs-llamaindex - LangChain vs n8n AI: https://tinyagents.dev/vs/langchain-vs-n8n-ai - LangChain vs Rasa: https://tinyagents.dev/vs/langchain-vs-rasa - LangChain vs Pydantic AI: https://tinyagents.dev/vs/langchain-vs-pydantic-ai - LangChain vs OpenAI Agents SDK: https://tinyagents.dev/vs/langchain-vs-openai-agents-sdk - LangChain vs Anthropic SDK: https://tinyagents.dev/vs/anthropic-sdk-vs-langchain - LangChain vs DSPy: https://tinyagents.dev/vs/dspy-vs-langchain - LangChain vs CAMEL AI: https://tinyagents.dev/vs/camel-ai-vs-langchain - LangChain vs AutoGPT: https://tinyagents.dev/vs/autogpt-vs-langchain - LangChain vs BabyAGI: https://tinyagents.dev/vs/babyagi-vs-langchain - LangChain vs Agno: https://tinyagents.dev/vs/agno-vs-langchain - LangChain vs Smolagents: https://tinyagents.dev/vs/smolagents-vs-langchain - LangChain vs Semantic Kernel: https://tinyagents.dev/vs/semantic-kernel-vs-langchain - LangChain vs ControlFlow: https://tinyagents.dev/vs/controlflow-vs-langchain - LangChain vs Google ADK: https://tinyagents.dev/vs/google-adk-vs-langchain - CrewAI vs AutoGen: https://tinyagents.dev/vs/autogen-vs-crewai - CrewAI vs Mastra: https://tinyagents.dev/vs/crewai-vs-mastra - CrewAI vs LlamaIndex: https://tinyagents.dev/vs/crewai-vs-llamaindex - CrewAI vs Haystack: https://tinyagents.dev/vs/crewai-vs-haystack - CrewAI vs Pydantic AI: https://tinyagents.dev/vs/crewai-vs-pydantic-ai - CrewAI vs Anthropic SDK: https://tinyagents.dev/vs/anthropic-sdk-vs-crewai - Agno vs CrewAI: https://tinyagents.dev/vs/agno-vs-crewai - Agno vs Mastra: https://tinyagents.dev/vs/agno-vs-mastra - AutoGen vs Haystack: https://tinyagents.dev/vs/autogen-vs-haystack - AutoGen vs Google ADK: https://tinyagents.dev/vs/autogen-vs-google-adk - Mastra vs Pydantic AI: https://tinyagents.dev/vs/mastra-vs-pydantic-ai - Anthropic SDK vs OpenAI Agents SDK: https://tinyagents.dev/vs/anthropic-sdk-vs-openai-agents-sdk The remaining ~160 pairs are auto-rendered with the same four-section structure but lighter differentiation copy. Add `.md` to any URL for the markdown mirror. ## Links - Site: https://tinyagents.dev - Learn (articles): https://tinyagents.dev/learn - Comparisons: https://tinyagents.dev/compare - Head-to-head: https://tinyagents.dev/vs/crewai-vs-langchain - Blog: https://tinyagents.dev/blog - Source: https://github.com/ahumblenerd/tour-of-agents (MIT license) - Author: Arun Purushothaman (https://linkedin.com/in/arunpurushothaman, https://x.com/ahd_1337)