AIニュース最前線
最新ニュースAI日報Hacker日報週報動画AIツールトレンド企業

AIニュース最前線

世界中のAI最新情報を日本語で毎時更新

最新ニュース日報トレンド企業プレミアムRSS
© 2026 ainew.jp特定商取引法に基づく表記
ニュース一覧元記事を開く
MarkTechPost·2026年6月22日 08:12·約10分で読める

AI エンジニア向け技術ガイド:エージェントの記憶には 7 つのタイプがある

#Agent Memory#RAG#LLM Architecture#Context Window#Vector Database
TL;DR

本稿は、ステートレスな大規模言語モデルを自律的なエージェントへ進化させるために不可欠な 7 つのメモリ類型(作業記憶から先見的記憶まで)を体系的に分類・解説し、エンジニアへの実装指針を提供している。

AI深層分析2026年6月22日 10:02
4
重要/ 5段階
深度40%
5
関連度30%
5
実用性20%
4
革新性10%
3

キーポイント

1

ステートレス性の克服とアーキテクチャの必要性

LLM はデフォルトで状態を持たないため、エージェントが複数ステップにわたる計画や実行を行うには、文脈を保持するメモリインフラストラクチャが不可欠である。

2

7 つのメモリ類型の分類と機能

パラメトリック(重み内)とノンパラメトリック(テキスト)、短期・長期という 2 つの軸に基づき、作業記憶、意味記憶、事象記憶、手続記憶、外部検索記憶、先見的記憶の 7 種類を定義している。

3

各メモリタイプの具体的な実装とトレードオフ

コンテキストウィンドウ内の高速な作業記憶から、ベクトルデータベースを用いた RAG による検索記憶、そして将来の意図を追跡する先見的記憶まで、それぞれの用途と制限(例:重みは学習時に凍結される)が明確にされている。

4

Prospective Memory の重要性

将来の意図やスケジュールされた目標を記憶する機能であり、長期的かつ多段階の計画を行うエージェントにとって不可欠です。

5

メモリタイプとユースケースの明確なマッピング

各メモリタイプ(作業的、意味的、事象的など)は特定の製品課題に対応しており、例えばコーディング支援には作業的メモリ、個人アシスタントには意味的メモリが最適です。

6

複合型エージェントの実現

単一の自律的な市場分析エージェントのように、7 つのメモリタイプを統合することで、セッション間の状態維持から学習されたスキルの実行まで多様なタスクを処理できます。

7

多層メモリ構造の重要性

7 つのメモリタイプ(パラメトリック、リトリーバル、セマンティックなど)はそれぞれ固有の役割を持ち、1 つでも欠けるとエージェントのパフォーマンスが低下する。

影響分析・編集コメントを表示

影響分析

この分類体系は、AI エンジニアが単なるチャットボットを超えた自律型エージェントを設計する際の標準的なアーキテクチャ指針として機能する可能性が高い。特に、LLM のステートレスという根本的制約をどう克服するかという課題に対し、明確な技術的解決策のフレームワークを提供することで、実務レベルでのシステム設計品質向上に寄与する。

編集コメント

エージェント開発における「記憶」の概念を初めて体系的に整理した極めて重要な技術ガイドであり、実装設計の指針として即座に活用できる内容です。

大規模言語モデルはデフォルトではステートレスです。各 API コールは毎回初期状態から始まります。モデルは応答が返されると直前のメッセージを忘れます。これは単一の質問に対しては問題ありません。しかし、エージェントを構築した瞬間にこの仕組みは機能しなくなります。

エージェントは計画を立て、ツールを呼び出し、多くのステップにわたって実行されます。それらには記憶が必要です。メモリはこの問題を解決するインフラストラクチャです。ステートレスなモデルを文脈を保持できるシステムに変換します。そのシステムは経験から学習し、時間を超えて行動することができます。

エージェントメモリとは何か

メモリとは、モデルの推論にわたって情報を伝達するあらゆるメカニズムを指します。その一部はコンテキストウィンドウ内に存在し、他の一部はデータベースやモデル重みといった外部に存在します。各タイプは、異なる期間にわたり異なるクラスの情報を保存します。

メモリはその形態と時間によって異なります。形態とは、パラメトリック(重みに格納される)かノンパラメトリック(テキストとして格納される)かを意味し、時間とは短期間か長期間かを意味します。以下の 7 つのタイプは、これら 2 つの軸にマッピングされます。

