Darkplex Intelligence Layer v0.2.0 — governance, knowledge extraction, self-improvement
Find a file
Claudia 0484c6321a
Some checks failed
Tests / test (push) Failing after 5s
feat(memory): add session memory persistence module
New cortex/memory/ module that provides:
- boot_assembler: builds BOOTSTRAP.md from threads, decisions, narrative
- thread_tracker: tracks conversation threads across sessions via NATS
- narrative_generator: daily narrative with Ollama LLM (fallback: structured)
- pre_compaction: snapshot pipeline before context compaction

CLI commands:
- cortex memory bootstrap [--dry-run] [--workspace DIR]
- cortex memory snapshot [--workspace DIR]
- cortex memory threads [--summary] [--hours N]

All paths configurable via WORKSPACE_DIR, NATS_URL, AGENT_NAME env vars.
No hardcoded paths. Works with any OpenClaw agent.

Fixes array/dict handling for empty threads.json and decisions.json.
2026-02-13 11:52:25 +01:00
.forgejo/workflows ci: fix PATH for pip on dock5 host runner 2026-02-09 11:58:33 +01:00
cortex feat(memory): add session memory persistence module 2026-02-13 11:52:25 +01:00
tests feat: DPO preference pair extractor 2026-02-12 10:01:32 +01:00
.gitignore Merge darkplex-core into cortex — unified intelligence layer v0.2.0 2026-02-12 08:43:02 +01:00
Dockerfile feat: initial cortex package — 8 intelligence modules, CLI, Docker 2026-02-09 11:18:20 +01:00
pyproject.toml Merge darkplex-core into cortex — unified intelligence layer v0.2.0 2026-02-12 08:43:02 +01:00
README.md refactor: remove all hardcoded paths, use env vars + config 2026-02-09 12:13:18 +01:00

Cortex 🧠

Intelligence layer for OpenClaw. The higher-order thinking above the nervous system.

Modules

Module Command What it does
Triage cortex triage score "text" Priority scoring (urgency × importance × effort × readiness)
Health Scanner cortex health [--json] Proactive system health checks
Feedback Loop cortex feedback --since 6h Extract lessons from session transcripts
Memory Hygiene cortex hygiene stats|stale|duplicates|orphans|archive Keep memory clean
Roadmap cortex roadmap list|add|overdue|report Task tracking with deadlines & dependencies
Validate cortex validate --transcript <path> Sub-agent output validation
Enhanced Search cortex search "query" Multi-strategy memory search
Auto Handoff cortex handoff <file> Generate session handoff documents

Install

pip install -e .

Configuration

Cortex uses environment variables for path configuration. All paths have sensible defaults (~/.cortex/).

Variable Default Description
CORTEX_HOME ~/.cortex Base directory
CORTEX_MEMORY_DIR $CORTEX_HOME/memory Memory files
CORTEX_CONFIG $CORTEX_HOME/config.json Config file
CORTEX_GROWTH_LOG $CORTEX_MEMORY_DIR/growth-log.md Feedback loop output
CORTEX_ROADMAP $CORTEX_MEMORY_DIR/roadmap.json Roadmap data

Optional config.json for customization:

{
  "permanent_files": ["MEMORY.md", "WORKING.md", "README.md"],
  "sessions_dir": "~/.openclaw/agents/main/sessions"
}

Docker

docker build -t cortex .
docker run cortex triage score "production down"

Tests

python -m pytest tests/ -v

Architecture

Cortex is a standalone Python package that OpenClaw calls via CLI. No tight coupling, no plugin system — just clean Unix-style commands.

OpenClaw (Node/TS)
    │
    ├── cortex triage score "..."    ← CLI calls
    ├── cortex health --json
    ├── cortex feedback --since 6h
    └── cortex hygiene stats
         │
         └── Cortex (Python)
              ├── triage.py
              ├── health_scanner.py
              ├── feedback_loop.py
              ├── memory_hygiene.py
              ├── roadmap.py
              ├── validate_output.py
              ├── enhanced_search.py
              └── auto_handoff.py

License

MIT