Loading...
Loading...
Mine Gmail history into a local flat-file knowledge base (~/.cortex/). Use when asked to "run the cortex", "mine emails", "cortex run", "cortex dry run", "set up the cortex", "cortex from DATE", or "mine my inbox". Extracts contacts, clients, communications and knowledge facts into portable JSONL/JSON files. Requires gws CLI and ANTHROPIC_API_KEY.
npx skill4agent add jezweb/claude-skills cortex-mine~/.cortex/{skill_path}/references/file-schema.md| What user says | Action |
|---|---|
| "run the cortex" / "cortex run" | Run mining pass |
| "cortex dry run" | Mine without writing — pass |
| "cortex from DATE" | Mine from specific date — pass |
| "set up the cortex" | Run first-time setup |
which gws || echo "MISSING: npm install -g @googleworkspace/cli"
python3 -c "import anthropic" 2>/dev/null || echo "MISSING: pip install anthropic"
ls ~/.cortex/state.json 2>/dev/null || echo "FIRST RUN"gwsnpm install -g @googleworkspace/cligws auth setupanthropicpip install anthropicpip install anthropic --break-system-packagesmkdir -p ~/.cortex/originals
echo '{}' > ~/.cortex/contacts.json
echo '{}' > ~/.cortex/clients.json
touch ~/.cortex/communications.jsonl ~/.cortex/knowledge.jsonl ~/.cortex/files.jsonl~/.cortex/state.json{"version":"1.0","cursors":{"gmail":null},"last_run":null,"totals":{"contacts":0,"clients":0,"communications":0,"knowledge":0,"files":0},"runs":[]}python3 {skill_path}/scripts/cortex-mine.py
python3 {skill_path}/scripts/cortex-mine.py --dry-run
python3 {skill_path}/scripts/cortex-mine.py --from 2024-01-01
python3 {skill_path}/scripts/cortex-mine.py --batch-size 25gws: command not foundAuthError403gws auth setupANTHROPIC_API_KEY not set~/.cortex/.envModuleNotFoundError: anthropicpip install anthropicRun the cortex-mine skill/loop 24h run the cortex-mine skill0 6 * * * cd ~ && ANTHROPIC_API_KEY=sk-... python3 /path/to/cortex-mine.py{skill_path}/references/export-adapters.md| Variable | Default | Purpose |
|---|---|---|
| | Storage root |
| — | Required for extraction |
| | Threads per run |
| — | Your email — excluded from contacts |
{skill_path}/references/file-schema.md{skill_path}/references/prefilter-patterns.md{skill_path}/references/export-adapters.md