Articles / AI Agents, Memory, and Retrieval
AI Agents, Memory, and Retrieval
How production AI systems store, retrieve, and forget, and where each layer breaks.
The Agentic Workflow Playbook: From Prompt to Shipped PR
The repeatable five-stage process I run to take a task from vague intent to a pull request I trust, with an AI agent doing the heavy lifting and me stepping in to frame the work and read the diff before it merges.
How I Set Up a Coding Agent That Actually Finishes the Task
A coding agent succeeds or fails before it writes a line. Here is the setup I use, the rules file, repository context, tools, permissions, and guardrails, that turns a capable model into an agent I trust with real work.
Wiring Tools into Your Agent with MCP: A Practical Setup
A hands-on guide to connecting an AI agent to your own tools and data with the Model Context Protocol. The client-server shape, a minimal working server, tool design, and the guardrails that keep it safe.
Fine-Tuning vs RAG for Agent Memory: When Each Approach Makes Sense
Fine-tuning and RAG solve different parts of the agent memory problem. Here is how to decide which one you actually need.
Shared Memory vs Isolated Memory in Multi-Agent Workflows
How to choose between shared and isolated memory architectures for multi-agent systems, including their coordination and debugging trade-offs.
Why Your Coding Agent Keeps Forgetting Everything: Memory Persistence in AI Coding Assistants
The memory persistence patterns that actually work for AI coding assistants, and why most agents lose context between sessions.
LLM Inference Optimization: What Actually Works in Production
A practical breakdown of the inference optimization techniques that move the needle — batching, quantization, caching, and attention kernels — with concrete numbers and the tradeoffs between them.
Memory Versioning and Audit Trails for Regulated AI Agents
If your agent overwrites its memory, you cannot pass a compliance audit. How to build append-only memory versioning and trace agent reasoning.
Contextual Compression for Agent Memory: What Stays and What Goes
How agents decide what to keep in memory when context space is finite, and the three compression strategies that actually work.
Episodic, Semantic, and Working Memory in AI Agents: A Practical Map
AI agents juggle three distinct memory types. Getting them wrong is the source of most agent memory failures I see in production.
Memory Serialization: How Agents Persist State Across Sessions
Why agents forget everything on restart, and the serialization patterns that actually solve it
Multi-Agent vs Single-Agent Systems: The Real Trade-offs
The decision between one agent and many is not about capability. It is about failure modes, latency, and operational complexity.
The Agent Design Space: A Map of What Engineers Are Actually Building
After surveying production agents across industries, the design space clusters into patterns. Here is what I found.
When to Build an Agent and When to Build a Smarter Assistant
The difference between an AI agent and a smart assistant comes down to one thing: who drives the loop.
Lambda Calculus as an AI Reasoning Exercise
Lambda calculus exposes substitution, scope, and composition errors in AI outputs through problems with mechanically checkable answers.
The Anatomy of an Agent Loop: Perceive, Think, Act, Remember
The agent loop is not one thing. It is four distinct phases that run in sequence, and understanding each one is how you debug what breaks.
Why AI Agents Keep Failing in Production and What the Field Is Doing About It
I have spent two years watching agents fail in production. Here is what I keep seeing and what the field is starting to do about it.
A Taxonomy of AI Agents That Actually Explains What You Are Building
Most AI agent taxonomies are either too academic or too vague to be useful. Here is the classification I use when I need to decide what kind of agent to build.
State of AI Agent Memory in 2026
Agent memory spans working state, episodic history, retrieval, and consistency controls. The right architecture depends on the agent's task and risk.
Short-Term Memory for AI Agents: A Practical Guide
Context windows are not memory. Here is what every production AI agent engineer needs to understand about token budgets, overflow handling, and how short-term and long-term memory actually work together.
RAG vs Memory: What AI Developers Need to Know
Understand the fundamental differences between RAG and memory systems for LLM applications, when to use each, and how to combine them in production.
Memory for Voice AI Agents: What Text Chatbots Cannot Do
Voice AI agents live or die by how they manage memory across a real-time streaming pipeline. Text chatbots solve memory with RAG. Voice agents need something different.
How Memory Works in HyperAgents
A deep dive into how HyperAgents retain context across interactions, layer memory architectures, and handle session continuity in production.
How Memory Works in DeerFlow
A deep dive into the memory architecture of DeerFlow: layered context passing, session state files, sub-agent isolation, and how it compares to Letta, AutoGen, and CrewAI.
How Memory Works in Claude Code
A practical guide to understanding how Claude Code retains context across sessions, uses project files, and manages long-term memory for coding tasks.
Context Windows vs Memory: Why They Are Not the Same Thing
Context is a per-request reasoning budget. Memory is persistent state retrieved into a later request. Long input capacity does not make them interchangeable.
AI Memory Management for LLMs: What Actually Works
A senior engineer's breakdown of what memory management for LLMs actually looks like in production: eviction strategies, KV cache management, importance-weighted retention, and why your agent keeps forgetting things.
LLM token budgets: a practical guide to cost control
Real numbers, real pricing, and concrete strategies for keeping your LLM spend predictable.
How to Trace Latency in a Real-Time Voice Agent
A systems-level guide to tracing latency across endpointing, transcription, model inference, speech synthesis, and transport.
RAG Evaluation Metrics: What Actually Matters
A practical guide to RAGAs, recall, precision, and the metrics that separate production RAG systems from prototypes.
What Nobody Tells You About Error Handling in Production AI Agents
Hard-won lessons from running AI agents in production: the error patterns that actually break systems, and the patterns that fix them.
Context Engineering as Heap Management: Accuracy Risks in KV Cache Eviction
A research-led comparison of KV-cache eviction strategies, including their accuracy risks and implementation trade-offs.
Vector Search in the Browser: PGlite vs. SQLite-vec
A comparison of PGlite and SQLite-vec for browser-based vector search, including indexing, memory, and deployment trade-offs.
Claude Code vs. Gemini CLI for Repository Refactoring
A workflow comparison of Claude Code and Gemini CLI for repository refactoring, verification, and human review.
Hybrid Search: Combining Bm25 and Vector Search for Better Retrieval
Hybrid search combines BM25 sparse retrieval with dense vector search. Here's how reciprocal rank fusion works, what it costs, and when the combination actually beats either method alone.
Semantic Caching: The RAG Optimization Nobody Talks About
Semantic caching returns cached LLM responses for semantically similar queries, cutting API costs by 40-70% on the right workloads. Here's how the mechanism works and where it fails.
Structured Outputs with LLMs: JSON Mode, Function Calling, and When to Use Each
JSON mode, function calling, and structured outputs solve different problems. Here's when each one actually makes sense and what they cost you.
How Anthropic's Contextual Retrieval Changes RAG Architecture
The mechanism changes what gets indexed before the RAG pipeline runs a query.
Token Counting Isn't Optional: a Practical Guide to Llm Cost Control
I explain the mechanics of LLM tokenization, why JSON burns your API budget, and how to architect systems for strict token efficiency.
Reranking in RAG: Why Your Top-K Results Are Probably Wrong
Vector databases return results based on semantic similarity. I explain why that is rarely enough for production RAG and how a cross-encoder reranker fixes the problem.
Vector Embeddings: a Guide to the Geometry of Meaning in Ai
Everything in AI starts with a vector. Here is how embedding models turn human language into high-dimensional geometry, why dimensionality reduction matters, and how to choose between OpenAI, Cohere, and self-hosted models.
Llm Context Windows Explained: Why More Is Not Always Better
Context windows are expanding to millions of tokens. Here is why the middle of your context still gets ignored, what long context actually costs, and how to build production systems that use these massive windows effectively.
Prompt Caching: What It Is and When the Math Works
Prompt caching can reduce LLM costs by up to 90% and cut latency by half. Here is the engineering guide to how it works, why prefix matching matters, and how to calculate your ROI.
Mixture of Experts: How Moe Models Are Cheap to Run but Expensive to Host
DeepSeek V3 has 671B parameters but only activates 37B per token. Here's how mixture of experts works, why it cuts inference costs, and the catch nobody puts in the headline.
The Best LLMs for Coding in 2026: An Engineering Review
Not all models are created equal for software development. Here is a benchmark-backed guide to choosing the right LLM for autonomous agents, algorithmic logic, and repository-scale refactoring as of March 2026.
The Model Context Protocol (MCP) Explained: A Universal Language for AI Tools
Model Context Protocol (MCP) is the new standard for connecting AI models to data sources and tools. Here is why it matters, how it works, and why it is the missing link for agentic infrastructure.
Agent Harnesses: the Infrastructure Layer Your Llm Agent Actually Needs
Every production AI agent needs a harness. Here is what one contains, why frameworks often are not enough, and how to build the layer that actually determines reliability.
Time to First Token (TTFT): The Metric That Determines AI Snappiness
Users do not care about total throughput. They care about how fast the first word appears. Here is the engineering guide to measuring and optimizing Time to First Token (TTFT) in production.
Speculative Decoding: How to Speed up Llm Inference for Free
LLM inference is memory-bound, not compute-bound. Speculative decoding uses this fact to speed up generation by 2-3x using a smaller draft model to predict tokens for a larger one.