Skip to contentমূল লেখায় যান

Topic 05 · Agent memoryটপিক 05 · Agent memory

Retrieval Memory

Retrieval memory is a store outside the model that an agent searches when it needs a fact. The agent copies the search results into its context, and then it answers. For a tester, this memory is a search system with its own bugs: wrong results, old results, or results from the wrong user.

7 min read7 মিনিটে পড়া যায় · 7 sections7টি সেকশন · 6 sources6টি সোর্স · updated Nov 2026আপডেট: Nov 2026

Search, then answerআগে খোঁজা, তারপর উত্তর

Follow a question through retriever, store and context, and see a key document get buried.একটা প্রশ্ন রিট্রিভার, স্টোর আর কনটেক্সটের ভেতর দিয়ে অনুসরণ করুন, আর দেখুন একটা মূল ডকুমেন্ট চাপা পড়ে যায়।

2 min2 মিনিট7 steps7টি ধাপ
  • Results in contextকনটেক্সটে রেজাল্ট3 / 8
  • Docs in storeস্টোরে ডক8
userব্যবহারকারীexport as CSV?CSV export কীভাবে?Retrieverরিট্রিভারStoreস্টোরModelমডেলcontextকনটেক্সট?

You’ll learnআপনি শিখবেন

  • The loop: question, retriever, store, modelলুপ: প্রশ্ন, রিট্রিভার, স্টোর, মডেল
  • Context = question + ranked resultsকনটেক্সট = প্রশ্ন + র‍্যাঙ্ক করা রেজাল্ট
  • Edit the store, no new trainingস্টোর বদলান, নতুন ট্রেনিং ছাড়াই
  • Why more results can hide the key docবেশি রেজাল্টে কেন মূল ডক হারায়

In plain words

A language model has knowledge in its weights. It can also use a second memory: a store of documents that a retriever searches Source 1সোর্স 1. Lewis et al. call the weights "parametric memory" and the searched store "non-parametric memory" Source 1সোর্স 1. This page calls the searched store retrieval memory.

You can change the knowledge in the store directly. You can also see which items the model used Source 1সোর্স 1. Thus you can update the knowledge without a new training run Source 1সোর্স 1. See parametric memory.

The 7 memory names of this module follow the infographic "7 Types of Agent Memory". Research papers group memory differently. CoALA has working memory and three long-term memories: episodic, semantic, and procedural Source 2সোর্স 2. Retrieval is not one of them. It is an action that reads from them Source 2সোর্স 2.

সহজ English

A language model keeps some knowledge inside the model itself. It can also look things up in a separate store of documents Source 1সোর্স 1. One research paper calls the first kind "parametric memory" and the store "non-parametric memory" Source 1সোর্স 1. On this page, the store is called retrieval memory.

You can edit the store directly. You can also see which documents the model used Source 1সোর্স 1. So you can update what the model knows without training it again Source 1সোর্স 1.

The 7 names in this module come from the infographic "7 Types of Agent Memory". Research papers use other groups. CoALA has working memory and three long-term memories: episodic, semantic, and procedural Source 2সোর্স 2. In CoALA, retrieval is an action that reads from these memories, not a memory of its own Source 2সোর্স 2.

বাংলা ব্যাখ্যা

একটা language model-এর কিছু জ্ঞান তার weights-এর ভেতরে থাকে। এর পাশাপাশি সে আলাদা একটা document store-ও ব্যবহার করতে পারে, যেটা একটা retriever খোঁজে Source 1সোর্স 1। Lewis et al. weights-কে বলেন "parametric memory", আর খোঁজার store-কে বলেন "non-parametric memory" Source 1সোর্স 1। এই পেজে ওই store-কে retrieval memory বলা হয়েছে।

আপনি store-এর জ্ঞান সরাসরি বদলাতে পারেন। model কোন item ব্যবহার করল, সেটাও আপনি দেখতে পারেন Source 1সোর্স 1। তাই নতুন training ছাড়াই জ্ঞান update করা যায় Source 1সোর্স 1।

এই module-এর ৭টা memory-র নাম infographic "7 Types of Agent Memory" থেকে নেওয়া। research paper-গুলো memory-কে অন্যভাবে ভাগ করে। CoALA-তে আছে working memory আর তিনটা long-term memory: episodic, semantic, আর procedural Source 2সোর্স 2। CoALA-তে retrieval আলাদা কোনো memory নয়। এটা একটা action, যেটা ওই memory-গুলো থেকে পড়ে Source 2সোর্স 2।

