Building LLM Agents Without Frameworks: A Deep Dive Into Agentic Patterns
Hook
What if the heavyweight frameworks you’re using to build AI agents are hiding the very patterns you need to understand? This repository strips away the abstraction layers to reveal how agentic systems actually work.
Context
The explosion of LLM agent frameworks—LangChain, LangGraph, CrewAI, AutoGen—has made it easier than ever to build autonomous AI systems. But this convenience comes at a cost: most developers treat these frameworks as black boxes, never understanding the fundamental patterns that make agents intelligent. When Andrew Ng published his influential series on agentic design patterns in his DeepLearning.AI blog, he identified four core paradigms that underpin nearly every agent system: reflection (self-critique loops), tool use (external API integration), planning (reasoning through multi-step tasks), and multi-agent collaboration (role-based task distribution). The neural-maze/agentic-patterns-course repository takes a radical approach to teaching these patterns—implementing each one from scratch using pure API calls to Groq, with zero dependencies on frameworks like LangChain, LangGraph, LlamaIndex, or CrewAI. This isn’t just another tutorial that wraps existing abstractions; it’s a focused exploration of how agents work at the protocol level, revealing the mechanics behind seemingly complex behaviors.
Technical Insight
The architecture is deliberately minimalist, with each pattern implemented as a standalone component that makes direct calls to Groq’s API. The repository provides both educational notebooks and a production Python package (agentic-patterns) available via pip install.
The Reflection Pattern appears to implement a two-phase loop where the LLM generates output, then critiques its own work to iteratively improve quality. Based on the README’s usage example, the ReflectionAgent class accepts separate system prompts for generation and reflection phases, allowing you to assign different personas (like “experienced computer scientist”) to the critique role. The run() method takes parameters including user_msg, generation_system_prompt, reflection_system_prompt, n_steps for controlling iteration count, and a verbose flag. Despite its conceptual simplicity—essentially asking the LLM to critique and regenerate—this pattern consistently improves output quality through multiple reasoning passes.
The Tool Pattern implementation provides a Tool base class (in src/agentic_patterns/tool_pattern/tool.py) and a ToolAgent class. While the README doesn’t detail the internal mechanics, the pattern enables LLMs to access external information sources like Wikipedia, YouTube content analysis, or Wolfram Alpha calculations. The README emphasizes that tools are “just functions the LLM can use” and describes them as “the secret sauce of agentic applications.”
The Planning Pattern showcases the ReAct (Reasoning + Acting) technique through the ReactAgent class. The README indicates this pattern enables LLMs to break large tasks into smaller, more manageable subgoals without losing sight of the end objective. The ReAct approach allows agents to reason about what sequence of steps to follow for task completion.
The Multi-Agent Pattern implements a system similar to frameworks like CrewAI or AutoGen, where tasks are divided into subtasks executed by agents with different roles (software engineer, project manager, etc.). The implementation includes an Agent class (representing crew members) and a Crew class (for orchestration). The README suggests this involves role-based task distribution across specialized agents.
The repository bridges education and practice by providing both Jupyter notebooks in the notebooks/ folder (for step-by-step walkthroughs with explanations) and a pip-installable package. Each pattern has an accompanying YouTube video tutorial. This dual approach allows you to learn the concepts interactively, then import the production classes (like ReflectionAgent, ToolAgent, ReactAgent) into your own projects using from agentic_patterns import ....
Gotcha
The biggest limitation is the hard dependency on Groq—every implementation assumes Groq’s API structure. The README explicitly states the project “works with Groq as the LLM provider” and requires a Groq API key stored in an .env file. There appears to be no abstraction layer for swapping providers, so adapting this code to work with OpenAI, Anthropic, or local models via Ollama would require modifying the underlying API calls. This prevents experimentation with different models to compare how pattern performance varies across providers.
The educational focus also suggests this is a learning tool rather than a production-ready library. While the README shows clean usage examples, it doesn’t document error handling, retry logic, rate limiting, or state persistence features that would be critical for production deployments. The repository explicitly positions itself as implementing patterns “from scratch” without framework abstractions, which means you’re getting transparent, understandable code optimized for learning rather than a battle-tested library with extensive operational safeguards. The README’s emphasis on understanding “what is happening under the hood” confirms this is primarily a teaching resource and prototype platform. If you’re considering production use, you should expect to add significant infrastructure around these core implementations.
Verdict
Use this repository if you’re an engineer or researcher who needs to deeply understand how agentic patterns work before committing to a heavyweight framework, if you’re building custom agent architectures where framework opinions would constrain you, or if you’re teaching LLM systems and want clear, minimal examples. The framework-free approach (explicitly “no LangChain, no LangGraph, no LlamaIndex, no CrewAI”) is valuable for understanding the fundamental mechanics behind agent behaviors, and the combination of educational notebooks with a pip-installable package provides both learning and prototyping paths. The 1,698 GitHub stars suggest strong community validation of the educational approach. Skip it if you need production-ready agents with comprehensive error handling and operational features, if you require multi-provider LLM support beyond Groq for cost optimization or redundancy, or if you want the extensive tool ecosystem and community support that comes with established frameworks. This is explicitly positioned as an educational implementation of Andrew Ng’s agentic patterns—invaluable for learning and prototyping, but you should plan to add significant infrastructure before deploying agents built with this code to production environments.