Getting Started
What is an AI agent workflow?
An AI agent workflow is a system where one or more AI models take actions autonomously — browsing the web, writing files, calling APIs, running code, or sending messages — based on a goal you define. Unlike a simple chatbot, an agent loop runs until the task is done (or it gets stuck and asks you).
What do I actually need to get started?
At minimum:
- An LLM API key (OpenAI, Anthropic, or a local model via Ollama)
- A runtime (OpenClaw, n8n, LangGraph, AutoGen, or plain Python)
- A clear goal written in plain English
You do NOT need to be a developer. Many agent setups work entirely through config files and prompts.
What's the difference between a chatbot and an agent?
| Chatbot | Agent | |---|---| | Responds once per message | Loops until task complete | | No tools | Has tools (web, files, APIs) | | Forgets between sessions | Can persist memory to files | | You drive | It drives |
Choosing a Runtime
Which agent runtime should I use?
Depends on your use case:
- OpenClaw — best for personal assistants, always-on agents, Discord/Signal bots, and home automation. Runs on a Mac, Pi, or VPS. Skills-based architecture makes it easy to extend.
- n8n — best for no-code automation connecting SaaS tools (Slack, Gmail, Notion, etc.)
- LangGraph / LangChain — best for developers building custom multi-agent pipelines in Python
- AutoGen — best for multi-agent research and complex task delegation between agent roles
- CrewAI — best for role-based agent teams where each agent has a defined specialty
Can I run agents locally without paying per API call?
Yes. Use Ollama with a local model like Mistral, Llama 3, or Qwen. Quality is lower than GPT-4o or Claude for complex reasoning, but for structured tasks (file ops, simple automation) it works well and costs nothing after setup.
Prompt Engineering for Agents
Why does my agent keep going in circles?
Usually one of three things:
- Vague goal — "do research" is not enough. Write "search for X, summarize the top 3 results, save to research.md"
- No exit condition — tell the agent explicitly when it's done
- No tool feedback — make sure tool results are included in the context so the agent knows what happened
What's a system prompt and why does it matter?
The system prompt is the agent's identity and ruleset — loaded at the start of every session. A good system prompt answers:
- Who are you?
- What are you trying to do?
- What tools do you have?
- What should you NOT do?
- How should you format output?
Weak system prompts = drifting, confused agents. Strong ones = focused, reliable agents.
Should I use one big agent or multiple smaller ones?
Start with one. Add more only when you hit real limits. Multi-agent systems are more powerful but harder to debug. A common pattern:
- Orchestrator agent — breaks down goals, delegates subtasks
- Specialist agents — web research, code writing, content editing, etc.
- Memory agent — maintains shared context across the team
Memory & Persistence
How do agents "remember" things?
Four main patterns:
- In-context — dump relevant info into the prompt each session (fast, cheap, limited by context window)
- File-based — agent reads/writes markdown or JSON files (simple, durable, great for personal agents)
- Vector DB — embed memories for semantic search (good for large knowledge bases — Chroma, Weaviate, Qdrant)
- Structured DB — SQL or key-value store for structured facts (appointments, preferences, etc.)
For most personal agents, file-based memory is enough and requires zero infrastructure.
How do I prevent my agent from forgetting important context?
- Write a
MEMORY.mdfile that the agent updates at end of session - Include key facts in the system prompt (name, preferences, ongoing projects)
- Use daily log files (
memory/YYYY-MM-DD.md) for raw notes - Periodically consolidate logs into the long-term memory file
Tools & Integrations
What tools should every agent have?
The essential toolkit:
- Web search (Tavily, Brave Search API, or scraping with curl/Playwright)
- File read/write (read local files, write output)
- Shell execution (run commands, scripts, CLI tools)
- HTTP requests (call APIs, webhooks)
Add specialized tools as needed: calendar, email, database, browser automation.
How do I connect my agent to external services?
Most integrations work via REST APIs. Pattern:
- Get an API key from the service
- Store it in an env file (
.envor~/.my-agent-env) - Write a tool definition that makes the API call
- Add the tool to your agent's available tools list
Never hardcode keys in prompts or config files. Use environment variables.
Reliability & Safety
My agent keeps making mistakes. How do I fix it?
- Add explicit constraints in the system prompt ("never delete files without confirming")
- Require reasoning — ask the agent to explain its plan before acting
- Log everything — if you can't see what the agent did, you can't debug it
- Use a better model — complex task? Don't cheap out. GPT-4o or Claude Sonnet for reasoning, cheap models for simple tasks
How do I prevent agents from doing something dangerous?
Three layers:
- Prompt guardrails — explicit "do not" rules in the system prompt
- Tool restrictions — only expose tools the agent actually needs
- Human-in-the-loop — for high-stakes actions, require confirmation before executing
When in doubt, add confirmation steps. An extra "are you sure?" is a small price for not accidentally deleting a folder or sending an email you didn't mean to send.
Going Further
What should I build first?
Best first agent projects (in order of difficulty):
- Daily briefing bot — reads calendar + weather + email, sends you a morning summary
- Research agent — given a topic, searches the web and writes a report
- Support agent — answers questions about your product using a knowledge base
- Personal assistant — always-on agent that handles scheduling, reminders, and small tasks
Where can I learn more?
- Ask Patrick Library (askpatrick.co) — battle-tested configs updated nightly
- Workshop tier — ask Patrick directly about your specific setup
- r/LocalLLaMA — best community for open-source model discussion
- r/ChatGPT — broader AI automation discussion
- OpenClaw docs — if you're using OpenClaw as your runtime
Want the full playbook?
Get copy-paste AI templates, prompt frameworks, and agent patterns — all in one place.
Get Access — It’s FreeNo credit card. No fluff. Just the good stuff.