CourseAgentic AI for Business
ModuleKnowledge and integrations
Duration11 min
Progress0/12
Course material0/12 · 0%
  1. 1How a language model actually works10 min
  2. 2Prompting: turning intent into reliable instructions11 min
  3. 3Choosing your model9 min
  4. 4From chatbot to agent: the reasoning-action loop9 min
  5. 5Tools and function calling11 min
  6. 6Agent design patterns: beyond a single loop11 min
  7. 7Memory and knowledge: grounding agents with RAG11 min
  8. 8Building a knowledge base that retrieves well12 min
  9. 9Connecting to your systems: APIs, webhooks, and MCP10 min
  10. 10Guardrails, evaluation, and cost10 min
  11. 11Deploying an agent on a real workflow10 min
  12. 12Choosing what to automate: an ROI framework10 min

Lesson 7 / 12 · 11 min

Memory and knowledge: grounding agents with RAG

Short-term vs long-term memory, and how retrieval-augmented generation grounds an agent in your own data.

The model knows general things from training, but it does not know your prices, your policies, or last week's orders, and its training has a cutoff date. To be useful, an agent has to be grounded in your specific, current information. This lesson is about how.

Two kinds of memory

Short-term memory is the context window: the current conversation plus whatever you inject for this request. It is precise but small and temporary. Long-term memory is everything outside that, your documents, database rows, past conversations, that you store somewhere and pull from when relevant. The skill is deciding what to load into the limited context for each request.

Retrieval-augmented generation (RAG)

RAG is the standard way to give an agent your knowledge without retraining it. The idea: when a question comes in, find the few most relevant pieces of your own content and paste them into the context, then let the model answer from them. The model stays general, the facts come from you, and you can update the facts any time by changing your documents.

Question
Find similarvector search
Top chunksyour content
Answergrounded in chunks
Offline, once: split your docs into chunks and embed them into a vector store
The RAG pipeline. Chunking and embedding your documents happens once and on updates; the retrieve-and-ground steps run on every question.

Embeddings, in plain terms

An embedding turns a piece of text into a point in space, positioned so that texts with similar meaning sit close together. "What time do you close?" and "opening hours" land near each other even though they share no words. That is why retrieval finds the right chunk by meaning, not keyword matching. Closeness is just distance between those points.

RAG vs fine-tuning

People often ask whether they should fine-tune (retrain) a model on their data. For most businesses the answer is no, use RAG. Fine-tuning is expensive, has to be redone whenever facts change, and is poor at facts anyway, it shapes style and behaviour, not knowledge. RAG is cheap, updates instantly when you edit a document, and lets the agent cite its source. Reach for fine-tuning only when you need a specific tone or format at scale, not to teach facts.

What you take away

  • Short-term memory = context window; long-term = stored data you retrieve
  • RAG: chunk, embed, retrieve by meaning, then ground the answer in your content
  • Embeddings place text by meaning, so retrieval matches intent, not keywords
  • Prefer RAG over fine-tuning for facts; it is cheaper and updates instantly

Curated sources

Hand-picked references for going deeper, reviewed by our team.

Related Etzal serviceAutopilot: AI that runs your operationsPrefer it done for you? See how we help.
Memory and knowledge: grounding agents with RAG - Agentic AI for Business | Etzal Academy | Etzal Group