Drupal is a registered trademark of Dries Buytaert
cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! linkit 7.0.15 Minor update available for module linkit (7.0.15). views_data_export 8.x-1.10 Minor update available for module views_data_export (8.x-1.10).

Overview

The default AI module's AgentRunner deletes agent state when an agent finishes a turn. This means every new user message starts a completely fresh agent run — the LLM has no memory of previous tool calls, tool results, or reasoning from earlier in the conversation.

AI Agent Memory fixes this by decorating the AgentRunner to persist agent state across conversation turns in a separate temp store bin. Agents retain full awareness of their previous actions within a chat session, enabling coherent multi-turn workflows where each step builds on the last.

Features

  • Cross-turn agent continuity — Agent state persists after completion so the next user message resumes with full context, not a blank slate.
  • Turn-aware history trimming — Keeps the context window bounded by dropping middle turns while preserving the first turn (initial context) and recent turns. Never splits tool call/result pairs.
  • Configurable per-agent opt-in — Only agents listed in the module's settings get persistent state. All others pass through to the default AgentRunner unchanged.
  • Stale data detection — Automatically discards persisted state when the agent has finished and no new messages have arrived, preventing replay of outdated context.
  • File binary stripping — Removes binary file data from chat messages before persistence, working around a serialization issue in the upstream ChatMessage class.

Requirements

  • AI module (ai_agents and ai_assistant_api sub-modules)

Configuration

  1. Install the module.
  2. Navigate to /admin/config/ai/agent-memory.
  3. Select which agents should have persistent state.
  4. Optionally adjust history trimming settings (max messages, recent turns to keep).

Activity

Total releases
1
First release
May 2026
Latest release
1 day ago
Release cadence
Stability
0% stable

Releases

Version Type Release date
1.0.x-dev Dev May 22, 2026