Năm thuật ngữ AI cần nắmFive AI terms to know

Năm thuật ngữ, ba lớp: cách model nghĩ, những gì nó biết, và việc nó làm được. Five terms, three layers: how a model thinks, what it knows, and what it can do.

Đọc từ dưới lên: mỗi khái niệm dựng trên khái niệm nằm dưới nó. Nét liền là đường đi viết cố định trong code. Nét đứt là quyết định model tự đưa ra lúc chạy.

Read bottom-up: each concept builds on the ones below it. Solid lines are paths fixed in code. Dashed lines are decisions the model makes at runtime.

Three layers: Model (LRM), Knowledge (Vector DB, RAG), Action (MCP, Agentic AI) Hành độngAction Tri thứcKnowledge Mô hìnhModel 05 Agent 04 MCP 03 RAG 02 Vector DB 01 LRM GitHub, DB, file…GitHub, DB, files…
cố định trong codefixed in code model quyết lúc chạydecided at runtime

Chọn cái nàoWhich one do you need

Phần lớn bài toán giải được bằng một lời gọi model thường với prompt tốt. Chỉ thêm một khái niệm khi đo được baseline thất bại, và biết nó thất bại vì khoảng trống nào.

Most problems are solved by one call to a regular model with a good prompt. Add a concept only when you've measured the baseline failing and know which gap caused it.

Trước hết: có thể bạn không cần gì cảFirst: you may need none of this

LRM Không cần khiSkip it whentác vụ là trích xuất, phân loại, tóm tắt, viết lạithe task is extraction, classification, summarizing, rewriting Dùng thayUse insteadmodel thường, prompt rõ, vài ví dụ mẫua regular model, a clear prompt, a few examples
Vector DB Không cần khiSkip it whendưới khoảng 100k vector, ít ghiunder roughly 100k vectors, few writes Dùng thayUse insteadpgvector trong Postgres sẵn có, hoặc FAISS trong RAMpgvector in your existing Postgres, or FAISS in memory
RAG Không cần khiSkip it whentoàn bộ tài liệu vừa context window và ít đổiall documents fit the context window and rarely change Dùng thayUse insteadđưa thẳng vào prompt, bật prompt cachingput them in the prompt, enable prompt caching
MCP Không cần khiSkip it whenmột ứng dụng gọi vài API của chính bạnone app calls a few of your own APIs Dùng thayUse insteadfunction calling trực tiếp trong codeplain function calling in your code
Agentic AI Không cần khiSkip it whencác bước đã biết trước và cố địnhthe steps are known and fixed Dùng thayUse insteadworkflow viết sẵn, LLM xử lý từng bướca scripted workflow, the LLM handles each step

Rồi đi lần lượt, dừng ở câu đầu tiên trả lời "có"Then go in order and stop at the first "yes"

  1. Model thường với prompt tốt đã đạt chưa?Does a regular model with a good prompt already work?

    Đạt thì dừng ở đây. Không thêm gì.

    If yes, stop here. Add nothing.

  2. Sai ở bước suy luận: toán, logic nhiều bước, lập kế hoạch, debug?Does it fail at reasoning: math, multi-step logic, planning, debugging?

    01 LRMBật thinking mode cho riêng loại câu này, rồi đo lại.Turn on thinking mode for just these questions, then measure again.

  3. Thiếu dữ liệu riêng hoặc dữ liệu mới?Is it missing private or recent data?

    03 RAG02 Vector DBVừa context window thì đưa thẳng vào prompt. Lớn hơn thì dùng RAG. Hàng triệu vector và ghi liên tục mới cần vector DB chuyên dụng; còn lại pgvector là đủ.If it fits the context window, put it in the prompt. If not, use RAG. Only millions of vectors with constant writes call for a dedicated vector DB; otherwise pgvector is enough.

  4. Cần tác động ra bên ngoài: đọc, ghi hệ thống, gọi API?Does it need to act on the outside world: read, write, call APIs?

    05 Agent04 MCPBước biết trước thì viết workflow cố định với tool calling. Không biết trước thì dùng agent, có giới hạn bước và người duyệt. Tool cần dùng lại ở nhiều host thì đóng gói thành MCP server.Known steps get a fixed workflow with tool calling. Unknown steps get an agent with step limits and human approval. Tools reused across hosts get packaged as an MCP server.

