Knowledge Base · Learning paths
AI Fundamentals Explained: From LLM to AI Agent – All Core Concepts Broken Down
From an engineering perspective, this guide thoroughly demystifies the core concepts of AI. It explains how LLMs are essentially next-token predictors, what Tokens, Context, and Prompts really are, how Tools address perception gaps, the role of MCP in standardizing tool use, and how AI Agents achieve autonomous planning with Skills as their rulebook. A must-read to truly understand the underlying logic from large language models to intelligent agents.
Translated from Chinese by AI. Spotted an issue? Use the feedback button.
🔗 Original link: https://x.com/VincentLogic/status/2...
Introduction: New terms are popping up in the AI community every day — LLM, token, context, prompts, tool, MCP, agents, agent skill… Can you really explain the precise meaning of each one? This is a hardcore, engineering-focused breakdown. No fluffy business jargon — only the underlying technical truth. After reading this, your understanding of AI will reach a whole new level.
1. The Foundation: LLM (Large Language Model)
LLM (Large Language Model) is the core engine behind all current AI technologies. Almost every major model on the market today is trained using the Transformer architecture.
-
Historical background: The Transformer architecture was introduced by a Google team in 2017 in the paper Attention Is All You Need. However, it was OpenAI that truly ignited global attention.
-
Key milestones:
- End of 2022: GPT-3.5 emerged as the first large model to truly reach production-ready level.
- March 2023: GPT-4 was released, pushing the ceiling of AI capabilities to a new height.
- Today: The GPT family remains the benchmark, but strong contenders like Claude, Gemini, and others are now competing head-to-head in their respective domains.
At its core, what is a large language model?
Extremely simple: a word-prediction game.
Example: When asked “What do you think of Mark’s video?”, the model will:
- Predict the next highest-probability word: “really”
- Append “really” to the input and predict the next word: “good”
- Continue appending and predicting: “!”
- Eventually output the complete response: “It’s really good!”
This is why large models generate answers one token at a time — it is their most fundamental operating mechanism.
2. The LLM’s “Interpreter”: Token and Tokenizer
Large language models are essentially mathematical functions that only understand numbers, not text. The Tokenizer acts as the translator between humans and the model, handling encoding (text → numbers) and decoding (numbers → text).
The tokenization process:
- Splitting: Break the text into the smallest units (tokens)
- Mapping: Convert each token into a corresponding number (token ID)
Key insight: Token ≠ Word
- Chinese example: “programmer” (programmer) is split into two tokens: “program” + “member”
- English example: “helpful” is split into two tokens: “help” + “ful”
- Extreme cases: A single special character may require 3 tokens to represent
Rule of thumb:
- 1 token ≈ 0.75 English words
- 1 token ≈ 1.5–2 Chinese characters
- 400,000 tokens ≈ 600,000–800,000 Chinese characters (roughly equivalent to a thick book)
3. Temporary Memory: Context and Context Window
Context = The total amount of information a large model receives when handling a task, including:
- The user’s current question
- Conversation history
- Tokens currently being generated
- Tool lists
- System prompt, etc.
Context Window = The maximum number of tokens the Context can hold.
- GPT-4.5: 1.05 million tokens
- Claude 3.1 Pro: 1 million tokens
- Cloudopus 4.6: 1 million tokens
1 million tokens ≈ 1.5 million Chinese characters — enough to fit the entire Harry Potter series.
When dealing with a product manual that spans thousands of pages, it’s impossible to feed everything to the model. The solution is RAG (Retrieval-Augmented Generation):
- Retrieve the most relevant passages from the document based on the question
- Send only those relevant segments to the model
- This overcomes the context window limitation while keeping costs under control.
IV. The Art of Instruction: Prompt Engineering
Prompt = A specific question or instruction given to a large language model (LLM)
- User Prompt: The question or input from the user (e.g., "Write a poem for me")
- System Prompt: The persona and rules configured by the developer (invisible to the user)
Case Comparison:
Vague Prompt: "Write a poem for me" → May generate modern poetry, doggerel, or anything else that doesn’t meet expectations
Precise Prompt: "Please write a five-character quatrain (wuyan jueju) about autumn leaves, in a bright and uplifting tone" → The generated content precisely matches the requirements
The Power of System Prompt:
Configuration: "You are a patient mathematics teacher. Do not give the answer directly; instead, guide the student to think."
When a student asks "What is 3+5?", the model responds: "Let’s think about it this way: You have 3 apples in your hand, and you pick up 5 more. How many apples do you have now? Try counting them."
Instead of simply answering "8".
Industry Reality: Prompt Engineering was once extremely popular, but fewer and fewer people talk about it now. There are two main reasons:
- The barrier is too low — it essentially boils down to “saying things clearly.”
- Models have become much stronger — even with vague prompts, they can often infer the user’s true intent.
V. The Key to Perceiving the World: Tools and MCP
The fatal weakness of large language models: They cannot perceive the external environment.
When asked, “What’s the weather like in Shanghai today?”, the model will reply: “Sorry, I cannot access real-time weather information.”
Solution: Tools
- A Tool is essentially a function: it takes input parameters → performs an operation → returns a result.
- Example: A weather query tool accepts (city + date) → calls a meteorological API → returns weather data.
Complete Workflow:
- The user’s question is sent to the platform (the intermediary).
- The platform forwards the question along with a list of available tools to the large language model.
- The model analyzes the request and generates a tool-calling instruction.
- The platform executes the corresponding tool.
- The tool returns the result to the platform.
- The platform sends the result back to the large language model.
- The model synthesizes the information and responds to the user in natural language.
Division of Roles:
- Large Language Model: Selects the appropriate tools and summarizes the results
- Tools: Execute specific operations
- Platform: Orchestrates the entire process
Pain Point: Every platform has its own tool specification.
- ChatGPT requires integration according to OpenAI’s standards
- Claude requires integration according to Anthropic’s standards
- Gemini requires integration according to Google’s standards
→ The same tool must be implemented three times with different code.
The Ultimate Solution: MCP (Model Context Protocol)
- Full name: Model Context Protocol
- Essence: A unified standard for tool integration
- Value: Tool developers only need to write code once according to the MCP specification, and it can then be used across all platforms that support MCP — similar to how all phones now use the unified Type-C interface.
VI. Autonomous AI Agents: Agent and Agent Skill
Agent = A system capable of autonomously planning, calling tools, and working continuously until a task is completed.
Complex Task Example: “What’s the weather like where I am today? Also help me find nearby stores that sell umbrellas.”
Agent Workflow:
- Call the location tool to obtain latitude and longitude
- Call the weather tool to check current conditions
- Based on the weather result (e.g., rain), call the store search tool to find umbrella shops
- Synthesize all information and deliver the final answer
Pain Point: Personal rules must be repeated every time.
Take a “going out assistant” scenario:
- Take an umbrella if it’s raining, wear a hat if the sun is strong, wear a mask if air quality is poor…
- Require the answer in this format: “First give a summary, then list the items with reasons.”
Solution: Agent Skill
- Essence: Pre-written instruction documents for the Agent (in Markdown format)
- Structure:
- Metadata Layer: Name (
name) + Description (description) - Instruction Layer: Goals, execution steps, decision rules, output format, and examples
- Metadata Layer: Name (
- Create a new folder inside the
.cloudskillsdirectory (folder name = skill name) - Create a
SKILL.mdfile inside the folder (must be uppercase) - Write the complete instruction content
- When the Agent matches the skill, it automatically loads and executes it
Example Outcome: Input: “I’m going out. Tell me what I should bring.”
The Agent will automatically:
- Call the location tool
- Call the weather tool
- Apply the preset rules to determine what items are needed
- Output the result in the specified format
VII. Complete Knowledge System
Core Concept Relationships:
- LLM = Core engine
- Token = Basic unit of data processing
- Context = Temporary memory (measured in tokens)
- Context Window = Maximum capacity of the memory
- Prompt = Specific instructions (divided into User and System types)
- Tool = Functions that allow perception of the external world
- MCP = Unified standard for tool integration
- Agent = A system that performs autonomous planning and tool calling
- Agent Skill = The instruction manual for an Agent
Conclusion: Only by Understanding the Fundamentals Can You Master the Future
Once you truly grasp these underlying principles, new AI products and technologies will no longer feel mysterious:
- Tools like Cloud Code, Codex, and Gemini CLI are all essentially operating within this same framework.
- No matter how the technology evolves, the core principles remain unchanged.
Final Reflection:
Which AI concepts did you previously misunderstand? After reading this article, do you now have a deeper understanding of why large language models work the way they do? Feel free to share your moments of insight and cognitive upgrade in the comments.
Original content. Please cite the source when reposting. The technical details have been verified through practice and are suitable for readers with some foundational knowledge who wish to study in depth.