エージェントメモリの 7 つの種類

  1. コンテキスト内/ワーキングメモリ(短期間):これはモデルが現在コンテキストウィンドウ内で見ることができるすべての情報を指します。システムプロンプト、直近のメッセージ、ツールの出力、推論ステップが含まれます。これは RAM のように考えてください。高速で不可欠ですが、一時的でありサイズに制限があります。他のあらゆるメモリタイプはここでスペースを競合します。
  1. セマンティックメモリ(長期):これは事実、好み、ドメイン知識の永続的な保存場所です。「ユーザーは JavaScript よりも Python を好む」といったエントリを保持します。学習された時期とは切り離された知識であり、ユーザーやトピックに関するエージェントの整理された百科事典のようなものです。
  1. エピソードメモリ(長期):これは特定の過去の出来事、完全な会話、タスク実行ログを記録するものです。何が成功し、何が失敗したかを記録します。エージェントはこれを通じて経験から学習します。Reflexion や ExpeL などのシステムは、事後検証の言語化を行い、将来の実行のために結論を保存します。
  1. 手続的メモリ(長期):これは物事のやり方を理解するエージェントの知識です。スキル、ツールの使用パターン、ワークフロー、行動ルールをカバーします。100 回目のパスワードリセットを担当するサポートエージェントは、そのワークフローを再推論しません。代わりに学習された手順を実行します。
  1. 外部/検索メモリ(短期+長期):これはモデル外にベクトルデータベースに保存された知識です。推論時に類似度検索を用いてコンテキスト内に読み込まれます。これはエージェントの履歴やドキュメントに対して適用される RAG です。検索品質がすぐにボトルネックとなります。
  1. パラメトリックメモリ(長期):これはトレーニング中にモデルの重みに直接組み込まれた知識です。言語、推論パターン、一般的な世界知識を保持します。モデルは何かを検索しません。学習された関連性から生成を行います。その代償として、この記憶はトレーニング時に凍結されます。
  1. 展望記憶(短期+長期):これは、エージェントが将来の意図やスケジュールされた目標を記憶する能力です。エージェントが計画したがまだ実行していない事項を追跡します。長期的な視野を持つマルチステッププランニング型エージェントにとって不可欠であり、これがなければエージェントは自身のコミットメントを忘れてしまいます。

並列比較:7 つの違い

以下の表では、各タイプを時間スケール、保存場所、典型的な実装方法にマッピングしています。

記憶タイプ | 時間スケール | 保存場所 | 記憶内容 | 一般的な実装

作業型/コンテキスト内 | 短期 | コンテキストウィンドウ | プロンプト、メッセージ、ツール出力 | LLM にネイティブ搭載

意味記憶 | 長期 | 外部ストレージ | 事実、嗜好、ドメイン知識 | ベクトルデータベースまたはプロファイルスキーマ

エピソード記憶 | 長期 | 外部ストレージ | 過去の出来事、タスク実行、結果 | ベクトルデータベース+イベントログ

手続記憶 | 長期 | プロンプトまたは重み | スキル、ワークフロー、行動ルール | システムプロンプトまたはファインチューニング

検索型/外部 | 両方 | ベクトルデータベース | ドキュメント、履歴チャンク | RAG パイプライン(Retrieval-Augmented Generation)

パラメトリック記憶 | 長期 | モデル重み | 世界知識、言語、推論能力 | プリトレーニングまたはファインチューニング

展望記憶 | 両方 | ステートストレージ | 将来の意図、スケジュールされた目標 | タスクキューまたはスケジューラー

インタラクティブ解説

(function(){

var f=document.getElementById("mtp-mem-7K9-frame");

window.addEventListener("message",function(e){

if(e&&e.data&&e.data.mtpMem7K9&&e.data.height){ f.style.height=e.data.height+"px"; }

});

})();

ユースケース:どの記憶がどの問題を解決するか

各タイプは具体的な製品ニーズに応えるものです。ニーズを適切な記憶タイプにマッピングしてください。

1 つのセッション内のコーディングアシスタントは作業記憶を使用します。コンテキスト内で開いているファイルと最近の変更を追跡します。セッションを閉じると、その状態は消滅します。

あなたを覚えているパーソナルアシスタントには意味記憶が必要です。「グルテンアレルギー」といった情報を保存し、翌週にそれを思い出します。この事実はセッションを超えて存続します。

