applied-ai2026-07-273 minNikolay Angelov

Agentic patterns: from definition to implementation

What an AI agent is, the core patterns, and the two leading frameworks — LangGraph and CrewAI.

This article introduces a small demo on agentic patterns — but before the demo itself, a bit of theory. We'll cover what an agent actually is, the recurring patterns for building one, and the two frameworks most often used to implement them.

An agent — a wink at the "agent" from The Matrix

First: what is an agent

If you're still not sure what an "AI agent" means, here's the simplest definition. An ordinary chat is one question and one answer: you send text, the model returns text, done. An agent is something else — it's a language model you've given a goal, tools, and the freedom to decide the steps toward that goal itself.

It works in a loop: the model is the brain and reasons about what needs to be done, acts (calls a tool — search, a database, an API, code execution), observes the result, and decides the next step. And so on, until the goal is reached. The difference from a plain prompt is four things: tools, a loop, state (memory of what's already been done), and autonomy over the next move. An agent doesn't just answer — it acts, checks, and corrects.

What are agentic patterns

Agentic patterns are the recurring structures by which we organize that loop. You don't invent every agent from scratch — you combine a few established patterns to fit the task. The most common ones:

  • Tool use (ReAct) — the base pattern: the model alternates reasoning and action (reason + act) until it has gathered enough context to answer.
  • Reflection — the agent critiques its own output and improves it over several iterations, instead of returning the first attempt.
  • Planning — a complex task is broken into separate steps executed in sequence.
  • Multi-agent — several specialized agents collaborate: e.g. one researches, another writes, a third reviews.
  • Router / orchestrator — one agent routes the task to the right sub-agent or tool.

Frameworks

LangGraph is a framework for orchestrating agents. It models the agent as a graph of three parts: State (the shared state), Nodes (which do the work — calling the model, executing a tool), and Edges (which decide the next node). Conditional edges and cycles allow complex, looping flows, and the framework adds durable execution, human-in-the-loop, and persistent memory. LangGraph gives explicit, fine-grained control — you pick it when the flow needs to be precise, traceable, and predictable.

CrewAI is a higher-level framework, optimized for collaborating agents that act in distinct roles. You define agents (each with its own role, goal, and tools) that form a "crew" — a team that distributes and delegates tasks autonomously; on top, Flows give control over state and event-driven execution. With less boilerplate you stand up a multi-agent team fast, at the cost of less low-level control. CrewAI fits when the task naturally splits into roles — say researcher, writer, reviewer — that need to collaborate.

In short: LangGraph for control over the flow, CrewAI for a fast start with role-based multi-agent teams. Both ultimately do the same thing — spin the reason → act → observe loop around one or more language models.

The demo

All this theory can be tried live. I gathered twenty-four agentic patterns (plus one bonus that composes several) into an interactive demo, organized into four categories: Foundational & Workflow, Reasoning & Strategy, Orchestration & Topology, and Reliability & Safety. Nineteen are built with LangGraph, six with CrewAI, and each one calls a real language model (Qwen2.5 3B, self-hosted via Ollama) and shows its intermediate steps, so you can watch each pattern "reason" in real time, right in the browser. Try it here: agentic-patterns-demo.angeloff.dev. The code is open source: github.com/nikolay-angeloff/agentic-patterns.

Note: the demo is optimized for desktop — best viewed on a computer; it's not responsive.