TL;DR
LLM agents are notoriously "memoryless" when it comes to behavior, often requiring users to repeat the same corrections in every new session. Forge Decision Context (forge_dc) solves this by capturing behavioral signals from human feedback and tool failures, compiling them into imperative "RULE" directives, and injecting them precisely at the decision points where they are needed. It achieves 95% behavioral compliance on a new benchmark while using 10x fewer tokens than standard RAG approaches.
What Problem Does This Paper Address?
While we’ve made great strides in "factual" memory for AI agents (remembering a user's name or favorite programming language), "procedural" or behavioral memory remains a major hurdle. If you tell a security analyst agent to "always check IAM policies before network configurations," it might listen for the rest of the hour, but by tomorrow, it’s back to its old, risky habits.
The authors identify two main gaps:
- Loss of Human Corrections: Explicit feedback on strategy or parameters is rarely propagated back to the system prompt.
- Loss of Self-Generated Patterns: Agents don't learn from their own "near misses," such as a tool call that failed once but succeeded on a retry.
Current RAG (Retrieval-Augmented Generation) systems struggle here because behavioral guidance is often situational. A rule about S3 scanning is irrelevant during the planning phase but critical during execution. Standard RAG often injects too much irrelevant text too early, leading to the "lost in the middle" phenomenon where the agent ignores the most important instructions.
Methods
The authors propose a four-layer architecture called Decision Context (Figure 1) to transform raw interaction traces into persistent behavior.
- Capture: The system detects human corrections (e.g., "Actually, use the other API") and uses an LLM (Claude 3.5 Sonnet) to self-assess tool-call failures.
- Store: Instead of flat text chunks, it uses a typed graph. "DecisionNodes" store both local content and the accumulated context of a session, allowing the system to understand the sequence of events.
- Compilation: This is the "secret sauce." Raw signals are compiled into structured RULE directives. These include the imperative instruction, the type (Format vs. Content), and a "Trigger"—the specific point in a trace where the rule should fire.
- Progressive Injection: Rather than dumping all memory at the start,
forge_dcuses a two-stage approach. Stage 1 injects general formatting rules. Stage 2+ performs "just-in-time" retrieval between tool calls, injecting specific rules only when the agent's current state matches a rule's trigger.
Datasets
The authors introduced DC-Bench, a new benchmark designed specifically to measure behavioral recall and compliance.
- Composition: 71 scenarios across 9 behavioral dimensions (e.g., Implicit Learning, Conflict Resolution, Temporal Coherence).
- Methodology: It uses real executed agent traces with "mocked" tools to ensure determinism.
- Generalization Test: Crucially, the benchmark seeds a correction for one subject (e.g., "Company Acme") and tests if the agent applies that behavioral logic to a different subject (e.g., "Company Beta").
Key Insights and Ideas
- The "Only Rules Rule": The researchers found that agents follow compiled, imperative directives (e.g., "RULE: You MUST do X") far more consistently than they follow retrieved snippets of past conversations.
- Formatting vs. Content Retrieval: A major finding was that formatting rules (like "always use USD symbols") have almost zero semantic similarity to the queries they apply to. Standard vector search fails here.
forge_dcsolves this by tagging rules by type and routing them differently. - Placement Matters: Behavioral guidance is highly sensitive to when it appears. Injecting a rule at the exact decision point (between tool calls) prevents the agent from forgetting the instruction during a long multi-step task.
- Reasoning Can Backfire: Surprisingly, adding a "justification" or reasoning to a rule (e.g., "Do X because of Y") actually decreased performance. It invited the LLM to second-guess the rule rather than simply following it.
Key Results
forge_dc significantly outperformed both factual-memory baselines (like Mem0) and procedural-memory predecessors.
- Compliance: It reached 95% compliance on DC-Bench, compared to just 55% for naive RAG and 12-15% for standard factual memory systems (Figure 2).
- Token Efficiency: It is incredibly lean, injecting only 159 tokens per query on average, compared to over 1,600 tokens for naive RAG (Figure 3).
- Cost: While the "Capture" phase is computationally expensive, the system pays for itself after just four queries due to the massive reduction in per-run token costs (Figure 5).
Limitations and Future Work
- Ablation: The current study evaluates the cumulative system; the authors haven't yet isolated the individual impact of every single component (like conflict resolution vs. triggering).
- Domain Specificity: DC-Bench currently focuses on two domains (financial analysis and customer support). Expanding this to more diverse agent tasks (like coding or robotics) is a logical next step.
- Model Dependency: Compliance is still tied to the underlying LLM's ability to follow instructions. As models evolve, the "injection channel" (where the rule is placed in the prompt) may need to be re-validated.
- Attention Analysis: The authors hypothesize that imperative tokens act as "attention magnets," but they suggest that white-box attention analysis is needed to prove this mechanism.
Summary updated