Manage session state, memories, and context engineering
Manage persistent session state, memories, and decisions across conversations. Use this to track tasks, record architectural choices, and retrieve relevant context automatically.
/plugin marketplace add v1truv1us/ai-eng-system/plugin install ai-eng-system@ai-eng-marketplaceManage the context engineering system including sessions, memories, and context assembly.
Take a deep breath and approach context management systematically, ensuring memories are stored correctly, organized logically, and retrieved efficiently when needed.
Context system provides persistent session state and intelligent memory management across conversations. Poor context management leads to lost knowledge, repeated learning, and inefficient AI interactions. This context work is critical for maintaining productive long-term conversations and accumulating valuable insights over time.
I bet you can't organize context and memories in a way that balances specificity with generalizability. The challenge is capturing details precisely enough to be useful later, while making them general enough to apply across multiple scenarios. Success means context system enables efficient retrieval without overwhelming noise or irrelevant information.
The context system provides persistent session state, intelligent memory management, and optimized context retrieval across conversations.
context statusShow current session state and memory statistics.
/context status
Output:
context rememberManually save a memory entry.
/context remember "User prefers Bun over Node.js" --type=declarative --tags=preference,build
Options:
--type - Memory type: declarative, procedural, or episodic (default: declarative)--tags - Comma-separated tags for categorization--context - Additional context about where this was learnedcontext searchSearch memories by content or tags.
/context search "database optimization" --type=procedural
/context search --tags=decision,architecture
Options:
--type - Filter by memory type--tags - Filter by tags (comma-separated)--confidence - Minimum confidence threshold (0-1)context taskManage pending tasks in the current session.
/context task add "Implement authentication" --priority=high
/context task list
/context task complete <task-id>
Subcommands:
add <content> - Add a new tasklist - Show all pending taskscomplete <id> - Mark task as completedstatus <id> - Show task detailsOptions:
--priority - Task priority: low, medium, high (default: medium)context decisionRecord architectural or design decisions.
/context decision "Use microservices architecture" \
--rationale="Allows independent scaling and deployment" \
--alternatives="Monolith,Modular monolith" \
--tags=architecture,scalability
Options:
--rationale - Why this decision was made--alternatives - Comma-separated list of alternatives considered--tags - Decision tags for categorizationcontext exportExport session or memories for backup or sharing.
/context export session --format=json
/context export memories --type=declarative --format=json
Options:
--format - Export format: json or markdown (default: json)--type - Memory type to export (optional)--output - Output file path (default: stdout)context archiveArchive the current session and start fresh.
/context archive
This moves the current session to the archive and creates a new session.
context summaryGet a context summary for inclusion in prompts.
/context summary --max-memories=5
Options:
--max-memories - Maximum memories to include (default: 5)--include-session - Include session state (default: true)Sessions are automatically created when you first use the context system. The session persists across conversations.
As you work, the system automatically:
When you're done with a project or want to start fresh:
/context archive
This preserves all session data for future reference while starting a clean slate.
Facts, patterns, and preferences learned from the user or inferred from behavior.
Examples:
Workflows, habits, and procedures that guide how work is done.
Examples:
Summaries of past conversations, sessions, and events.
Examples:
The system intelligently assembles context based on what you're doing:
Automatically loaded when:
Retrieved when you:
Enabled by default - the system automatically learns from your conversations and actions:
All inferred memories have lower confidence (0.7) and decay over time, allowing the system to learn while avoiding false assumptions.
The context system uses Progressive Disclosure Architecture to minimize token usage:
This achieves ~90% token reduction compared to loading all resources upfront.
/context task add "Implement authentication" --priority=high
/context decision "Use JWT tokens for stateless auth" \
--rationale="Scales better than session-based auth" \
--tags=security,authentication
/context remember "JWT tokens stored in httpOnly cookies" \
--type=procedural --tags=security,authentication
The system automatically learns from natural conversation:
You say: "I prefer using TypeScript over JavaScript for type safety"
System learns: User preference: TypeScript for type safety (declarative memory)
You say: "Let's implement this using React hooks"
System learns: Using React hooks for implementation (procedural memory)
You ask: "Should I use Express or Fastify for the API?"
System learns: Considering Express or Fastify for API (episodic memory)
You edit code with: import React from 'react'
System learns: Project uses React (declarative memory)
/context search --tags=architecture
/context search "database" --type=procedural
/context export session --format=json --output=session-backup.json
/context export memories --format=markdown --output=memories.md
The context system integrates with other ai-eng-system commands:
/plan - Saves decisions and context for the plan/work - Tracks tasks and progress in the session/review - References past decisions and patternsContext operations are optimized for speed:
Configuration is per-project - each project can have its own settings in .ai-context/config.json.
If you prefer explicit control over context learning:
# Create project-specific config
mkdir -p .ai-context
echo '{
"enableAutoInference": false
}' > .ai-context/config.json
# Use a different storage directory
echo '{
"storagePath": ".my-context"
}' > .ai-context/config.json
{
"storagePath": ".ai-context",
"maxMemoriesPerType": 100,
"sessionArchiveDays": 30,
"confidenceDecayRate": 0.05,
"enableEmbeddings": false,
"defaultSkillTier": 1,
"enableAutoInference": true
}
Note: Configuration is loaded hierarchically:
.ai-context/config.json)All context data is stored locally in .ai-context/ directory:
Add .ai-context/ to .gitignore to keep it out of version control.
After completing context operations, rate your confidence in data integrity and organization (0.0-1.0). Identify any uncertainties about memory classification, potential data loss risks, or areas where context retrieval may be inefficient. Note any operations that failed or had unexpected behavior.
/contextLoad living docs context for a topic into the current conversation. Use before implementation to get relevant specs, ADRs, and architecture docs. Keywords - context, load context, get context, living docs context, inject context.