Build Agentic Memory That Keeps Your Loops Alive and Sharpens Them Every Run A hands-on course on agentic memory teaches developers to build agent loops that survive long runs and compound learning across runs using copy-paste Memanto commands for typed remember/recall, session handoffs, structured failure records, and a reuse loop. The course separates agent memory into four types — working, episodic, semantic, and procedural — operating on two clocks: within a single run memory is a survival problem, and across runs it is a compounding problem. Memanto stores memories tagged with one of 13 semantic types rather than raw text blobs, enabling retrieval of the right kind of memory. The Practical Course: Build Agentic Memory That Keeps Your Loops Alive And Sharpens Them Every Run A hands-on course on agentic memory: first make your loop survive long runs, then make it compound across them. Every step ships with copy-paste Memanto commands - typed remember/recall, session handoffs, structured failure records, and a reuse loop that makes each run start smarter than the last. Most people build agents like goldfish. Every run starts the same way: the agent gets a goal, gathers context from scratch, reasons forward, takes a few actions and somewhere around tool call thirty, it starts forgetting what it already did. It re-runs a finished step. It contradicts a decision it made at the top of the run. And when the task ends, the entire hard-won trace of what worked and what failed evaporates. Tomorrow the same agent wakes up knowing nothing and walks into the exact same wall it hit yesterday. That is not an agent. That is a very expensive way to start from zero, forever. Memory fixes this, and almost nobody sets it up correctly. Most people bolt a vector store onto their agent, dump raw transcripts into it, and wonder why the loop still breaks and still doesn't get any smarter. This is the practical edition of that course — every principle followed immediately by the exact memanto commands that implement it, so you finish with a working memory architecture and not just a mental model. Two goals, in order. First, make your loop work — survive long runs without rotting or blowing your token budget. Second, make your loop sharpen — reuse what it learned so every run starts smarter than the last. “Within the loop, memory is what makes your agent functional. Across loops, memory is what makes your agent get better. Most people accidentally solve neither, because they never separated the two. What Agentic Memory Actually Is Strip away the marketing and agent memory is not one thing. It's four, operating on two different clocks. Getting this taxonomy straight is most of the battle, because almost every memory mistake comes from treating all of it as one undifferentiated bucket. - Working memory is the live context window — the agent's RAM, the scratch space for the step it's on right now. Fast, small, and where rot happens. - Episodic memory is specific past events. "Last Tuesday's deploy failed because the migration ran before the feature flag flipped." Individual runs, with their outcomes. - Semantic memory is distilled, durable facts and preferences. "The payments service requires idempotency keys." "This client hates em-dashes." Timeless truths about your world. - Procedural memory is learned how-to. "To add an endpoint here: update the router, add the handler, write the test, run the suite — in that order." The runbook the agent earned by doing the task before. Now the two clocks, because this is the part that reorganizes everything. Within a single run , memory is a survival problem: working memory has a hard ceiling and a long loop fills it with debris. Solve this and the loop completes instead of collapsing at turn 40. Across runs , memory is a compounding problem: episodic, semantic, and procedural memory persist beyond the run and get fed back in. Solve this and the loop improves — each run starts where the last one left off, not at zero. The mental model that makes every later decision obvious: your context window is RAM, your persistent store is disk. You don't hold your entire hard drive in RAM, and you don't want your agent holding its entire history in the context window. RAM is for what this step needs right now . Everything durable lives on disk and gets paged in on demand. Map the four types onto Memanto Memanto is the "disk" in that model, and it doesn't store raw text blobs — every memory is tagged with one of 13 semantic types, which is exactly what lets you retrieve the right kind of memory later instead of everything that vaguely matches. Here is how the textbook taxonomy lands on Memanto's types, including the fifth category nobody stores but everybody needs: | Memory type theory | What it holds | Memanto type s | |---|---|---| | Working | The live context window — this step only | Not stored this is RAM | | Episodic | Specific past runs and their outcomes | event | | Semantic | Durable facts, preferences, ownership | fact , preference , relationship | | Procedural | Learned runbooks and how-to | instruction | | Failures the one nobody keeps | What went wrong and the fix that worked | error | Keep this table next to you for the rest of the course. Every time we "write to memory," the real decision is which type — and the type is what makes retrieval precise later. The Mistake Almost Everyone Makes When a long agent loop fails, the reflex is to reach for a bigger, smarter model. It failed at hour two, so the model must not have been capable enough. Upgrade to the frontier tier and try again. It doesn't work. Swap in the smartest model on earth and the loop usually dies at the same step , because the failure was never intelligence — it was the context. As the loop ran, the window filled with reasoning debris: stale tool output, abandoned branches, superseded decisions. Chroma's "context rot" research shows that as input tokens grow, performance degrades across every major model tested, even on clean controlled tasks. A bigger window doesn't cure this; it just gives you more room to hoard junk before the same cliff. The rule that produces dramatically better loops is the opposite of the instinct: the lever is memory, not model. When Anthropic added context management to its platform, its internal benchmarks showed that pruning stale content alone lifted multi-step agent performance by 29%, and pairing it with a persistent memory tool reached 39% — same model, different memory discipline. In a 100-turn evaluation, managing context let agents finish runs that would otherwise fail from exhaustion, while cutting token use 84%. “Precision of memory beats power of model, almost always. Internalize that and the rest of this course is execution. Step 1: Map The Loop Before You Build Any Memory You cannot design memory for a loop you haven't characterized. How many steps does a typical run take — five, or five hundred? How many tool calls? Does it stay inside one context window, or spill across many? What state, if lost mid-run, would break it — a plan, a set of IDs, a running total, a list of files already touched? And crucially: does the agent run this once or repeatedly ? A one-off research dive and a nightly reconciliation job have completely different memory needs. Write down, in one paragraph, the shape of the loop and the two or three pieces of state that absolutely must survive. Everything you build next protects exactly those. Trick: turn the survival state into memories on day one Once you've named the must-survive state, don't leave it in your head — pin it as memory before the first real run. Create the agent its agent id is just a namespace and store the goal and constraints so every future run and every tool that shares the namespace can see them: memanto agent create nightly-reconciler memanto remember "Goal: reconcile the ledger against the payments source every night and flag deltas over $0.01" --type goal memanto remember "Ledger pulls lag the source by ~5 minutes; always wait before diffing" --type fact --confidence 0.9 Step 2: Draw The Line Between Working Memory And Persistent Memory This is the highest-leverage decision in the whole build. For every piece of information the loop touches, decide which side of the RAM/disk line it lives on. The default should be aggressive: keep the window small, push almost everything to disk, page it back in just in time. A simple rule of thumb for what stays in the working window: - The current subtask and the immediate goal. - The plan — as a short, always-present summary that must never get truncated. - Only the last handful of tool results the current step actually needs. Everything else — full tool outputs, completed subtasks, background facts, prior runs — belongs on disk, retrieved by reference when relevant. Get this wrong toward "too much in the window" and you get rot and a huge bill. Get it wrong toward "too little" and the agent keeps re-fetching things it should have kept. In Memanto: hold the pointer, page in the payload Memanto is the disk. Keep lightweight identifiers in the window — file paths, schema locations, stored queries — as artifact memories, and load the heavy content only when a step needs it. The window holds "where," the store holds "what." Persist the pointer once cheap to keep referencing memanto remember "Main API schema lives at src/schema/index.ts" --type artifact Later, page it in by reference only when a step touches the schema memanto recall "where is the API schema" --type artifact Step 3: Engineer Within-Run Memory — Keep The Loop Alive Now protect the single run. There are exactly four operations, and every within-run tactic is one of them. Drew Breunig's framing, which the field has adopted, calls them write, select, compress, isolate : - Write — persist state outside the window as the loop goes, so a truncated window can't erase the plan or interim results. - Select — retrieve only what this step needs, when it needs it. Not the whole store. The right three facts. - Compress — summarize old turns before they rot the window. Completed subtask becomes a one-line outcome; a verbose tool dump becomes a two-sentence result. - Isolate — hand a noisy sub-task to a sub-agent with its own clean window, and let it return only a distilled summary. Here is a memory policy you can paste into your agent's system prompt or harness config and adapt: MEMORY POLICY within-run WRITE to persistent scratch as you go: - The goal and the current plan keep the plan summary always in-window too - Every decision made, and the reason for it - Durable facts discovered: IDs, file paths, config values, constraints - Any failure and the correction that resolved it KEEP in the working window nothing else : - The active subtask - The plan summary - Only the tool results the current step needs COMPRESS then drop the raw: - Tool outputs older than the current subtask - one-line result - Completed subtasks - one-line outcome ISOLATE via a sub-agent return only a summary : - Deep searches, large-file reads, noisy exploration QUARANTINE, never promote to fact: - Unverified model claims. A hallucination that enters memory poisons every future step until removed. The same four operations, wired to Memanto The policy above is the intent. These are the commands that make it real — notice how each operation maps cleanly onto one Memanto capability: - Write → memanto remember "..." --type decision for choices with the reason , --type artifact for IDs and paths, --type error for a failure and its fix. - Select → memanto recall "..." --type