AI Agents Primer — Four Elements, Build Methods, MCP, and Dify vs LangGraph for Customer Inquiry

Lead

Hi, I’m Pomarano.

In my AI Agent Study Notes, I used X post copy + proofreading as a small, measurable example. At work, though, you often need the big picture first: how chat AI differs from agents, how to build them, and what MCP means.

This post covers, in order:

  1. Chat AI vs AI agents — the decisive difference
  2. Four building blocks — brain, memory, tools, reflection
  3. Build methods — visual (no-code/low-code) and code-based tools
  4. MCP (Model Context Protocol)
  5. Use case — semi-automated customer inquiry handling with multiple agents
  6. How the same case maps to Dify, LangGraph, and MCP (details in follow-ups)

Follow-up articles:

PartContent
This postOverview · four elements · methods · MCP · case design
NextDify build details (JP published)
ThenLangGraph build details (JP published)

The Study Notes series goes deep on one topic; this series is a workplace map → hands-on build.

  • Japanese version: here

Overview

flowchart TB
  A["Chat AI vs Autonomous Agent"]
  B["Four Elements"]
  C["Build Methods<br/>Visual / Code"]
  D["MCP"]
  E["Case: Customer Inquiry"]
  F["Build with Dify / LangGraph / MCP"]

  A --> B --> C --> D --> E --> F

  classDef concept fill:#e8f4fc,stroke:#3d7ea6,stroke-width:2px,color:#1a1a1a
  classDef build fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px,color:#1a1a1a
  class A,B,C,D concept
  class E,F build

1. The Decisive Difference — Traditional AI vs AI Agents

1-1. Chat AI (conversational)

Similar to using ChatGPT or Claude in chat mode:

  • You send prompts each turn
  • The model mainly answers or generates text
  • Next steps and external systems are usually decided by humans

Strong as a consultant or draft writer; repeating the same procedure at scale means re-explaining every time.

1-2. AI agents (autonomous)

An agent observes → decides → acts toward a goal:

  • A goal comes first (e.g. draft a reply to an inquiry)
  • It can choose and call tools — search, APIs, files
  • It loops — retry or revise if output is not good enough
AspectChat AIAI agent
StanceReactiveProactive toward a goal
InstructionsTurn-by-turn chatGoal + rules (spec)
ScopeMostly textTools, multi-step workflows
OutputConversationArtifacts — drafts, tickets, files
Human roleEvery turnSemi-automation — review when needed

Not either/or: brainstorm in chat; run typed business work with agents.


2. Four Elements of an AI Agent

Different tools, similar anatomy:

flowchart LR
  T["Brain / LLM"]
  M["Memory"]
  A["Action / Tools"]
  R["Reflection"]

  T --> A
  M --> T
  A --> R
  R --> T

  classDef e fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px,color:#1a1a1a
  class T,M,A,R e
ElementRoleCustomer inquiry example
Brain (LLM)Understand and decide next stepCategory, draft reply
MemoryShort/long-term contextFAQ, past cases, order info
Action (tools)Affect the outside worldTicket search, order API, save draft
ReflectionReview and retryTone check, forbidden phrases, regenerate

The Study Notes copy + proofreading pair is close to brain + reflection. Add memory and tools for production work.


3. Build Methods

3-1. Visual (no-code / low-code)

Wire nodes on a canvas:

ToolStrengthGood for
DifyAgents/workflows, knowledge, APIBusiness PoC, FAQ, inquiry
n8nMany SaaS connectorsAutomation hubs
Microsoft Copilot StudioMicrosoft 365 / enterpriseIT-managed Microsoft shops

Hands-on in this series: Dify — easy to visualize classify → draft → check and attach FAQ knowledge.

3-2. Code-based

Explicit state, branching, retries, internal APIs:

FrameworkStrengthGood for
LangGraphStateful graph, multi-node agentsBranching, retries, business logic
OpenAI Agents SDKOfficial agent + tools patternSmall starts on OpenAI stack
LlamaIndexRAG, retrieval pipelinesDocument-heavy FAQ use cases

