Skip to main content
BlogResourcesPodcast
🏛️ Module 3 of 8 20 min read Phase 1: Foundation

Three Pillars

Instructions, Memory & Tools

Video Lesson Coming Soon

A video walkthrough for this module is in production. For now, dive into the written content below.

What You'll Learn

  • Context engineering — the bigger picture
  • Pillar 1: Instructions (the system prompt)
  • Pillar 2: Memory (accumulated knowledge)
  • Pillar 3: Tools (external capabilities)
  • The Troubleshooting Decision Tree
  • MCP: the universal tool standard
  • Security fundamentals
In this module 9 sections

The Best Agents Don't Need Perfect Prompts

Before you write your system prompt in Module 4, you need the mental model behind it. This module gives you the architecture — how the three components of every agent fit together as a system, how to diagnose problems when something goes wrong, and why certain instructions work while others fail.

Think of it this way: Module 4 teaches you how to write the agent's brain. This module teaches you how the whole body works — so that when you sit down to write your system prompt, you understand the machine you are programming.

The Concept: Context Engineering

Context Engineering

There is a term being used across the AI industry right now that captures exactly what we are about to cover. It is called context engineering.

Prompt engineering is about what you say to the AI — the instructions, the phrasing, the structure of your request. That is what you will do in Module 4 when you write your RIDE system prompt. It is important. It is also only part of the picture.

Context engineering is about everything the AI sees when it generates a response. Not just your instructions, but also the examples it can reference, the documents it has access to, the tools it can use, the conversation history it is drawing on, and any background knowledge you have loaded.

Anthropic, the company behind Claude, put it this way in a widely cited article: most agent failures are not model failures. They are context failures. The AI was capable of doing the work. It just did not have the right information at the right time.

Think of it this way: prompt engineering is writing a good brief. Context engineering is making sure the employee also has the reference materials, the style guide, the right software, and the lessons from last month's similar project — all available when they need them.

The Three Pillars

See how Instructions, Memory, and Tools form the foundation.

🌳 Three Pillars Architecture
What Makes an Agent Work
🏛️Three PillarsFOUNDATION
├─📋Pillar 1: InstructionsRULES
└─🎯System prompt / rulebook / identity
├─🧠Pillar 2: MemoryKNOWLEDGE
└─📚Reference docs / examples / style guides
├─🔧Pillar 3: ToolsACTIONS
└─Web search / file ops / messaging / APIs
0/7

Interactive — tap to explore

Every AI agent is built from three components. We call these the Three Pillars because every agent stands on all three, and weakness in any one of them shows up in the output.

Pillar 1 — Instructions: The agent's rulebook. Defines who the agent is, how it approaches work, what standards it maintains, and what it does when something goes wrong.
Pillar 2 — Memory: Everything your agent knows beyond its built-in training. Reference materials, examples, past experience, and accumulated knowledge that make your agent smarter than a generic AI.
Pillar 3 — Tools: The capabilities that let an agent do things beyond generating text. Search the web, read documents, send messages, format files, execute code.
🧠
Key Concept

OpenClaw — the open-source AI agent with over 190,000 GitHub stars — uses exactly this architecture. Its configuration is split across three files: SOUL.md for personality and instructions, persistent memory files for accumulated knowledge, and a TOOLS.md file plus a skills ecosystem for capabilities. This is not a coincidence. It is how agents work.

Pillar 1: Instructions (The System Prompt)

Instructions are the agent's rulebook. They define who the agent is, how it approaches work, what standards it maintains, and what it does when something goes wrong.

ℹ️
Key Concept

You will build this in Module 4 using the RIDE framework: Role (identity), Instructions (process), Dos and Don'ts (rules), Examples (demonstrations), and Escalation (edge case handling). The system prompt is the most important single document in your agent's context.

Pillar 2: Memory (What Your Agent Knows)

Interactive: Four Types of Memory Your Agent Uses

🧠 Memory System
Four Types of Memory Your Agent Uses
Working MemoryCurrent task context & session state
DYNAMIC
📅
Episodic MemoryPast interactions and job results
DYNAMIC
🧠
Semantic MemoryBrand voice, style guides, company knowledge
CACHED
🔧
Procedural MemoryHow to perform tasks and use tools
CACHED
0/4