Where it comes from

"Retrieval memory" is the infographic's own name. The sources of this page do not define a psychology memory type or an agent memory type with that name. Tutorial's own view: the infographic uses the name for the external store that the agent searches.

In AI, the idea comes from retrieval-augmented generation (RAG). Lewis et al. describe hybrid models that combine parametric memory with retrieval-based memory Source 1সোর্স 1. In their RAG models, the store is a dense vector index of Wikipedia, and a pre-trained neural retriever reads it Source 1সোর্স 1.

CoALA uses different words. A retrieval action reads information from long-term memory into working memory Source 2সোর্স 2. CoALA counts a RAG document collection as semantic memory, as a store of unstructured text Source 2সোর্স 2. So a reader of CoALA finds the same mechanism under the names "retrieval action" and "semantic memory". See semantic memory and working memory.

MemGPT gives an operating-system view. It moves data between the main context and external storage, like an operating system that pages between memory and disk Source 3সোর্স 3. The main context is the context window. One part of the external storage is "archival storage", a read/write database of text Source 3সোর্স 3.

সহজ English

"Retrieval memory" is a name from the infographic. The sources of this page do not use this name for a type of human memory or of agent memory. Tutorial's own view: the infographic uses the name for the store that the agent searches.

In AI, the idea comes from retrieval-augmented generation (RAG). Lewis et al. mix the memory inside the model with a memory that the model searches Source 1সোর্স 1. In their system, the store is a vector index of Wikipedia, and a trained retriever searches it Source 1সোর্স 1.

CoALA uses other words. A retrieval action copies information from long-term memory into working memory Source 2সোর্স 2. CoALA calls a RAG document collection semantic memory Source 2সোর্স 2. So it is the same idea with other names.

MemGPT compares the agent to an operating system. It moves data between a small main context and a large external storage Source 3সোর্স 3. The main context is the context window. One part of the external storage is "archival storage", a database of text that the agent can read and write Source 3সোর্স 3.

বাংলা ব্যাখ্যা

"Retrieval memory" নামটা infographic-এর নিজের। এই পেজের source-গুলো এই নামে মানুষের বা agent-এর কোনো memory type সংজ্ঞায়িত করে না। Tutorial-এর নিজের মত: agent যে বাইরের store খোঁজে, infographic সেটাকেই এই নাম দিয়েছে।

AI-তে ধারণাটা এসেছে retrieval-augmented generation (RAG) থেকে। Lewis et al. model-এর ভেতরের memory আর খোঁজার memory একসাথে ব্যবহার করেন Source 1সোর্স 1। তাঁদের RAG model-এ store হলো Wikipedia-র একটা dense vector index, আর একটা pre-trained neural retriever সেটা পড়ে Source 1সোর্স 1।

CoALA অন্য শব্দ ব্যবহার করে। একটা retrieval action long-term memory থেকে তথ্য working memory-তে আনে Source 2সোর্স 2। CoALA একটা RAG document collection-কে semantic memory ধরে Source 2সোর্স 2। মানে একই কৌশল, শুধু নাম আলাদা।

MemGPT agent-কে একটা operating system-এর মতো দেখে। এটা main context আর external storage-এর মধ্যে data সরায়, যেমন operating system memory আর disk-এর মধ্যে paging করে Source 3সোর্স 3। main context হলো context window। external storage-এর একটা অংশ "archival storage", text-এর একটা read/write database Source 3সোর্স 3।

How an agent gets it

The agent does not get this memory from training. It gets it from a search at run time. The loop has these steps:

question ──► retriever ──► store (index of documents or facts)
                │
                ▼
        top results (ranked)
                │
                ▼
   context = question + results ──► model ──► answer

The search can use rules, keyword (sparse) search, or vector (dense) search Source 2সোর্স 2. The choice depends on the information and the memory type Source 2সোর্স 2.

In MemGPT, the model itself starts the search. It calls a function on archival storage, and the search results come into the main context page by page Source 3সোর্স 3. Thus the model decides when to look something up.

The agent can also write to the store. Memory-augmented agents can read and write their own content, not only text that people wrote Source 2সোর্স 2. MemGPT's archival storage is also read/write Source 3সোর্স 3.

A product API can wrap the same loop. For example, the Telnyx Agent Memory API has a "recall" endpoint that returns ranked facts for a question Source 4সোর্স 4. It also has namespaces (a separate store per application or environment) and profiles (who each memory is about, for example a customer) Source 4সোর্স 4.