時間とともに改善する研究エージェントにはエピソード記憶が必要です。先月リスクセクションがうまく機能したことを思い出し、成功した方法を繰り返し、失敗したものを避けます。

旅行予約エージェントには手続き記憶が必要です。検索、比較、予約、確認という一連の流れを知っています。この順序は学習されたスキルであり、新規に計画されたものではありません。

ドキュメントチャットボットには検索記憶が必要です。ドキュメントを埋め込み、クエリごとに関連するチャンクを引き出します。回答は常に取得したテキストに基づいて保持されます。

1 週間規模のプロジェクトを管理する長期ホライズンエージェントには prospective memory(見通し記憶)が必要です。金曜日のレポートを送ることを忘れないようにします。その意図は実行されるまで持続します。

7 つのすべてを組み合わせた例:1 つのエージェントにすべてのタイプを統合

自律的な市場分析エージェントを考えてみましょう。ある 1 つのタスクで、すべての記憶タイプが同時に活用されます。

パラメトリックメモリは、推論と言語の基盤を提供します。検索メモリはベクトルストアから現在の市場データを取得します。セマンティックメモリはユーザーが好むレポート形式を提供します。エピソードメモリは、以前に信頼できることが証明されたソースを思い出させます。手続的メモリはセクション順序を駆動します:サイズ決定、次に景観分析、そしてリスク評価です。予期メモリは来週のフォローアップドラフトのスケジュールを設定します。ワーキングメモリはこれらすべてをアクティブなコンテキストに組み立てます。

どの層も一つでも取り除けば、エージェントは弱体化します。それぞれが他者が担えない役割を処理しています。

実装:最小限のメモリスタック

以下は、Python による簡略化されたスケッチです。ワーキングメモリ、セマンティックメモリ、エピソードメモリ、手続的メモリを別々のストアとして示しています。

python
from datetime import datetime

# セマンティックメモリ:ユーザーに関する永続的な事実
semantic_memory = {"diet": "vegetarian", "language_pref": "Python"}

# エピソードメモリ:過去の出来事と結果のログ
episodic_memory = [
    {"timestamp": datetime.now(),
     "event": "recipe_request",
     "result": "user liked a 20-minute meal"},
]

# 手続的メモリ:エージェントが実行できるスキル
def suggest_recipe(diet):
    return f"a quick {diet} recipe"

procedural_memory = {"suggest_recipe": suggest_recipe}

ワーキングメモリ:各推論呼び出しごとに新規構築される

def build_context(query):

diet = semantic_memory["diet"]

last = episodic_memory[-1]["result"]

skill = procedural_memory["suggest_recipe"]

return (

f"Query: {query}\n"

f"Semantic: user is {diet}\n"

f"Episodic: last time, {last}\n"

f"Procedural: returning {skill(diet)}"

)

print(build_context("suggest dinner"))

本番環境では、長期記憶はベクトルデータベースへ移行されます。パターンは同じです。長期記憶に書き込み、ワーキングメモリへ検索し、その後推論を行います。

これらをどうレイヤー化するか:実践的な構築順序

7 つすべてを一度に構築しないでください。複雑さに見合う実際の必要性が生じた場合にのみ、メモリを追加してください。

まずワーキングメモリから始めましょう。これはモデルに標準で搭載されています。多くの単純なエージェントにはこれ以上必要ありません。

ユーザーがセッションを超えてエージェント自身を覚えていてほしいと期待する場合、セマンティックメモリを追加します。これが、多くの製品で最初に必要な長期記憶のレイヤーです。

エピソードメモリ、手続的メモリ、予期メモリは後からレイヤー化してください。これらは、エージェントが先手を打って計画し、失敗から学び、時間とともに適応する必要がある場合にのみ追加すべきです。

パラメトリックメモリと検索メモリは、すでに存在していることがほとんどです。パラメトリックメモリとはベースモデルそのものです。検索メモリは、RAG(Retrieval-Augmented Generation)を追加した瞬間に導入されます。

出典:CoALA フレームワーク(プリンストン大学、arXiv:2309.02427);「AI エージェントの時代の記憶」調査報告書(arXiv:2512.13564);「人間の記憶から AI の記憶へ」調査報告書(arXiv:2504.15965);LangChain LangMem、MongoDB、Redis、Neo4j のエージェント・メモリ関連ドキュメント;7 つのメモリタイプに関するオリジナル概念ノート。

