Load Context - Memory Fabric Initialization
Auto-load relevant memories at session start from the knowledge graph, with optional Mem0 semantic memory enhancement if ork-memory-mem0 plugin is installed and MEM0_API_KEY is configured.
CC 2.1.6 Context-Aware: Loading adapts based on context_window.used_percentage .
Overview
-
Automatically: Invoked at session start via auto-invoke: session-start
-
Manually: Run /load-context to reload memories mid-session
-
After MCP reconnect: Refresh context if MCP servers were restarted
Context-Aware Loading Tiers
Memory Fabric adjusts how much context to load based on current context pressure:
Context Usage Decisions Blockers Entities Behavior
0-40% (Green) 5 3 5 Full context load
40-70% (Yellow) 3 1 3 Reduced context
70-90% (Orange) 1 critical only 0 Minimal context
90% (Red) 0 0 0 Skip, show hint only
Workflow
- Check Context Pressure
If context_window.used_percentage > 90%: → Output: "[Memory Fabric] Skipping - context at {X}%" → Exit early
If > 70%: Use minimal tier (1 decision, critical blockers only) If > 40%: Use reduced tier (3 decisions, 1 blocker, 3 entities)
- Query Recent Sessions (Mem0)
Call mcp__mem0__search_memories :
{ "query": "session context blockers next steps", "filters": { "AND": [ { "user_id": "{project}-continuity" }, { "created_at": { "gte": "7 days ago" } } ] }, "limit": 3, "enable_graph": true }
- Query Recent Decisions (Mem0)
Call mcp__mem0__get_memories :
{ "filters": { "AND": [{ "user_id": "{project}-decisions" }] }, "page_size": 5 }
- Query Graph Entities
Call mcp__memory__search_nodes :
{ "query": "recent decisions patterns" }
- Query Global Best Practices (Optional)
If the user has opted into global sharing (privacy.share_globally = true), query community best practices that may be relevant to the current project context.
Call mcp__mem0__search_memories :
{ "query": "{detected_technologies} best practices patterns", "filters": { "AND": [ { "user_id": "orchestkit-global-best-practices" }, { "metadata.confidence": { "gte": 0.8 } } ] }, "limit": 3, "enable_graph": true }
Where {detected_technologies} is inferred from:
-
Project dependencies (package.json, requirements.txt)
-
Recent file types being worked on
-
Entities mentioned in current conversation
Privacy Note: Global best practices are:
-
Contributed anonymously (anonymous_id only)
-
Opt-in (requires privacy.share_globally = true)
-
High-confidence only (confidence >= 0.8)
-
Project-agnostic (no project paths or secrets)
- Format Output
[Memory Fabric Loaded] ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Recent Decisions ({count}):
- [{time ago}] {decision_text}
Unresolved Blockers ({count}):
- {blocker_text} (session {date})
Active Entities ({count}):
- {entity} -> {relation} -> {entity}
Global Best Practices ({count}): # If opted-in
- {practice_text} ({confidence}% confidence)
Next Steps from Last Session:
- {step_1} ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Error Handling
MCP Unavailable
Show configuration hints and continue without that source:
[Memory Fabric] Mem0 MCP server unavailable. Run /configure to enable. Continuing without semantic memory...
No Memories Found
[Memory Fabric Loaded] No memories found for this project. This is normal for new projects. Use /remember to start building memory.
Related Skills
-
mem0-sync
-
Save context at session end
-
remember
-
Store decisions and patterns manually
-
recall
-
Search memories on-demand
Arguments
-
No arguments: Load context using default settings
-
--refresh : Force reload even if recently loaded
-
--verbose : Show detailed MCP query results