Interactive — tap to explore

Memory is everything your agent knows beyond its built-in training. It is the reference materials, examples, past experience, and accumulated knowledge that make your agent smarter than a generic AI.

Memory fills the gap between generic knowledge and your client's preferences. Over time, it becomes your biggest competitive advantage — an agent with six months of accumulated memory produces dramatically better work than an identical agent starting from scratch.

There are four types: Working Memory (current task), Episodic Memory (past jobs and lessons learned), Semantic Memory (facts, style guides, glossaries), and Procedural Memory (templates and workflows).

Pillar 3: Tools (What Your Agent Can Do)

If instructions are the agent's mind and memory is its knowledge, tools are its hands. Tools are the capabilities that let an agent do things beyond generating text.

Every action an agent takes that is not just writing words requires a tool. There are five tool categories:

Search tools: Look up current information, verify facts, research topics. Essential for research agents and any service requiring up-to-date information.

Read tools: Process uploaded documents, files, or web pages. Essential for editing services and any data extraction work.

Write/generate tools: Produce text, formatted documents, or structured outputs. This is the core capability for most freelance agents.

Communication tools: Send and receive messages. Essential for client interaction and status updates.

Evaluation tools: Check output quality against criteria. An advanced addition for agents that self-verify before delivery.

One of the most instructive design decisions in professional AI systems is a rule found in Cursor's system prompt: Only call tools when they are necessary. This prevents tool overuse — an agent that reaches for a search tool on every step creates unnecessary delays and can actually make output worse.

Start with text generation and communication capabilities. Add search tools when your service specifically requires current information. Add document reading when clients regularly provide reference materials. Giving an agent ten tools when it needs three creates decision overhead and increases the chance of something going wrong.

How the Three Pillars Work Together

Weakness in any pillar shows up in the output.

If Instructions are weak: The agent does not know how to approach the work. It guesses. Output is inconsistent.
If Memory is weak: The agent lacks context. It defaults to generic output instead of your specific style.
If Tools are weak: The agent cannot access the information it needs. It makes things up or produces incomplete work.

The Troubleshooting Decision Tree

Interactive: Finding What Went Wrong

🔄 Diagnosis Flow
Finding What Went Wrong
Bad Output?
📋
Instructions Issue?
🧠
Memory Issue?
🔧
Tools Issue?
Fix & Retry
0/5

Interactive — tap to explore

When something goes wrong, ask yourself these questions in order.

1
Is the output incomplete or wrong?

Check Instructions first. The system prompt may be unclear or missing a key step.

2
Is the output generic or off-brand?

Check Memory second. You may need to add examples, style guides, or domain knowledge.

3
Is the agent using the wrong information or making things up?

Check Tools third. The agent may need access to documents, search, or other capabilities.

Security: Protecting Your Agent and Your Business

⚠️
Security Matters

You are giving an AI agent access to your work, your client communications, and potentially your professional reputation. That comes with responsibility.

Prompt injection occurs when malicious instructions are hidden inside content your agent processes — an email, a document, a web page. The hidden instructions try to hijack the agent into doing something unintended.

How to protect yourself: Never give your agent access to sensitive data it does not need. Review client-provided documents before processing them through your agent, especially from new or unknown clients.

Data leakage happens when your agent processes client work through an AI model — that means client content is being sent to a server somewhere. Understand your platform's data policy. Does the content get used for training? Is it stored? For how long?

How to protect yourself: Know where your data goes. Use platforms that do not use your data for training. Do not process highly confidential client materials through an agent without understanding the privacy implications.

Over-permission occurs when you give your agent too many capabilities — system access, file management, email sending — when it only needs text generation and basic communication. Every unnecessary permission is a potential vector for something going wrong.

How to protect yourself: Start with the minimum permissions your agent needs. Add more only when there is a specific, clear reason.

One more reality to be aware of: Running AI agents costs money. OpenClaw users have reported costs exceeding 200 dollars per month for heavy usage. Your costs will depend on your platform, your volume, and which AI model you use. Be aware of this from the start. Monitor your usage. Choose models appropriate to your task complexity.

Key Takeaways

📝 My Notes
← Setup Training — RIDE →