After studying this material, students should be able to:
Think of an agentic LLM as an AI assistant that:
User → Agent → Tool Use → Output
↑
[Uses context]
Analogy: Imagine hiring an expert consultant who, every Monday morning, forgets everything from previous weeks:
Every session, users must re-explain everything from scratch
This is computationally wasteful AND degrades output quality.
One might think: "Just save the entire conversation history!"
Why this backfires:
| Problem | Explanation |
|---|---|
| Token inefficiency | Long histories consume expensive context window space |
| Stale reasoning pollution | Old reasoning traces bias the agent incorrectly |
| Irrelevant noise | Session-specific chatter degrades generation quality |
Task Completion Rate:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
No Memory: ████████████████░░░░ 79%
Full History: ██████████████░░░░░░ 71% ← WORSE than no memory!
Selective Memory: ███████████████████░ 96%
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Key Insight: Full history persistence actively harms performance because stale reasoning traces mislead the agent
Instead of saving everything or nothing, selectively retain only what generalizes across sessions.
Session 1 ──┐
Session 2 ──┼──► [Filter] ──► SELECTIVE MEMORY ──► Session N
Session 3 ──┘
↑
Keep reusable
Discard specific
{customer_id: int, revenue: float, region: string}✅ KEEP (Reusable) ❌ DISCARD (Session-Specific)
───────────────────── ──────────────────────────────
Task specifications → "Let me think about this..."
Data schemas → Intermediate reasoning steps
Tool configurations → Error recovery attempts
Output constraints → One-time clarifications
Without shared memory:
User A learns: "SQL schema looks like X, tool Y works best"
User B starts: [Learns everything from scratch again]
User C starts: [Learns everything from scratch again]
With shared memory:
User A builds memory workspace
↓
[Workspace shared with role-based access]
↓
User B inherits accumulated knowledge instantly
User C inherits accumulated knowledge instantly
| Role | Capability |
|---|---|
| Owner | Create, edit, share workspace memory |
| Collaborator | Use and contribute to memory |
| Viewer | Read-only access to memory context |
Analogy: Like a shared Google Drive folder for institutional knowledge, but for AI context
The system stores generated artifacts (dashboards, reports) with git versioning:
main branch: [Dashboard v1] → [Dashboard v2] → [Dashboard v3]
↓
draft branch: [Experimental edit] ← Safe to explore
Benefits:
The Problem it Solves:
Traditional approach:
New data available → Re-invoke LLM → Re-generate artifact → [Costs tokens + time]
Zero-token refresh:
New data available → Re-run existing program with new data → [Zero LLM cost]
How it works:
Performance Impact:
Task time reduction: 14× faster
Token cost reduction: 97× cheaper (summary-driven generation)
Zero-token refresh success: 12/12 trials on public datasets
┌─────────────────────────────────────────────────────┐
│ USER INTERFACE │
└──────────────────────┬──────────────────────────────┘
│
┌──────────────────────▼──────────────────────────────┐
│ AGENTIC LLM LAYER │
│ • Multi-turn tool use │
│ • Code generation │
└──────┬───────────────┬───────────────────────────────┘
│ │
┌──────▼──────┐ ┌─────▼──────────────────────────────┐
│ TOOLS │ │ SELECTIVE MEMORY LAYER │
│ • CSV │ │ ┌──────────────────────────────┐ │
│ • SQL │ │ │ Task Specs | Schemas │ │
│ • REST API │ │ │ Tool Config | Output Rules │ │
│ • MCP Server│ │ └──────────────────────────────┘ │
└─────────────┘ │ [Shared across users via RBAC] │
└─────────────────────────────────────┘
│
┌──────────────────────▼──────────────────────────────┐
│ GIT-VERSIONED ARTIFACTS │
│ • Dashboards • Reports • Data Documents │
│ [Draft isolation + Zero-token data refresh] │
└─────────────────────────────────────────────────────┘
| Condition | Task Completion | Key Insight |
|---|---|---|
| No Memory | 79% | Baseline; re-specification burden |
| Full History | 71% | Worse — stale traces mislead agent |
| Selective Memory | 96% | Best — clean, relevant context |
CORE INSIGHT:
─────────────────────────────────────────────────────
Memory Quality > Memory Quantity
The right 4 categories of context (selectively retained)
outperform both no memory AND complete history retention.
Sharing this selective memory across users multiplies
its value without multiplying specification effort.
─────────────────────────────────────────────────────