memory loops

    1

    Implements durable cross-session learning through structured recall, reflection, and lesson compression loops.

    Free

    1 useSecurity scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    memory loops

    Example session with this skill installed

    I just finished fixing that intermittent race condition in the Stop hook. Remember this for next time so we don't hit it again.

    • Read your context and instructions
    • Compiled the memory loops

    I have reflected on the task and extracted a new lesson for the Error Library. I deduplicated this against existing entries and confirmed no matching root cause was found.

    Memory Reflection: Race Condition in Stop Hook

    FieldContent
    What HappenedFixed a race condition where the Stop hook fired before the cleanup signal was fully propagated.
    WhyThe hook lacked an internal await for the is_terminating state, causing execution to proceed on stale thread context.
    How to ApplyAlways verify the is_terminating flag and await the cleanup_signal promise before executing final teardown logic in Stop hooks.
    Store Actionmemory_save initiated. New entry created in error_library.

    Next steps

    • Run recall("Stop hook logic") before the next lifecycle refactor to verify this lesson is injected.
    • Monitor the error_library for similar threading issues to see if a broader "Concurrency Pattern" compression is needed.
    • Review the loop-ledger status to ensure the memory update converged successfully.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Every time an agent starts a new session, it effectively undergoes a lobotomy, forgetting the hard-won lessons from the previous task. You end up paying for the same mistakes, re-deriving the same logic, and hitting the same roadblocks. Memory Loops fixes this by implementing a durable, queryable store that turns ephemeral task outcomes into permanent institutional knowledge.

    What it does

    • Reflexion loops trigger a mandatory recall of relevant lessons before acting and a structured reflection after completion.
    • Error library maintenance extracts failure root causes into a deduplicated database to prevent recurring bugs.
    • Success pattern extraction documents what worked and why so high-performance outcomes can be replicated deliberately.
    • Memory compression merges redundant or overlapping lessons into high-level patterns to keep the context window lean.
    • Deduplication enforcement prevents the memory store from becoming noisy by rejecting near-duplicate entries.

    How it works

    1. Recall triggers a search for lessons matching the current task description to inject prior context.
    2. Act & Reflect executes the task and writes a single lesson detailing what happened, why, and how to apply it next time.
    3. Audit runs periodic sweeps using the loop-ledger brake to extract distinct patterns from batches of past work.
    4. Compress merges clusters of similar lessons into a single durable pattern, archiving the original fragments.

    Frameworks & tools

    This skill is optimized for the bantamkit MCP server (memory_recall, memory_save, memory_compact) and integrates with the loop-ledger MCP for execution brakes. It works with any persistent storage including local files, databases, or vector stores.

    Why this beats prompting it yourself

    Standard prompts often fail to deduplicate, leading to a memory store full of noise that exhausts your context window. This skill provides specific loop shapes and "brake" configurations that ensure the agent stops searching when it reaches diminishing returns and compresses data before it becomes unmanageable.

    Use cases

    • Preventing the recurrence of specific bug classes in complex hook or lifecycle logic.
    • Building a codebase-specific "style guide" based on approved success patterns.
    • Triage of legacy postmortems to backfill a searchable root-cause library.
    • Managing long-term agent state across multiple distinct projects or repos.

    Known limitations

    This skill is not for one-off task states or session-level planning. It requires an external storage mechanism or the bantamkit MCP server to persist data across sessions.

    Not for one-off task state. Requires bantamkit MCP or a persistent file/DB to function across sessions. Does not support unbounded search results.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    1 use

    Times used to date

    Free forever

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 28 days ago

    • Free with an Agensi account

    Permissions

    Network Access
    Listed28 days ago

    What's inside

    Frequently Asked Questions

    Memory Loops creates a permanent 'experience' layer for your agent, preventing it from repeating the same mistakes or re-deriving logic across different sessions. It uses structured reflection and compression to ensure your agent's knowledge grows without bloating the context window.

    This skill is optimized for the bantamkit MCP server and requires an external storage mechanism (like a database or local file) to persist data. It works with any agent framework that supports MCP-based tools for recall, saving, and compaction.

    The skill includes the logic for three core 'loop' shapes—Recall, Act & Reflect, and Audit—along with specific 'brake' configurations for the loop-ledger MCP to prevent excessive API usage and noise.

    Unlike raw prompts, Memory Loops includes a compression and deduplication engine that merges redundant lessons into high-level patterns, ensuring your agent only consumes the most relevant, distilled information.

    Yes, this skill is designed to manage long-term state across multiple projects. You can configure the storage to keep specific project libraries separate or merge them into a global 'institutional knowledge' base.

    New in Agents & Orchestration