本記事「AI エンジニア向け 7 つのエージェント・メモリの種類:技術ガイド」は、MarkTechPost で最初に公開されました。

原文を表示

Large language models are stateless by default. Each API call starts fresh. The model forgets your last message once the response returns. That is fine for a single question. It breaks the moment you build an agent.

Agents plan, call tools, and run across many steps. They need to remember. Memory is the infrastructure that fixes this. It turns a stateless model into a system that retains context. That system can learn from experience and act over time.

What is Agent Memory

Memory is any mechanism that carries information across a model’s reasoning. Some of it lives inside the context window. Some of it lives outside, in databases or model weights. Each type stores a different class of information for a different duration.

Memory varies by form and by time. Form means parametric, stored in weights, or non-parametric, stored as text. Time means short-term or long-term. The seven types below map onto those two axes.

The Seven Types of Agent Memory

  1. In-Context / Working Memory (Short-Term): This is everything the model can currently see inside its context window. It includes the system prompt, recent messages, tool outputs, and reasoning steps. Think of it as RAM. It is fast and essential, but temporary and size-limited. Every other memory type competes for space here.
  1. Semantic Memory (Long-Term): This is a persistent store of facts, preferences, and domain knowledge. It holds entries like “the user prefers Python over JavaScript.” The knowledge is decoupled from when it was learned. It is the agent’s organized encyclopedia about a user or topic.
  1. Episodic Memory (Long-Term): This logs specific past events, full conversations, and task runs. It records what worked and what failed. The agent uses it to learn from experience. Systems like Reflexion and ExpeL write verbal post-mortems and store conclusions for future runs.
  1. Procedural Memory (Long-Term): This is the agent’s knowledge of how to do things. It covers skills, tool usage patterns, workflows, and behavioral rules. A support agent handling its hundredth password reset does not re-reason the workflow. It executes a learned procedure instead.
  1. External / Retrieval Memory (Short-Term + Long-Term): This is knowledge stored outside the model in a vector database. It is pulled into context at inference time using similarity search. This is RAG applied to agent history or documents. Retrieval quality becomes the bottleneck fast.
  1. Parametric Memory (Long-Term): This is knowledge baked directly into the model’s weights during training. It holds language, reasoning patterns, and general world knowledge. The model does not look anything up. It generates from learned associations. The tradeoff is that this memory is frozen at training time.
  1. Prospective Memory (Short-Term + Long-Term): This is the agent’s ability to remember future intentions and scheduled goals. It tracks things the agent planned but has not yet executed. It is critical for long-horizon and multi-step planning agents. Without it, an agent forgets its own commitments.

Side-by-Side: How the Seven Compare

The table below maps each type to its timescale, location, and typical implementation.

Memory typeTimescaleWhere it livesWhat it storesCommon implementation

Working / In-contextShort-termContext windowPrompt, messages, tool outputsNative to the LLM

SemanticLong-termExternal storeFacts, preferences, domain knowledgeVector DB or profile schema

EpisodicLong-termExternal storePast events, task runs, outcomesVector DB plus event logs

ProceduralLong-termPrompt or weightsSkills, workflows, behavioral rulesSystem prompt or fine-tune

Retrieval / ExternalBothVector databaseDocuments, history chunksRAG pipeline

ParametricLong-termModel weightsWorld knowledge, language, reasoningPre-training or fine-tuning

ProspectiveBothState storeFuture intentions, scheduled goalsTask queue or scheduler

Interactive Explainer

(function(){

var f=document.getElementById("mtp-mem-7K9-frame");

window.addEventListener("message",function(e){

if(e&&e.data&&e.data.mtpMem7K9&&e.data.height){ f.style.height=e.data.height+"px"; }

});

})();

Use Cases: Which Memory Solves Which Problem

Each type answers a concrete product need. Map the need to the memory.

A coding assistant inside one session uses working memory. It tracks the open files and recent edits in context. Close the session and that state is gone.

A personal assistant that remembers you needs semantic memory. It stores “allergic to gluten” and recalls it next week. The fact survives across sessions.

A research agent that improves over time needs episodic memory. It recalls that risk sections landed well last month. It repeats what worked and avoids what failed.

A travel-booking agent needs procedural memory. It knows the flow: search flights, compare, reserve, confirm. The sequence is a learned skill, not a fresh plan.