Năm khái niệmThe five concepts

Sắp theo quan hệ phụ thuộc, từ lớp mô hình lên lớp hành động. Ô màu là câu đánh đổi: đọc nó trước, chi tiết sau.

Ordered by dependency, from the model layer up to the action layer. The tinted box is the trade-off: read it first, details after.

01

Large Reasoning Model

Lớp mô hìnhModel layer

LLM được huấn luyện để sinh chuỗi suy luận dài, tự kiểm và sửa sai trước khi trả lời.

An LLM trained to produce a long chain of reasoning, checking and correcting itself before it answers.

Dấu hiệu:Signal: model thường trả lời nhanh, tự tin, nhưng sai ở bước trung gian.a regular model answers fast and confidently but gets a middle step wrong.

Đánh đổiTrade-offĐổi độ trễ và chi phí token lấy độ chính xác trên bài toán nhiều bước.Trade latency and token cost for accuracy on multi-step problems.

Dùng cho
Use for
Toán, logic nhiều bước, gỡ lỗi khó, lập kế hoạch, đối chiếu tài liệu phức tạp.Math, multi-step logic, hard debugging, planning, cross-checking complex documents.
Được
Gain
Chính xác hơn rõ rệt trên bài toán nhiều bước. Một tham số effort để đổi chi phí lấy chất lượng.Clearly more accurate on multi-step problems. One effort knob trades cost for quality.
Mất
Lose
Chậm từ vài giây tới vài phút. Token suy luận bị ẩn vẫn tính tiền. Thừa cho việc đơn giản.Seconds to minutes per answer. Hidden reasoning tokens are still billed. Overkill for simple tasks.
Ví dụ
Examples
OpenAI o3, o4-mini, DeepSeek-R1, chế độ thinking của Claude và Gemini.OpenAI o3, o4-mini, DeepSeek-R1, thinking modes in Claude and Gemini.
02

Vector Database

Lớp tri thứcKnowledge layer

Kho lưu embedding, trả lời nhanh câu hỏi: k phần tử nào gần vector này nhất?

A store for embeddings that quickly answers one question: which k items are closest to this vector?

Dấu hiệu:Signal: người dùng tìm theo ý, không theo từ khoá chính xác.users search by intent, not by exact keywords.

Đánh đổiTrade-offĐổi thêm một hệ thống phải vận hành và đồng bộ lấy khả năng tìm theo nghĩa ở quy mô lớn.Trade one more system to operate and sync for semantic search at scale.

Dùng cho
Use for
Tìm kiếm ngữ nghĩa, tầng truy xuất cho RAG, gợi ý nội dung tương tự, tìm ảnh bằng mô tả chữ.Semantic search, the retrieval layer for RAG, similar-item recommendations, finding images from text.
Được
Gain
Tìm theo nghĩa thay vì từ khoá. Vài mili giây trên hàng triệu vector nhờ index ANN.Search by meaning, not keywords. Milliseconds over millions of vectors thanks to ANN indexes.
Mất
Lose
Kém với mã, số hiệu, câu phủ định. Lệch nguồn nếu quên đồng bộ. Đổi embedding model là phải tạo lại embedding cho toàn bộ.Weak on codes, identifiers, negation. Drifts from the source if sync slips. A new embedding model means re-embedding everything.
Ví dụ
Examples
Pinecone, Weaviate, Milvus, Qdrant, pgvector.
03

Retrieval-Augmented Generation

Lớp tri thứcKnowledge layer

Tìm đoạn liên quan trong dữ liệu của bạn, đưa vào prompt, để model trả lời bám tài liệu và có nguồn.

Find relevant passages in your data, put them in the prompt, and let the model answer from them with citations.

Dấu hiệu:Signal: đáp án nằm trong dữ liệu của bạn, và dữ liệu đó lớn hơn context window hoặc đổi thường xuyên.the answer lives in your data, and that data exceeds the context window or changes often.

Đánh đổiTrade-offĐổi một pipeline truy xuất phải đánh giá liên tục lấy câu trả lời bám dữ liệu riêng, mới và có nguồn.Trade a retrieval pipeline you must keep evaluating for answers grounded in private, current, cited data.