সহজ English

The agent does not learn this memory in training. It looks things up while it runs. The loop is: the question goes to a retriever, the retriever searches the store, the best results come back, and the model reads the question and the results together.

The search can follow fixed rules, match keywords, or compare vectors Source 2সোর্স 2. Which one you use depends on the data and the memory type Source 2সোর্স 2.

In MemGPT, the model decides to search. It calls a function, and the results come into its context one page at a time Source 3সোর্স 3.

The agent can also save new items in the store, not only read text that people wrote Source 2সোর্স 2. MemGPT's archival storage can also be read and written Source 3সোর্স 3.

Products can offer the same loop as an API. One example is Telnyx Agent Memory: it has a "recall" call that returns ranked facts for a question Source 4সোর্স 4. It has namespaces for separate applications or environments, and profiles for who each memory is about Source 4সোর্স 4.

বাংলা ব্যাখ্যা

agent এই memory training থেকে পায় না। চলার সময় search করে পায়। loop-টা এরকম: প্রশ্ন যায় retriever-এর কাছে, retriever store খোঁজে, সেরা result-গুলো ফেরত আসে, তারপর model প্রশ্ন আর result একসাথে পড়ে উত্তর দেয়।

search হতে পারে rule-based, keyword (sparse) search, অথবা vector (dense) search Source 2সোর্স 2। কোনটা ব্যবহার হবে, সেটা তথ্য আর memory type-এর ওপর নির্ভর করে Source 2সোর্স 2।

MemGPT-তে model নিজেই search শুরু করে। সে archival storage-এ একটা function call করে, আর result-গুলো পাতা ধরে ধরে main context-এ আসে Source 3সোর্স 3।

agent store-এ লিখতেও পারে। মানুষের লেখা text ছাড়াও সে নিজের তৈরি content পড়তে ও লিখতে পারে Source 2সোর্স 2। MemGPT-র archival storage-ও read/write Source 3সোর্স 3।

একটা product API-ও এই loop দিতে পারে। যেমন Telnyx Agent Memory-র একটা "recall" endpoint আছে, যেটা একটা প্রশ্নের জন্য ranked fact ফেরত দেয় Source 4সোর্স 4। প্রতিটা application বা environment-এর জন্য আলাদা store (namespace) থাকে, আর memory কার সম্পর্কে তার জন্য profile থাকে Source 4সোর্স 4।

A real-life example

This example is the tutorial's own illustration. It is not from a source.

A team has a support chatbot for its test management tool. The help articles are in a vector store. A user asks: "How do I export a test run as CSV?" The retriever finds the two closest articles. The bot puts them into the context and writes the answer. The answer names the article that it used.

Next week, the export menu moves. A writer changes one help article. The bot gives the new steps at once, with no new training. This is the update property of non-parametric memory Source 1সোর্স 1.

Then the team adds a "remember this" feature. The bot saves a note per customer, for example "uses the Jira plugin". Now the bot writes to the store as well as reads from it Source 2সোর্স 2. Each customer's notes must stay in that customer's store. In Telnyx Agent Memory, a profile per customer holds who the memories are about; a namespace separates your own applications or environments Source 4সোর্স 4.

সহজ English

This example is the tutorial's own. It is not from a source.

A team has a support chatbot for its test management tool. The help articles are in a vector store. A user asks how to export a test run as CSV. The search finds the two best articles. The bot reads them and answers, and it says which article it used.

Next week, the export menu moves. A writer edits one article. The bot gives the new steps right away, with no new training Source 1সোর্স 1.

Then the team lets the bot save notes about each customer. Now the bot writes to the store too Source 2সোর্স 2. Each customer's notes must stay apart from other customers' notes. In Telnyx Agent Memory, a profile per customer holds who the memories are about, and a namespace separates applications or environments Source 4সোর্স 4.

বাংলা ব্যাখ্যা

এই উদাহরণটা tutorial-এর নিজের। এটা কোনো source থেকে নেওয়া নয়।

একটা টিমের test management tool-এর জন্য একটা support chatbot আছে। help article-গুলো একটা vector store-এ রাখা। একজন user জিজ্ঞেস করলেন, একটা test run কীভাবে CSV হিসেবে export করবেন। retriever সবচেয়ে কাছের দুটো article খুঁজে পায়। bot সেগুলো context-এ নিয়ে উত্তর লেখে, আর কোন article ব্যবহার করল তা জানায়।