Hands-on in this series: LangGraph — inquiry flow maps cleanly to State and nodes; APIs extend well.

3-3. Which to try first

PriorityFirst pick
Speed, easy to explainDify
Internal APIs, fine controlLangGraph

Common path: nail the flow in Dify, move heavy integration to LangGraph later.


4. MCP — Model Context Protocol

MCP is a common way for AI apps and agents to talk to external tools and data.

RoleWhat it does
MCP serverExposes files, DB, tickets, browser as tools
MCP host/clientIDE, desktop app, or your agent calls the server

For agents:

  • Memory and tools can be swapped without rewriting the host
  • Same MCP server can serve Dify and LangGraph
  • Model changes do not always mean rewriting every integration

Caveat: MCP does not auto-solve auth, secrets, or audit. Which servers to allow is still human design.


5. Use Case — Customer Inquiry (Semi-Automation)

Humans still send replies. Agents classify, draft, and check.

5-1. Why multiple agents

AgentJobFour elements
① ClassifyCategory, urgencyBrain (+ memory if needed)
② DraftReply from FAQ/templatesBrain · memory · tools
③ CheckTone, rules, required itemsReflection (+ brain)
flowchart LR
  U["Inquiry"]
  A1["① Classify"]
  A2["② Draft"]
  A3["③ Check"]
  H["Human review & send"]

  U --> A1 --> A2 --> A3 --> H

  classDef agent fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px,color:#1a1a1a
  classDef io fill:#eceff1,stroke:#607d8b,stroke-width:2px,color:#1a1a1a
  class A1,A2,A3 agent
  class U,H io

5-2. Human vs agent

WhoWork
AgentClassify, draft, check
HumanReview, edit, send

Fully auto-reply is out of scope here — wrong-send risk is too high.


6. Mapping the Case to Dify, LangGraph, and MCP

6-1. Comparison table

ElementDifyLangGraphWith MCP
BrainLLM nodesLLM per nodeHost LLM plans/calls
MemoryKnowledge, variablesVector store, StateMCP document/DB server
ToolsBuilt-in, HTTPPython functionsMCP tools
ReflectionCheck LLM nodereview node, retry edgeValidation tools + LLM loop

6-2. Dify (visual — hands-on)

Goal: Run classify → draft → check on screen.

ElementIn Dify
BrainThree LLM nodes
MemoryFAQ knowledge + Knowledge Retrieval node
ToolsHTTP for order lookup (optional at first)
ReflectionCheck node, fix forbidden phrases

Details: Dify build article (Japanese).

Pros: Fast PoC, easy to demo. Cons: Complex retries/API glue often easier in code later.

6-3. LangGraph (code — hands-on)

Goal: Explicit State, nodes for classify / draft / review.

ElementIn LangGraph
BrainPrompt + LLM in each node
MemoryState + FAQ file / retriever
ToolsFunctions called from draft
Reflectionreview; conditional edge back to draft

Details: LangGraph build article (Japanese).

Pros: Retries, logs, API control. Cons: More setup (env, deploy, auth).

6-4. MCP (rewiring memory and tools)

Extract FAQ search and order lookup as MCP servers so both hosts reuse the same tools.

Suggested order:

  1. Run the 3-agent flow in Dify or LangGraph without MCP
  2. Move external I/O (e.g. order lookup) to an MCP server
  3. Call the same MCP from the other host

7. Quick Selection Guide

SituationRecommendation
Nail the business flow firstDify hands-on
Core is internal APIs / retriesLangGraph hands-on
Same tools from multiple hostsMCP for memory/tools
Measure quality like Study NotesSeparate check agent, track pass rate (Part 3)

Summary

  • Chat AI is conversational; agents pursue goals with tools and loops
  • Decompose into brain · memory · tools · reflection to compare products
  • Build visually (Dify / n8n / Copilot Studio) or in code (LangGraph / Agents SDK / LlamaIndex). This series uses Dify and LangGraph
  • MCP standardizes how memory and tools plug in
  • Customer inquiry: classify → draft → check; humans send

Follow-ups with build steps and test results: Dify · LangGraph (Japanese published; English drafts in repo).


コメント