Cortex — self-evolving memory and agent fleet — store, search, and manage memories with semantic search across all projects
Resources
28Install
npx skillscat add digin1/cortex Install via the SkillsCat registry.
Cortex Memory System
You have access to a persistent vector memory database (ChromaDB) via MCP tools. This memory is global — shared across all projects.
IMPORTANT: Always use the MCP tools (mcp__cortex__memory_store, etc.) — NEVER call memory_db.py via Bash. The MCP tools provide clean CLI output with spinners and status messages.
MCP Tools Available
memory_store— Store a memory with embeddingmemory_search— Semantic similarity searchmemory_list— List all memories (with optional filters)memory_delete— Delete by IDmemory_update— Update content or metadatamemory_stats— Show DB statistics
Interpreting the user's request
Parse $ARGUMENTS to determine the command:
/cortex store <content>→ callmemory_store/cortex search <query>→ callmemory_search/cortex list→ callmemory_list/cortex delete <id>→ callmemory_delete/cortex update <id> <content>→ callmemory_update/cortex stats→ callmemory_stats/cortex agents→ run agent fleet dashboard (see below)/cortex discover→ auto-discover project skills with web research (see below)/cortex learn→ session review (see below)/cortexwith no args → callmemory_stats
When storing, always:
- Choose an appropriate
memory_typebased on content (user, feedback, project, reference, general) - Generate a meaningful
memory_id(e.g.,feedback_no_emojis,user_role_datasci) - Add relevant
tags
When searching, show results in a readable format with ID, content, type, and similarity score.
Agent Fleet Dashboard (/cortex agents)
When the user runs /cortex agents, provide a comprehensive fleet health report by running:
python3 -W ignore ~/.claude/skills/cortex/agent_dashboard.py 2>/dev/nullThen format the JSON output into a readable table showing:
- Agent name, scope (user/project), model
- Usage count and last used date (from
~/.claude/agent-usage.jsonl) - Latest eval score and notes (from cortex
agent_evaltype memories) - Health indicator based on score + usage
If the user says /cortex agents <name>, show detailed info for that specific agent (read its .md file, full eval history, usage timeline).
Skill Discovery (/cortex discover)
When the user runs /cortex discover, perform a deep skill discovery for the current project. Unlike the automatic SessionStart hook (which uses LLM knowledge only), this manual command uses web research for more detailed, current results.
Steps:
- Detect tech stack — run the detector:
/usr/bin/python3 ~/.claude/skills/cortex/lib/skill_detect.py "$(pwd)" 2>/dev/nullShow detected frameworks — display what was found and ask the user if they want skills for all or specific ones.
Research online — for each framework the user wants skills for:
- Use
WebSearchto find current best practices, patterns, and conventions (e.g., "FastAPI best practices 2026", "Next.js app router patterns") - Use
WebFetchto read authoritative docs if needed - Also
Readthe actual project code to understand the user's specific patterns and conventions
- Use
Generate skill files — create
.mdcommand files that encode:- Framework-specific best practices from web research
- Project-specific patterns from code analysis
- Testing approaches appropriate for the framework
- Common scaffolding patterns
- Each skill should have YAML frontmatter with
description:and a detailed prompt body
Write files — use
Writeto create.mdfiles in:.claude/commands/(project-level, framework-specific skills)~/.claude/commands/(global, cross-project utility skills)- Use kebab-case filenames matching the command name (e.g.,
fastapi-endpoint.md→/fastapi-endpoint)
Store in cortex — record what was discovered using
memory_store:memory_id:skill_discovery_<project_name>memory_type:project- Content: list of created skills and frameworks covered
Report — show the user what skills were created and how to use them (e.g., "Run
/fastapi-endpoint create user endpointto scaffold a new endpoint").
Quality guidelines for generated skills:
description:must be clear and actionable (shown in command palette)- Body must contain SPECIFIC instructions, not generic advice
- Include framework conventions, file structure patterns, testing idioms
- Use
$ARGUMENTSto accept user input - Keep each skill focused on ONE task (scaffold, test, debug, deploy)
- Max 5-7 skills per framework — pick the most useful ones
Example skill file (for reference):
---
description: Scaffold a new FastAPI endpoint with Pydantic models and tests
---
Create a new FastAPI endpoint based on the user's description: $ARGUMENTS
Follow these conventions:
1. Use async def for route handlers
2. Define Pydantic models for request/response in a models file
3. Use Depends() for shared dependencies (db, auth)
4. Add proper status codes (201 create, 404 not found, 422 validation)
5. Include OpenAPI metadata: summary, description, response_model
6. Add the route to the appropriate router
7. Write tests using TestClient covering success + error paths
8. Follow the existing project structure and naming conventionsSession Review (/cortex learn)
When the user runs /cortex learn, review the current conversation and extract any learnings worth persisting. Look for:
- Feedback — corrections the user made, approaches they approved/rejected, preferences expressed
- Project — decisions, constraints, or context about ongoing work that isn't in the code
- Reference — external resources, deployment patterns, or lookup info discovered
- User — new info about the user's role, expertise, or working style
For each finding:
- Check if a similar memory already exists (use
memory_search) — update rather than duplicate - Store with a descriptive
memory_id, appropriatememory_type, and relevanttags - Include the project name if the learning is project-specific
Report what you stored in a brief summary. If nothing new was learned, say so.