পরের সপ্তাহে export menu অন্য জায়গায় সরে যায়। একজন writer একটা article বদলান। নতুন training ছাড়াই bot সঙ্গে সঙ্গে নতুন ধাপগুলো বলে Source 1সোর্স 1।

এরপর টিম bot-কে প্রতিটা customer-এর জন্য note রাখার সুযোগ দেয়। এখন bot store-এ লেখেও Source 2সোর্স 2। এক customer-এর note অন্য customer-এর note থেকে আলাদা থাকতে হবে। Telnyx Agent Memory-তে প্রতিটা customer-এর জন্য একটা profile থাকে, যা memory কার সম্পর্কে তা ধরে রাখে, আর namespace আলাদা application বা environment আলাদা রাখে Source 4সোর্স 4।

Common mistakes

Retrieval is a cure for hallucination. It helps, but it is not a guarantee. In the RAG study, RAG models hallucinated less than the baseline model without retrieval Source 1সোর্স 1. "Less" is not "never".

The right item is always found. In the Generative Agents study, a common error was that the agent did not retrieve the relevant memories Source 5সোর্স 5. The agents also sometimes added false details to their memories Source 5সোর্স 5.

More results give a better answer. Models use information at the start or end of a long input best. Performance drops when the relevant item is in the middle Source 6সোর্স 6. A long list of retrieved items can hide the one that matters.

A write is visible at once. It may not be. In the Telnyx API, a memory cannot be recalled until its write operation completes. A read just after the write does not see it yet Source 4সোর্স 4. Telnyx Agent Memory is one product, so check this behavior in the system that you test.

One store for everyone. Without a boundary, one user's data can come back in another user's answer. Separate profiles per user keep one user's memories apart; namespaces separate applications or environments Source 4সোর্স 4.

সহজ English

"Search stops all made-up answers." It helps, but it does not stop them all. In the RAG study, models with search made up fewer facts than the model without search Source 1সোর্স 1. Fewer is not zero.

"The right item is always found." In the Generative Agents study, a common error was that the agent did not find the memory that it needed Source 5সোর্স 5. It also sometimes added false details Source 5সোর্স 5.

"More results are better." Models use the start and the end of a long input best. They do worse when the important part is in the middle Source 6সোর্স 6. Many results can hide the one that counts.

"A save shows up at once." In the Telnyx API, you cannot recall a memory until the save is complete. If you save and read right away, you do not see it yet Source 4সোর্স 4. Check this in your own system.

"One store for all users." Then one user's data can show up for another user. Separate profiles per user keep one user's memories apart; namespaces separate applications or environments Source 4সোর্স 4.

বাংলা ব্যাখ্যা

"Retrieval থাকলে hallucination হয় না।" এটা সাহায্য করে, কিন্তু নিশ্চয়তা দেয় না। RAG study-তে RAG model-গুলো retrieval ছাড়া baseline model-এর চেয়ে কম hallucinate করেছে Source 1সোর্স 1। কম মানে শূন্য নয়।

"সঠিক item সবসময় পাওয়া যায়।" Generative Agents study-তে একটা সাধারণ ভুল ছিল, agent দরকারি memory খুঁজে পায়নি Source 5সোর্স 5। কখনো কখনো agent memory-তে মিথ্যা detail-ও যোগ করেছে Source 5সোর্স 5।

"বেশি result মানে ভালো উত্তর।" লম্বা input-এর শুরু বা শেষের তথ্য model সবচেয়ে ভালো ব্যবহার করে। দরকারি তথ্য মাঝখানে থাকলে performance কমে যায় Source 6সোর্স 6। অনেক result-এর ভিড়ে আসল result-টা হারিয়ে যেতে পারে।

"লেখার সঙ্গে সঙ্গে দেখা যায়।" Telnyx API-তে write operation শেষ না হওয়া পর্যন্ত memory recall করা যায় না। লিখেই সঙ্গে সঙ্গে পড়লে আপনি সেটা এখনো দেখবেন না Source 4সোর্স 4। আপনি যে system test করছেন, সেখানে এটা যাচাই করুন।

"সবার জন্য একটা store।" boundary না থাকলে এক user-এর data অন্য user-এর উত্তরে চলে আসতে পারে। প্রতিটা user-এর জন্য আলাদা profile এক user-এর memory আলাদা রাখে; namespace আলাদা application বা environment আলাদা রাখে Source 4সোর্স 4।

What a tester can check

Treat the retriever and the store as a system under test, apart from the model.