Dùng cho
Use for
Chatbot tài liệu nội bộ, hỗ trợ khách hàng theo chính sách hiện hành, hỏi đáp pháp lý cần trích dẫn.Internal-docs chatbots, support that follows current policy, legal Q&A that needs citations.
Được
Gain
Dùng dữ liệu riêng và mới mà không cần fine-tune. Có trích nguồn để tự kiểm chứng.Private and recent data without fine-tuning. Citations users can verify.
Mất
Lose
Tìm sai là trả lời sai. Nhiều khâu, khó gỡ lỗi. Kém với câu hỏi tổng hợp toàn kho, việc đó để SQL.Wrong retrieval, wrong answer. Many stages, hard to debug. Weak at corpus-wide aggregates; that's SQL's job.
Ví dụ
Examples
ChatGPT với file đính kèm, Perplexity, NotebookLM.ChatGPT with files, Perplexity, NotebookLM.
04

Model Context Protocol

Lớp hành độngAction layer

Giao thức mở để ứng dụng AI kết nối tool và dữ liệu theo một chuẩn chung. Mỗi client nằm trong host, nối một–một với một server.

An open protocol for connecting AI apps to tools and data through one standard. Each client lives inside the host and pairs one-to-one with a server.

Dấu hiệu:Signal: cùng một tích hợp đang bị viết lại cho từng ứng dụng AI.the same integration is being rewritten for every AI app.

Đánh đổiTrade-offĐổi thêm một lớp giao thức và bề mặt bảo mật mới lấy tích hợp viết một lần, dùng ở mọi host.Trade an extra protocol layer and a new security surface for integrations written once and used in every host.

Dùng cho
Use for
Cho Claude, Cursor, VS Code dùng GitHub, Slack, database. Mở hệ thống nội bộ cho nhiều công cụ AI.Letting Claude, Cursor or VS Code use GitHub, Slack, databases. Exposing internal systems to many AI tools.
Được
Gain
N×M bản tích hợp thành N+M. Đổi model hay host không phải viết lại.N×M integrations become N+M. Switching models or hosts needs no rewrite.
Mất
Lose
Prompt injection qua kết quả tool, server bên thứ ba độc hại. Quá nhiều tool làm model chọn sai.Prompt injection via tool output, malicious third-party servers. Too many tools lead to wrong picks.
Ví dụ
Examples
Claude Desktop, Claude Code, Cursor, VS Code.
05

Agentic AI

Lớp hành độngAction layer

LLM tự chọn bước tiếp theo trong vòng lặp quan sát, hành động, quan sát cho tới khi đạt mục tiêu.

The LLM picks its own next step in an observe, act, observe loop until the goal is met.

Dấu hiệu:Signal: không viết trước được các bước, nhưng kiểm tra được kết quả cuối.you can't script the steps, but you can check the final result.

Đánh đổiTrade-offĐổi khả năng dự đoán và kiểm soát lấy sự linh hoạt trước tác vụ không viết trước được các bước.Trade predictability and control for flexibility on tasks whose steps can't be scripted.

Dùng cho
Use for
Coding agent, nghiên cứu nhiều bước, điều tra sự cố, thao tác trình duyệt khi không có API.Coding agents, multi-step research, incident investigation, browser tasks with no API.
Được
Gain
Giải tác vụ mở mà workflow không liệt kê hết nhánh. Tự sửa khi thấy test thất bại.Handles open-ended tasks no workflow can enumerate. Self-corrects when a test fails.
Mất
Lose
Lỗi cộng dồn: đúng 95% mỗi bước thì 20 bước chỉ còn khoảng 36%. Chi phí khó đoán. Hành động sai có hậu quả thật.Errors compound: 95% per step leaves about 36% after 20 steps. Unpredictable cost. Wrong actions have real consequences.
Ví dụ
Examples
Claude Code, Devin, Cursor agent.

Bảng đánh đổiTrade-off table

