Episode 16
Procedural Memory for RAG (Chapter 18)
Unlock how procedural memory transforms Retrieval-Augmented Generation (RAG) systems from static responders into autonomous, self-improving AI agents. Join hosts Morgan and Casey with special guest Keith Bourne as they unpack the concepts behind LangMem and explore why this innovation is a game-changer for business leaders.
In this episode:
- Understand what procedural memory means in AI and why it matters now
- Explore how LangMem uses hierarchical scopes and feedback loops to enable continuous learning
- Discuss real-world applications in finance, healthcare, and customer service
- Compare procedural memory with traditional and memory-enhanced RAG approaches
- Learn about risks, governance, and success metrics critical for deployment
- Hear practical leadership tips for adopting procedural memory-enabled AI
Key tools & technologies mentioned:
- LangMem procedural memory system
- LangChain AI orchestration framework
- CoALA modular architecture
- OpenAI's GPT models
Timestamps:
0:00 - Introduction and episode overview
2:30 - What is procedural memory and why it’s a breakthrough
5:45 - The self-healing AI concept and LangMem’s hierarchical design
9:15 - Comparing procedural memory with traditional RAG systems
12:00 - How LangMem works under the hood: feedback loops and success metrics
15:30 - Real-world use cases and business impact
18:00 - Challenges, risks, and governance best practices
19:45 - Final thoughts and next steps for leaders
Resources:
- "Unlocking Data with Generative AI and RAG" by Keith Bourne - Search for 'Keith Bourne' on Amazon and grab the 2nd edition
- Visit Memriq.ai for more AI insights, tools, and resources
Transcript
MEMRIQ INFERENCE DIGEST - LEADERSHIP EDITION Episode: Procedural Memory for RAG: Chapter 18 Deep Dive with Keith Bourne
MORGAN:Welcome to Memriq Inference Digest – Leadership Edition. I’m Morgan, and this podcast is brought to you by Memriq AI, a content studio creating tools and resources for AI practitioners. Check them out at Memriq.ai.
CASEY:Today, we’re diving into an exciting topic from Chapter 18 of *Unlocking Data with Generative AI and RAG* by Keith Bourne. We’ll explore how procedural memory empowers Retrieval-Augmented Generation, or RAG, through a tool called LangMem. It’s about turning AI agents from static responders into autonomous learners that improve themselves over time.
MORGAN:And Keith Bourne himself is here with us! Keith, welcome. We’re really looking forward to hearing your insider insights and some behind-the-scenes thinking on this groundbreaking concept.
KEITH:Thanks, Morgan and Casey. Really pleased to join you all and share how procedural memory is reshaping AI interactions.
CASEY:We’ll unpack what procedural memory means in practical terms, why it matters now, and how LangMem and related frameworks bring this to life in business settings. Plus, we’ll cover real-world applications, challenges, and what leaders need to know before investing.
MORGAN:If you want to go deeper than today’s overview—with detailed diagrams, thorough explanations, and hands-on code labs—search for Keith Bourne on Amazon and grab the second edition of *Unlocking Data with Generative AI and RAG.* The book goes much deeper than we can today.
MORGAN:Okay, let’s get started.
JORDAN:I want to kick off with something that really surprised me about procedural memory and LangMem. It’s that this approach actually lets AI agents *self-heal.* Imagine an AI that detects when it messes up and then corrects its own behavior—without a human stepping in.
MORGAN:Hold on—that’s huge. So the AI learns not just from what you feed it upfront but from every interaction it has afterwards?
JORDAN:Exactly. Every conversation, every user question becomes training data. The agent compounds its own performance over time, improving success rates while cutting down the manual effort needed to maintain it.
CASEY:That sounds like a dream for scaling customer service or advisory bots. But I’m curious—how reliable is this self-correction? Does it really save operational costs?
JORDAN:According to the data in the book, success rates jump significantly, and operational costs drop as agents become better at anticipating problems and adjusting strategies on the fly.
MORGAN:Wow. That’s not just incremental improvement; it’s a strategic game-changer. Instead of one-and-done deployment, the AI gets smarter and more autonomous continuously.
KEITH:That’s right. When I wrote that chapter, my goal was to showcase how procedural memory unlocks that autonomous learning. It’s a shift from static AI models to ones that evolve intelligently, spotting failures and refining their playbook themselves.
CASEY:I like the idea, but I’m already thinking about the risks of letting AI “self-heal.” What if it learns the wrong lesson?
JORDAN:Great point. We’ll dive into those risks later. But for now, just imagine the competitive advantage of AI that uncovers customer insights automatically, saving companies from endless manual tuning.
MORGAN:That image sticks with me — AI as an evolving team player, not a fixed tool.
CASEY:Here’s the one-sentence essence for busy leaders: Procedural memory with LangMem enables AI agents to learn from interactions, adapt behavior, and continuously improve retrieval-augmented systems.
MORGAN:And the key players are LangMem itself, which manages the procedural memory, LangChain for orchestrating AI workflows, the CoALA framework for modular architecture, and OpenAI’s GPT models powering the natural language understanding.
CASEY:If you remember nothing else: procedural memory turns AI from static responders into adaptive learners that get better with every conversation, making RAG systems smarter and more autonomous.
JORDAN:Let’s set the stage. Traditionally, AI agents have been pretty static—they rely on fixed knowledge bases or pre-trained models updated manually. That’s a bottleneck for scalability and personalization.
MORGAN:Right, static AI means every time you want to improve or adapt, your team has to step in with updates. That’s slow and costly, especially with complex or rapidly changing domains.
JORDAN:Exactly. But business environments now demand AI that personalizes experiences and self-improves without constant human oversight. Customers expect smarter, faster, more relevant interactions every time.
CASEY:So what changed recently that makes procedural memory viable?
JORDAN:A few things. Advances in frameworks like LangChain and LangMem provide modular, scalable architectures. Plus, the maturity of GPT models means AI understands language better, enabling it to detect subtle failures and learn from them. Also, companies are recognizing that continuous learning isn’t a nice-to-have; it’s essential for competitive differentiation.
MORGAN:And who’s actually adopting this tech? Is it just the big tech players?
JORDAN:Not at all. Early adopters include investment advisory firms personalizing portfolio strategies, healthcare providers optimizing patient care, and customer service teams reducing escalations. They’re tapping into procedural memory to cut operational costs and improve customer satisfaction simultaneously.
CASEY:That’s a powerful combination. Faster time-to-resolution and lower maintenance overhead—two metrics every leader wants to see improving.
TAYLOR:Let’s unpack the fundamental idea behind procedural memory. Unlike traditional AI memory, which might just store facts or past conversations, procedural memory stores *behavioral patterns* and strategies. That means it remembers *how* to act, not just *what*.
MORGAN:So it’s like the difference between knowing the facts about a customer and knowing the best way to handle their particular problem or personality.
TAYLOR:Exactly. Procedural memory enables AI to apply the right strategy at the right level—whether that’s for an individual user, a community segment, a specific task, or even globally across all interactions. It’s hierarchical.
KEITH:That’s a key point. I wanted readers to see that AI behavior isn’t one-size-fits-all. LangMem, for example, organizes its learning into these scopes—user level, community level, task level, and global. This modularity ensures the AI tailors responses appropriately and learns across different dimensions.
TAYLOR:And the CoALA framework supports this by enabling domain-agnostic procedural memories to plug into specific agents. So whether it’s healthcare or finance, the architecture remains consistent, but the learned strategies adapt to domain specifics.
CASEY:That modularity sounds like a smart design to avoid reinventing the wheel for every application.
TAYLOR:It is. And it creates a feedback loop where agents learn from what works and what doesn’t, continuously optimizing future interactions—making AI smarter in a way that aligns with business goals.
MORGAN:Keith, as the author, why was it important to cover procedural memory so early in the book?
KEITH:Because it represents a paradigm shift. Early chapters build the foundation with RAG basics, but procedural memory is where things leap forward—from static retrieval to dynamic learning. I wanted leaders to grasp that this is where future-proof AI systems are headed.
TAYLOR:Now, let’s compare procedural memory with other approaches. Traditional RAG systems—think of them as search engines—pull documents or data based on keyword matches or semantic similarity, which means “meaning-based” matching.
CASEY:So traditional RAG helps AI find relevant info but doesn’t learn from whether the answer worked or not.
TAYLOR:Exactly. Then there are memory-enhanced RAG systems that add episodic memory—remembering specific past events—and semantic memory—understanding concepts over time. But these still don’t adapt behavior based on outcomes.
CASEY:That’s where procedural memory comes in?
TAYLOR:Yes. Procedural memory adds a meta-learning layer that *refines the agent’s behavior* based on real-world success and failures. It learns which strategies yield the best results and adjusts accordingly.
MORGAN:Can you give an example of when to use one over the other?
TAYLOR:Sure. Use traditional RAG when you need straightforward document lookup without behavior adaptation—like static FAQs. Episodic or semantic memory helps when you want the AI to remember past conversations or concepts but don’t need behavior changes—for example, a customer chatbot recalling prior orders. Procedural memory, like LangMem, shines when you want *autonomy, continuous improvement,* and *personalized strategies* across users and tasks—think complex advisory agents or healthcare assistants.
CASEY:What about downsides?
TAYLOR:Procedural memory systems require more upfront investment in design and metrics, and careful governance to avoid learning the wrong lessons. But the payoff can be big.
ALEX:Let’s take a closer look at how procedural memory actually works in LangMem. No code, just the big picture.
MORGAN:This is where I get excited.
ALEX:The system starts by interfacing with a domain-specific agent—say, an investment advisor bot. LangMem doesn’t hardcode domain logic; instead, it captures patterns from conversations as *readable procedures*—think step-by-step strategies. These strategies are organized into hierarchical scopes: individual user, community segments, task types, and global strategies. This lets the AI apply the right approach depending on context.
CASEY:Why is that hierarchy important?
ALEX:Because a one-size-fits-all strategy often fails. For example, a user-level strategy might adapt to a single customer’s preferences, while a community-level strategy captures trends across a market segment. The AI can choose or combine these depending on the situation.
MORGAN:How does the system know if a strategy worked?
ALEX:That’s where *success metrics* come in. The AI tracks outcomes—like whether a customer’s question was resolved, or if an investment recommendation met a target. Based on these metrics, the system updates confidence scores for each strategy. Critically, LangMem maintains a *feedback loop* that adjusts these scores, favoring strategies with higher success and rolling back ones that degrade performance. This momentum-based update ensures stable evolution.
KEITH:Alex, you nailed the core. When I designed the code labs for the book, my focus was to let readers internalize how to define meaningful success metrics and implement feedback loops safely. That’s the heart of adaptive AI.
ALEX:Keith, what’s the one thing you want readers to really take away from those code labs?
KEITH:It’s that designing success metrics aligned with business goals isn’t trivial—but it’s essential. Without the right metrics, the AI can optimize the wrong objectives, which is risky. The labs walk through how to structure metrics and implement safe rollbacks—practices that are often overlooked but critical for trust and reliability.
ALEX:The numbers from LangMem deployments are impressive. From just a couple of interactions, the system learns multiple strategies across user, community, task, and global scopes. For example, it might learn eight distinct strategies from two initial sessions.
MORGAN:That’s efficiency I can get behind. Learning that much from so little input?
ALEX:Yes, and hierarchical retrieval ensures the system personalizes responses effectively. Success rates improve from an initial 75% to over 85%, sometimes even hitting 90%, all while reducing errors and customer frustration.
CASEY:And that translates to real business impact?
ALEX:Absolutely. Reduced operational costs due to fewer manual updates and better-first-contact resolution lead to faster time-to-resolution and higher customer satisfaction scores. The confidence scores help prioritize strategies, so the AI focuses on what’s proven effective.
MORGAN:That’s a big win for any customer-facing operation or advisory service.
ALEX:The downside? Initial setup requires thoughtful design and domain expertise, but once running, these self-improving agents deliver measurable ROI.
CASEY:Now, let’s bring a dose of reality. Procedural memory systems sound promising, but what can go wrong?
MORGAN:I’m curious what you found.
CASEY:First, defining success metrics is tricky. If the metrics don’t align perfectly with business goals, the AI might optimize for the wrong outcomes—leading to degraded performance or unintended behaviors.
JORDAN:And continuous learning systems can overfit—meaning they might get too narrowly focused on specific cases or noisy data, losing generality.
CASEY:Right. That’s why rollback mechanisms are critical. If the AI’s strategy declines, you need a safe way to revert to prior versions.
KEITH:Casey, you’re raising exactly the concerns I wanted to highlight in the book. In my consulting, I often see teams rushing into adaptive AI without robust metric design or rollback plans. That’s the biggest mistake.
CASEY:What’s your advice for leaders to avoid these pitfalls?
KEITH:Invest time upfront to define clear, multi-dimensional success metrics. Collaborate closely between domain experts and data scientists. And implement rigorous testing—like “needle in a haystack” tests, where you hide specific facts in large documents to ensure the AI can still find them and not hallucinate false info. Transparency and auditability are essential for trust.
CASEY:That honesty is refreshing. Procedural memory isn’t a magic bullet but a powerful tool that requires careful governance.
SAM:Let’s look at real-world applications. In investment advisory, procedural memory agents learn personalized portfolio strategies based on client preferences and market behavior, improving recommendation success and client retention.
MORGAN:That personalization is huge in finance.
SAM:Healthcare is another domain. AI assistants optimize patient care pathways and appointment scheduling by adapting to individual needs and systemic patterns, leading to better outcomes and reduced no-shows.
CASEY:What about customer service?
SAM:Procedural memory helps bots refine ticket resolution flows, reducing escalations and improving first-contact resolution rates. Similarly, in education, tutors adapt teaching styles dynamically to learner comprehension levels, enhancing engagement.
MORGAN:So across industries, the common thread is adaptive, context-aware AI that continuously refines its approach.
SAM:Exactly. It’s competitive advantage through smarter, more efficient AI that's less dependent on ongoing manual tuning.
SAM:Picture this scenario: A company must choose between traditional RAG, memory-enhanced RAG, or procedural memory-enabled agents for their customer support.
MORGAN:Traditional RAG’s strength is simplicity—basic retrieval of documents or FAQs with minimal complexity.
CASEY:But it won’t learn or adapt behavior, so the company will need constant manual updates.
TAYLOR:Memory-enhanced RAG adds context—remembering past conversations or concepts—which improves continuity but still lacks behavioral refinement.
ALEX:Procedural memory agents deliver autonomy, continuously improving and personalizing strategies, but with higher upfront design and monitoring costs.
CASEY:So if budget is tight and the domain is straightforward, traditional RAG might suffice. But for complex, dynamic environments, procedural memory wins.
MORGAN:The trade-off is between short-term ease and long-term scalability and ROI.
SAM:Exactly. Procedural memory justifies its higher initial investment through reduced maintenance costs and improved customer satisfaction down the line.
SAM:For leaders ready to embrace procedural memory, here are practical tips. First, use modular domain interfaces to separate your domain logic from the core procedural memory system. This keeps things flexible.
TAYLOR:That modularity allows you to swap in new domain models without redesigning your entire memory setup.
SAM:Second, implement hierarchical scopes—user, community, task, global—to target learning and retrieval effectively.
ALEX:And define clear success metrics that align with your business goals. Without these, the system can’t learn properly.
SAM:Third, leverage feedback loops with momentum-based updates. This means your AI remembers not just the last interaction but the trend over time.
CASEY:Don’t forget to build in safe rollback mechanisms to mitigate risk from degraded strategies.
MORGAN:Those are practical guardrails for deploying adaptive AI with confidence.
MORGAN:If you want to go deeper on all this, *Unlocking Data with Generative AI and RAG* by Keith Bourne is a must-read. It’s full of detailed illustrations, thorough explanations, and hands-on code labs that walk you through building procedural memory systems step by step. Search for Keith Bourne on Amazon and grab the second edition.
MORGAN:Quick reminder – this podcast is produced by Memriq AI, an AI consultancy and content studio building tools and resources for AI practitioners. For more AI deep-dives, practical guides, and cutting-edge research breakdowns, head to Memriq.ai.
CASEY:Memriq helps engineers and leaders stay current with the rapidly evolving AI landscape.
SAM:Procedural memory is powerful, but challenges remain.
MORGAN:Like what?
SAM:Designing domain metrics that balance competing business goals is complex. You might want to optimize for speed but also accuracy, and those can conflict.
CASEY:Scaling procedural memory systems to handle millions of users or multiple domains requires robust infrastructure.
SAM:Transparency and auditability are crucial to maintain trust, especially in regulated industries. Autonomous learning must be explainable.
KEITH:And adapting to rapidly changing environments without losing valuable learned knowledge—what I call “catastrophic forgetting”—is a key research frontier.
MORGAN:So for leaders, the field is ripe with opportunity but demands strategic vision and resource investment.
MORGAN:My takeaway: Procedural memory transforms AI agents into dynamic learners, unlocking continuous improvement and strategic advantage.
CASEY:I’d emphasize the need for strong governance—metrics, monitoring, and rollback—to avoid costly mistakes.
JORDAN:For me, it’s the idea that AI can self-heal and uncover customer insights automatically—huge potential to save time and money.
TAYLOR:The hierarchical design is brilliant—scaling personalization from individuals to communities.
ALEX:The feedback loops and momentum updates are the clever levers that make procedural memory reliable and effective.
SAM:Real-world applications show this isn’t theoretical—it delivers measurable ROI across finance, healthcare, customer service, and education.
KEITH:As the author, the one thing I hope you take away is this: investing in procedural memory-enabled AI is investing in future-proof systems that grow smarter with use—building competitive advantage that compounds over time.
MORGAN:Keith, thanks so much for giving us the inside scoop today.
KEITH:My pleasure. I hope this inspires you to dig into the book and build something amazing.
CASEY:And remember, adaptive AI is powerful—but only if you design, monitor, and govern it carefully.
MORGAN:We covered the key concepts today, but the book goes much deeper—with detailed diagrams, thorough explanations, and hands-on code labs that let you build this yourself. Search Keith Bourne on Amazon and get the second edition of *Unlocking Data with Generative AI and RAG.*
MORGAN:Thanks for listening. See you next time on Memriq Inference Digest – Leadership Edition.
