Agentic AI Systems: Architectures, Frameworks, and Memory

Agentic AI Systems: Architectures, Frameworks, and Memory

An agent is a language model placed inside a loop: it perceives, decides, acts, observes the result, and decides again. That loop is the whole difference. A standard LLM call answers a prompt; an agent pursues a goal, choosing its own steps and tools along the way.

Building one comes down to three decisions — the reasoning pattern, the framework, and the memory system. This reference covers each in turn. If you already work with prompt engineering and retrieval-augmented generation (RAG), none of it is foreign; it is those same skills wired into a control loop.

Reactive vs. agentic

Reactive (standard LLM / RAG) Agentic
Goal Answer one prompt accurately Reach a multi-step objective
Planning Follows the immediate instruction Decomposes a goal into an ordered sequence of steps
Action Text out, maybe one retrieval call Selects and runs tools dynamically — APIs, code, databases
Memory The current context window Short-term working state plus persistent long-term memory
Autonomy Needs input at each step Runs the loop itself, self-correcting between steps

The defining property is agency: the ability to act, judge the outcome, and adjust without a human closing every loop.

1. Reasoning patterns

The pattern governs how the agent thinks between actions. The three below trade cost against capability, so pick for the task rather than the trend.

ReAct (Reason + Act). The agent alternates a thought (what to do next) with an act (a tool call), then reads the observation and loops. Simple to build and reliable for short tasks with an obvious next step. The cost is an LLM call per step — latency and tokens add up, and a confused agent can loop. Good for chatbots, single-goal lookups, basic tool use.

Plan-and-Execute. The agent drafts the full plan up front, then works the steps in order, often using a cheaper model for execution. Lower cost and more predictable than ReAct on long workflows. The weakness is rigidity: a plan made before the work starts can break when reality diverges. Good for data-analysis pipelines, content generation, process automation.

Reflexion (self-correction). The agent does the task, critiques its own output in natural language, then revises and retries — improving over several cycles. It reaches higher accuracy on hard problems where success is checkable, at the price of speed, cost, and a model strong enough to critique itself honestly. Good for code generation, math, and research tasks with a clear correctness signal.

2. The tool layer

An agent’s tools define what it can actually do — web search, database queries, a code interpreter, an API call. This set is the agent’s operational boundary, and its design matters as much as the reasoning pattern: a sharp, well-described toolset produces reliable behavior, while a vague or overlapping one produces confusion. For how to design tools an agent can use consistently, see Designing Effective Agent Tools.

3. Frameworks

Frameworks implement the patterns above so you don’t rebuild the loop by hand. They range from heavy stateful libraries to lightweight text conventions.

Framework Focus What it gives you Best for
LangGraph Stateful, multi-agent systems Agents as nodes in a graph; checkpointed state; fine-grained control and tracing Complex, auditable workflows that must be reliable in production
CrewAI Role-based collaboration Intuitive “Researcher / Writer / Editor” abstractions; fast to stand up a team of agents Content pipelines, research crews, rapid prototyping
AutoGen Conversational multi-agent patterns Flexible agent-to-agent messaging; now folded into the Microsoft Agent Framework with Azure integration Enterprise work in the Microsoft ecosystem; research on agent interaction
Agentic Markdown Lightweight text orchestration Structured Markdown files that pin an agent to a defined role CLI agents, local development, keeping a model on-task

Agentic Markdown

Because agents read Markdown natively, structured text has become a practical instruction set for constraining them. Frameworks in this family use plain .md files to hold an agent — a CLI coding agent, for instance — inside a defined persona such as Product Manager, Engineer, QA, or DevOps. Pinning the role keeps multi-step work coherent instead of drifting into isolated, contradictory edits. See Agentic Markdown Programming for the full treatment.

Where to start: learn one framework well before adding a second. Agentic Markdown or CrewAI get you to a working prototype quickly; move to LangGraph when you need production-grade state and observability.

4. Memory

Any task that outlasts a single context window needs memory beyond the prompt.

Type What it holds Typical implementation
Short-term (working) State for the current task or session; volatile In-memory structures, Redis, a framework’s built-in state
Long-term Knowledge accumulated across sessions — past interactions, facts, preferences Vector databases (semantic search), knowledge graphs (structured facts), SQL/NoSQL

Production agents generally combine strategies in a hybrid memory system:

  1. Semantic retrieval — a vector store surfaces relevant past experiences or documents by similarity.
  2. Factual recall — a knowledge graph or relational store answers structured queries (user profiles, specs).
  3. Summarization — an LLM periodically compresses history so it fits the context window without losing the thread.

For two full implementations, see Custom LLM Memory Layer (DSPy + vector database) and Self-Organizing Agent Memory (SQLite scenes).

5. What to build first

Three projects exercise the whole stack:

  • Research agent — takes a question, searches multiple sources, synthesizes, and returns a cited report. Exercises tool use, state tracking, RAG, and planning.
  • Multi-agent content system — a crew (Researcher, Writer, Editor, Fact-Checker) that turns a topic into a finished article. Exercises orchestration, delegation, and role prompting.
  • Data-analysis agent — connects to a database or CSV, writes and runs SQL or Python to answer questions, and self-corrects on errors. Exercises code generation, execution, and debugging.

Key takeaways

  1. An agent is an LLM in a perceive-plan-act loop; agency is the loop, not the model.
  2. The reasoning pattern is a cost/capability trade — ReAct for simple, Plan-and-Execute for structured, Reflexion for hard-and-checkable.
  3. Frameworks implement the patterns; learn one deeply before reaching for another.
  4. Long-running agents need hybrid memory — working state plus semantic and factual long-term stores.
  5. Prompt engineering, RAG, and MLOps are the building blocks, not separate skills.
This entry was posted in . Bookmark the permalink.