LRMVector DBRAGMCPAgentic AI
Lấp khoảng trốngGap it fills Nghĩ chưa đủ kỹShallow thinkingTìm theo nghĩa ở quy mô lớnSemantic search at scaleThiếu dữ liệu riêng, mớiMissing private or recent dataKết nối tool thiếu chuẩnNon-standard tool wiringKhông tự hành động nhiều bướcCan't act over many steps
Chi phí thêmExtra cost CaoHighThấpLowTrung bìnhMediumThấpLowCao, khó đoánHigh, unpredictable
Độ trễ thêmAdded latency Giây → phútSeconds → minutesMili giâyMilliseconds100 ms → vài giây100 ms → secondsTuỳ toolDepends on toolPhút → giờMinutes → hours
Dự đoán đượcPredictability Trung bìnhMediumCaoHighTrung bìnhMediumCaoHighThấpLow
Độ khó vận hànhOps difficulty Thấp, một tham sốLow, one knobTrung bìnhMediumCao, nhiều khâuHigh, many stagesTrung bình, bảo mậtMedium, securityCaoHigh
Rủi ro chínhMain risk Trả tiền cho việc không cần nghĩPaying for unneeded thinkingIndex lệch nguồnIndex drifts from sourceTruy xuất trượtMissed retrievalPrompt injection, quyền rộngPrompt injection, broad accessLỗi cộng dồn, hành động saiCompounding errors, wrong actions

Anti-patterns

Sai lầmMistakeVì sao saiWhy it's wrongSửa thế nàoFix
Dựng RAG cho 50 trang tài liệuBuilding RAG for 50 pagesThêm pipeline và điểm hỏng khi cả bộ vừa contextAdds a pipeline and failure points when it all fits in contextĐưa thẳng vào prompt, bật cachingPut it in the prompt, enable caching
Dùng LRM cho mọi requestUsing an LRM for every requestTrả tiền suy luận cho việc phân loại, trích xuấtPaying for reasoning on classification and extractionRouter: câu dễ cho model thườngRoute easy questions to a regular model
Mua vector DB trước khi có bộ đánh giáBuying a vector DB before an eval setKhông biết tốt lên hay tệ điYou can't tell better from worse50–100 câu hỏi chuẩn trước, hạ tầng sau50–100 reference questions first, infrastructure later
Chỉ dùng vector searchVector search onlyTrượt mã sản phẩm, tên riêng, số hiệuMisses product codes, names, identifiersHybrid BM25 + vector, thêm rerankHybrid BM25 + vector, plus reranking
Lọc quyền sau khi lấy top-kFiltering permissions after top-kThiếu kết quả, có thể lọt dữ liệuMissing results, possible data leaksLọc metadata ngay trong truy vấnFilter on metadata inside the query
Bọc nguyên REST API thành MCP toolWrapping a REST API one-to-one as MCP toolsHàng trăm tool, model chọn saiHundreds of tools, wrong picksÍt tool, mỗi tool một tác vụ rõFew tools, one clear task each
Cài MCP server lạ, cấp toàn quyềnUnknown MCP servers with full accessServer hoặc kết quả trả về có thể tiêm lệnhServer or its output can inject instructionsNguồn tin cậy, ghim version, mặc định chỉ đọcTrusted sources, pinned versions, read-only by default
Gọi mọi thứ là agentCalling everything an agentBiến workflow cố định thành vòng lặp khó kiểm soátTurns a fixed workflow into an uncontrolled loopBước biết trước thì viết bằng codeWrite known steps as code
Agent không giới hạn, không tự kiểmAgents without limits or checksLặp không dừng, đốt tiền, báo xong khi chưa xongLoops, burns money, reports done when it isn'tMax step, max cost; test làm điều kiện dừngMax steps, max cost; tests as the stop condition

3 câu cần nhớ3 things to remember

  1. Mọi thứ model biết lúc chạy đến từ trọng số hoặc context: RAG lo phần context, LRM lo phần suy nghĩ, MCP và agent lo phần hành động.Everything a model knows at runtime comes from its weights or its context: RAG handles the context, an LRM handles the thinking, MCP and agents handle the acting.
  2. Bắt đầu từ model thường với prompt tốt, và chỉ thêm một khái niệm khi đo được baseline thất bại vì đúng khoảng trống khái niệm đó lấp.Start with a regular model and a good prompt, and add a concept only when you've measured the baseline failing on exactly the gap it fills.
  3. Độ tin cậy được quyết định ở khâu kiểm chứng: đánh giá bước truy xuất, test cho agent, xác nhận trước thao tác ghi. Không phải ở việc chọn model mạnh nhất.Reliability is decided at verification: retrieval evals, tests for agents, confirmation before writes. Not by picking the strongest model.