This skill enables the implementation of a robust memory architecture for autonomous agents. The goal is to overcome the limitation of the "volatile context window" through a layered system that organizes information by its usefulness, temporal relevance, and type of knowledge.
Mental Model: Memory is not a static store; it is a dynamic retrieval system. The agent must decide what to actively "remember" based on the current task, offloading the rest to lower-priority layers.
🚩 Fragility and Autonomy
- Fragility: Medium. Noisy memory retrieval can derail the agent (Context Poisoning).
- Freedom: High in the choice of backends (Vector DB, Graph, Local JSON).
🚀 When to Activate
- When building agents that operate across multiple sessions (cross-session continuity).
- For systems that require deep personalization based on user preferences.
- When managing massive technical knowledge bases that do not fit (or should not fit) in a single prompt.
- To implement "working memory" that survives context compaction.
🧠 Core Concepts: The Memory Layers
1. Working Memory
- Location: Active context window (Prompt + recent History).
- Function: Immediate task state, local variables, current plan.
- Capacity: High signal, low latency, volatile.
2. Episodic Memory
- Location: Logs of previous sessions, vector databases.
- Function: "What did we do last time?", "How did we solve error X".
- Structure: Sequential and temporal.
3. Semantic Memory
- Location: RAG, documentation, Knowledge Graphs.
- Function: Facts, business rules, DB schemas, code standards.
- Structure: Graph of concepts and entities.
4. Procedural Memory
- Location: Skills (
SKILL.md), scripts, templates. - Function: "How is X done?", "Steps for a successful deployment".
🛠️ Implementation in Gemini Elite Core
Pattern: Hybrid Retrieval (Vector + Entity)
Do not rely solely on semantic similarity. Use entity extraction to filter out noise.
- Extraction: Identify entities in the task (e.g.
Auth.js,Supabase). - Filtering: Retrieve only memories that contain those tags.
- Ranking: Sort by semantic relevance and temporal recency.
Pattern: Memory Consolidation
Trigger a "dream/summary" process after each important task to move findings from Working Memory to Episodic Memory.
<TASK_COMPLETE>
- Descubrimiento: El endpoint /v2/auth requiere el header 'X-Agent-ID'.
- Acción: Persistir en preferences.yaml y vector_store.
</TASK_COMPLETE>
🔗 Integrations
context-fundamentals: Context is the final destination of the retrieved memory.filesystem-context: Disk usage for persistence of layers 2, 3, and 4.bdi-mental-states: Use of episodic memory to update beliefs.
📚 Internal References
references/implementation.md: Technical integration guide with Mem0, Cognee, and Graphiti. Implementation of basic vector stores.