一键导入
managing-memory
Manage the Antigravity Dual-Storage Memory system (SQL + Vector) and implement cognitive lifecycle hooks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Manage the Antigravity Dual-Storage Memory system (SQL + Vector) and implement cognitive lifecycle hooks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Automated governance, hook installation, pre-commit validation, branch isolation, and safe commit operations.
Enforcement of safety guardrails, axiom verification, secret scanning, and mutability protections.
Building and managing premium statistical dashboards, RAG explorer UIs, warehouse log monitors, and real-time visualization centers.
Integration of agent systems with blockchain protocols, contracts, event stores, reputation networks, and collective verification engines.
AI model configuration, LLM memoization, agentic RAG search, and vector library maintenance.
Catalog generation, reference link verification, workshop documentation building, and knowledge gap analysis.
| agents | ["python-ai-specialist"] |
| category | chain |
| description | Manage the Antigravity Dual-Storage Memory system (SQL + Vector) and implement cognitive lifecycle hooks. |
| knowledge | ["cognitive-memory-patterns.json"] |
| name | managing-memory |
| related_skills | ["None"] |
| templates | ["none"] |
| tools | ["search_memory_entity","search_memory_semantic","search_memory_procedural","search_memory_summary","prepare_context","add_memory_entity","add_memory_summary","add_memory_episodic","propose_memory_semantic","propose_memory_procedural","propose_memory_toolbox"] |
| type | skill |
| version | 2.0.0 |
| references | ["none"] |
| settings | {"auto_approve":false,"retry_limit":3,"timeout_seconds":300,"safe_to_parallelize":false,"orchestration_pattern":"routing"} |
Automated Cognitive Memory System - Conversation, Long-term, and Episodic backend implementations inside the framework.
Implement memory systems for agents using the standard Dual-Storage approach:
sessionStart, sessionEnd).from scripts.memory.memory_database import MemoryDatabase
db = MemoryDatabase()
# Fetch history
history = db.get_chat_history(thread_id="session_123", limit=10)
for msg in history:
print(f"[{msg['role']}] {msg['content']}")
# Fetch tool logs
tools = db.get_tool_logs(thread_id="session_123", limit=5)
from scripts.memory.memory_store import get_memory_store
from scripts.memory.memory_config import COLLECTION_SEMANTIC
store = get_memory_store()
# Retrieve distilled knowledge
results = store.search("architecture patterns", memory_type=COLLECTION_SEMANTIC, k=3)
for result in results:
print(result.content)
from scripts.memory.entity_store import get_entity_store
entity_store = get_entity_store()
# Extract and persist mentions
entity_store.extract_and_store_entities(
text="The user deployed to the AWS staging cluster.",
source_context="Deploy script discussion"
)
To ensure agents have access to workflows and skills, trigger the parent-child chunk indexer:
from scripts.memory.procedural_indexer import ProceduralIndexer
indexer = ProceduralIndexer()
indexer.index_all() # Indexes .agent/workflows and .agent/skills
While direct Python imports are available for infrastructure scripts, Agents should prioritize the qdrant-rag MCP tools for better isolation and observability.
Use add_memory_* tools for facts that are verified and don't require structural induction.
# Example Tool Call (Logical)
add_memory_entity(content="User preferred OS: Windows", metadata={"priority": "high"})
Use propose_memory_* for new rules, workflows, or scripts. These go into a "Pending" queue for user approval (A2).
# Example Tool Call (Logical)
propose_memory_semantic(
content="Always use 'mcp_infra' for local mcp servers to avoid shadowing.",
reasoning="Prevents ImportError conflicts with the official mcp library."
)
Use prepare_context to fetch a fused view of all memory tiers for a given query.
# Example Tool Call (Logical)
context = prepare_context(query="how to debug mcp servers")
| Type | Human Analogy | Storage | Retrieval |
|---|---|---|---|
| Conversational | Short-term memory | SQL (chat_history) | Exact Match |
| Tool Log | Audit trail | SQL (tool_logs) | Exact Match |
| Semantic | Long-term facts | Vector DB (memory_semantic) | Semantic Search |
| Procedural | Learned paths | Vector DB (memory_procedural) | Semantic Search |
| Toolbox | Capabilities | Vector DB (memory_toolbox) | Semantic Search |
| Entity | Episodic entities | Vector DB (memory_entity) | Semantic Search |
| Summary | Condensed session | Vector DB (memory_summary) | Semantic Search |
memory_summary.ReflectionEngine evaluates multiple summaries, finding structural trends and converting them to memory_semantic.GovernanceGates.This skill should be used when interfacing with the dual-storage cognitive database.
/scripts/memory.COLLECTION_SEMANTIC, COLLECTION_PROCEDURAL etc. from memory_config.py instead of short aliases.store.close() after test usage to release Windows file handles.mcp, json, path) if the project root is in sys.path. Use suffixes like _infra or _custom to prevent ImportError collisions._store_ready event or provide a sufficient timeout to allow the embedding models to load in the background.