A documentation chatbot needs retrieval memory. It embeds the docs and pulls relevant chunks per query. The answer stays grounded in retrieved text.

A long-horizon agent managing a week-long project needs prospective memory. It remembers to send the Friday report. The intention persists until execution.

A Combined Example: All Seven in One Agent

Consider an autonomous market-analysis agent. One task exercises every memory type at once.

Parametric memory supplies the base reasoning and language. Retrieval memory pulls current market data from a vector store. Semantic memory provides the user’s preferred report format. Episodic memory recalls which sources proved reliable before. Procedural memory drives the section order: sizing, then landscape, then risk. Prospective memory schedules the follow-up draft for next week. Working memory assembles all of it into the active context.

Remove any one layer and the agent gets weaker. Each handles a job the others cannot.

Implementation: A Minimal Memory Stack

Here is a stripped-down sketch in Python. It shows working, semantic, episodic, and procedural memory as separate stores.

Copy CodeCopiedUse a different Browser

from datetime import datetime

Semantic memory: durable facts about the user

semantic_memory = {"diet": "vegetarian", "language_pref": "Python"}

Episodic memory: a log of past events and outcomes

episodic_memory = [

{"timestamp": datetime.now(),

"event": "recipe_request",

"result": "user liked a 20-minute meal"},

]

Procedural memory: skills the agent can execute

def suggest_recipe(diet):

return f"a quick {diet} recipe"

procedural_memory = {"suggest_recipe": suggest_recipe}

Working memory: assembled fresh for each inference call

def build_context(query):

diet = semantic_memory["diet"]

last = episodic_memory[-1]["result"]

skill = procedural_memory["suggest_recipe"]

return (

f"Query: {query}\n"

f"Semantic: user is {diet}\n"

f"Episodic: last time, {last}\n"

f"Procedural: returning {skill(diet)}"

)

print(build_context("suggest dinner"))

In production, the long-term stores move to a vector database. The pattern stays the same. Write to long-term memory, retrieve into working memory, then reason.

How to Layer Them: A Practical Build Order

Do not build all seven at once. Add memory only when a real need justifies the complexity.

Start with working memory. It ships with the model. Most simple agents need nothing more.

Add semantic memory when users expect the agent to remember them across sessions. This is the first long-term layer most products require.

Layer in episodic, procedural, and prospective memory later. Add them only when your agent must plan ahead, learn from failure, and adapt over time.

Parametric and retrieval memory are often already present. Parametric memory is the base model itself. Retrieval memory arrives the moment you add RAG.

Sources: CoALA framework (Princeton, arXiv:2309.02427); “Memory in the Age of AI Agents” survey (arXiv:2512.13564); “From Human Memory to AI Memory” survey (arXiv:2504.15965); LangChain LangMem, MongoDB, Redis, and Neo4j agent-memory documentation; original concept notes on the seven memory types.

The post The 7 Types of Agent Memory: A Technical Guide for AI Engineers appeared first on MarkTechPost.

この記事をシェア

関連記事

MarkTechPost★42026年6月24日 18:21

Nous Research、Hermes エージェントのスキルシステムに「/learn」機能を追加、手書きなしでワークフローをスラッシュコマンドとして記録可能に

Nous Research はオープンソースの自己改善型エージェント「Hermes Agent」のスキルシステムを拡張し、「/learn」という新コマンドを追加した。これにより、ユーザーはドキュメントやコードなどの資料を指定するだけで、エージェントが自動的に再利用可能なスキル定義ファイル(SKILL.md)を作成できるようになった。

TLDR AI★42026年6月24日 09:00

間接プロンプトインジェクションに関する洞察(12 分読了)

TLDR AI が、AI モデルが外部データから悪意ある指示を誤って受け取る「間接プロンプトインジェクション」の仕組みと対策について解説した。

MarkTechPost★42026年6月24日 08:43

Mistral OCR 4 が引用対応の構造化出力を RAG、エージェント型、企業検索パイプラインに提供

Mistral AI は最新ドキュメント理解モデル「OCR 4」を発表し、抽出テキストに境界ボックスやブロック分類、信頼度スコアを追加した。このモデルは 170 か国語に対応し、自己完結型デプロイが可能で、企業検索や RAG パイプラインの ingestion コンポーネントとして機能する。

今日のまとめ

AI日報で今日の重要ニュースをまとめ読み

ニュース一覧に戻る元記事を読む