Tutorial advice

  • Ask a question whose answer is only in the store. Check that the answer names the right document.
  • Change one document. Ask again, and check that the answer uses the new text.
  • Ask a question with no answer in the store. Check that the agent says so and does not invent an answer.
  • Write a memory and read it at once. Then read it again after the write completes. Record when it becomes visible.
  • Sign in as two tenants. Check that one tenant cannot retrieve the data of the other.
  • Put the key document among many similar ones. Check that the answer still uses it.

সহজ English

Test the search and the store on their own, not only the final answer.

Tutorial advice

  • Ask something that only the store knows. Check that the answer points to the right document.
  • Edit one document. Ask again and check for the new text.
  • Ask something that the store does not know. Check that the agent says it does not know.
  • Save a memory and read it at once, then read it again later. Note when it shows up.
  • Use two customer accounts. Check that one cannot see the other's data.
  • Hide the key document among many similar ones. Check that the answer still uses it.

বাংলা ব্যাখ্যা

শুধু শেষ উত্তর নয়, retriever আর store-কেও আলাদা একটা system হিসেবে test করুন।

Tutorial advice

  • এমন প্রশ্ন করুন যার উত্তর শুধু store-এ আছে। উত্তরে সঠিক document-এর নাম আছে কি না দেখুন।
  • একটা document বদলান। আবার প্রশ্ন করুন, উত্তরে নতুন text এসেছে কি না দেখুন।
  • এমন প্রশ্ন করুন যার উত্তর store-এ নেই। agent সেটা স্বীকার করে কি না, নাকি উত্তর বানায়, দেখুন।
  • একটা memory লিখে সঙ্গে সঙ্গে পড়ুন, তারপর write শেষ হওয়ার পর আবার পড়ুন। কখন দেখা যায়, লিখে রাখুন।
  • দুটো tenant হিসেবে sign in করুন। এক tenant অন্যের data retrieve করতে পারে না, তা যাচাই করুন।
  • মূল document-টা অনেক একই রকম document-এর মধ্যে রাখুন। উত্তর তবুও সেটা ব্যবহার করে কি না দেখুন।

Key words

TermMeaning
Retrieval memoryThe infographic's name for an external store that an agent searches at run time
Non-parametric memoryThe term of Lewis et al. for a retrieval-based memory outside the model weights
Parametric memoryKnowledge that is stored in the model weights
RAGRetrieval-augmented generation: the model answers with the help of retrieved documents
RetrieverThe part that searches the store and returns the best matches
Vector indexA store that finds items by the closeness of their vectors (dense retrieval)
Retrieval actionCoALA's term for reading from long-term memory into working memory
Archival storageMemGPT's read/write database of text outside the main context
NamespaceIn the Telnyx API, a separate memory store per application or environment

Reels on this topicএই টপিকের রিলস

Short videos from other creators, picked for this topic. They are not part of this page's fact-checked text. Nothing loads from YouTube until you press Play.অন্য ক্রিয়েটরদের বানানো ছোট ভিডিও, এই টপিকের জন্য বাছাই করা। এগুলো এই পেজের ফ্যাক্ট-চেক করা লেখার অংশ নয়। চালান বাটন চাপার আগে YouTube থেকে কিছুই লোড হয় না।

  1. [1]
    Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks, Lewis et al.

    arXiv 2005.11401 (NeurIPS 2020) · accessed 2026-10-28দেখা হয়েছে: 2026-10-28

  2. [2]
    Cognitive Architectures for Language Agents (CoALA), Sumers, Yao, Narasimhan, Griffiths

    arXiv 2309.02427 (TMLR) · accessed 2026-10-28দেখা হয়েছে: 2026-10-28

  3. [3]
    MemGPT: Towards LLMs as Operating Systems, Packer et al.

    arXiv 2310.08560 · accessed 2026-10-28দেখা হয়েছে: 2026-10-28

  4. [4]
    Agent Memory: Long-Term Memory for AI Agents

    Telnyx (developer docs) · accessed 2026-10-28দেখা হয়েছে: 2026-10-28

  5. [5]
    Generative Agents: Interactive Simulacra of Human Behavior, Park et al.

    arXiv 2304.03442 (UIST 2023) · accessed 2026-10-28দেখা হয়েছে: 2026-10-28

  6. [6]
    Lost in the Middle: How Language Models Use Long Contexts, Liu et al.

    arXiv 2307.03172 · accessed 2026-10-28দেখা হয়েছে: 2026-10-28