AGI记忆模组
A meta-skill that provides persistent memory and context engineering capabilities for AI agents.
Install & Use
Copy this prompt and send it to your AI assistant (Claude / Cursor / TRAE / Codex / WorkBuddy etc.) to auto-install:
Help me install this AI Skill: AGI记忆模组. It is used for: A meta-skill that provides persistent memory and context engineering capabilities for AI agents. Full Skill content: https://321skill.com/skills/agent-memory-context-2/raw/index.md Read that page and install it.
The prompt includes a link to the full Skill content. You can also view the full content.
This skill addresses the issues of AI agents easily forgetting context in long conversations, being unable to associate information across sessions, and lacking structured memory management. In practical development, developers often need to manually maintain conversation history, handle token budgets, and design retrieval logic. This skill encapsulates five core capabilities (Selection, Compression, Retrieval, State, and Memory) into a unified framework, automatically performing noise filtering, chain structure extraction, result re-ranking, task progress tracking, and conflict detection, enabling agents to truly possess "memory."
Usage is straightforward: simply set this skill as a meta-skill to run persistently (always: true), and all interactive behaviors will automatically trigger memory processing. You can then manage memory using natural language instructions, such as "Save the key points of the current conversation" or "Retrieve the architectural plan discussed last time." The underlying system employs a four-layer architecture, with the ContextOrchestrator serving as the central control hub for unified scheduling of token budgets, retrieval decisions, and multi-source coordination. The cognitive model layer provides dual-track parallel processing (semantic bucket refinement + chain extraction), ultimately storing results in the short-term/long-term memory layer.
It is particularly suitable for teams or individuals building complex AI agents, especially those already encountering context window limitations, needing cross-session knowledge reuse, or aiming to implement persistent memory for personalized assistants. AI agent developers, full-stack engineers, and AI product managers can all benefit, as it significantly reduces the engineering complexity of memory management, allowing developers to focus on business logic rather than underlying memory orchestration.
It is recommended to configure the storage path and Redis connection (optional) before first use and adjust token budget parameters based on actual scenarios. Note that this skill depends on Python 3.9+ and several third-party libraries (pydantic, tiktoken, etc.); ensure environment compatibility during deployment. As it runs persistently as a meta-skill, it will continuously consume a certain amount of tokens for memory compression and retrieval. It is advisable to regularly clean up or archive old memories in long-running tasks to optimize performance.
Key Features
Unlike typical memory plugins (e.g., simple conversation history storage), it provides a complete set of five Context Engineering capabilities (Selection, Compression, Retrieval, State, and Memory) with cognitive model layer support. It employs a four-layer architecture and a ContextOrchestrator for unified scheduling, rather than simple key-value storage. It also supports dual-track parallel processing (semantic bucket refinement + chain extraction), automatically identifying five chain types (causal, logical, operational, narrative, and temporal) for more precise context association.
Limitations
Requires Python 3.9+ environment and installation of 6 third-party libraries including pydantic and tiktoken; Redis is optional but recommended. As a persistently running meta-skill, it consumes additional tokens for memory compression and retrieval in each interaction, incurring performance overhead in long-context scenarios.
FAQ
How do I install this skill?
Install the dependencies via pip: pip install pydantic>=2.0.0 typing-extensions>=4.0.0 cryptography>=41.0.0 redis>=4.5.0 tiktoken>=0.5.0 mmh3>=3.0.0, then configure always:true. It can also be installed directly from the ClawHub platform.
Which AI models does it support?
This skill is a model-agnostic meta-skill and can be used with any AI model that supports context injection, including Claude, GPT, Gemini, etc. It primarily provides memory management infrastructure and does not depend on a specific model.
Installation guide for AI assistants
If your AI coding assistant (Claude Code, Cursor, TRAE etc.) can see this page, send it this message to auto-install:
Visit https://321skill.com/skills/agent-memory-context-2/raw/index.md to read the original Skill definition (Markdown format) for AGI记忆模组, and install it according to the instructions.
Raw Markdown URL for AI: /skills/agent-memory-context-2/raw/index.md