Skip to content

Releases: nano-step/cortex

v4.5.0 Hippocampus — 7-Tier Fuzzy Matching Engine

30 Mar 16:48

Choose a tag to compare

Hippocampus — The Brain's Pattern Matching Center

This release rebuilds Cortex's code editing engine with a 7-tier fuzzy matching cascade researched from Aider, Cline, and Continue.

7-Tier Matching Engine

Tier Strategy Handles
1 Uniform indent detection Wrong indentation → auto re-indent replacement
2 Whitespace-normalized Each line trimmed independently
3 Skip spurious blank line LLM adds extra blank → remove, retry
4 Block anchor First/last line anchors for 3+ line blocks
5 Ellipsis/dotdotdots ... wildcards for unchanged sections
6 Levenshtein + bracket protection Distance-proportional threshold, structural lines exact
7 Variable-length window ±10% block size tolerance

Also

  • Indent-aware replacement: auto re-indent when offset detected
  • Quality gate: reject fuzzy match if >50% lines removed
  • cortex_edit_file_lines: NEW tool — edit by line range
  • Better error feedback: findSimilarBlock with ±3 lines context
  • Filesystem tools: 9 → 11

Full Changelog: v4.4.0...v4.5.0

v4.4.0 "Thalamus"

30 Mar 15:56

Choose a tag to compare

v4.4.0 "Thalamus" — Full-Stack Activation

Thalamus — the brain's relay station, routing signals to exactly the right region for processing.

What Changed

Previously, ~80% of queries bypassed Cortex's agent/skill infrastructure and went straight to RAG→LLM. This release fixes that.

Phase 1 — Smart Pipeline Routing

determinePipelinePath() now uses routing category as primary signal:

Category Before After
deep / ultrabrain standard (confidence < 0.8) orchestrate (always)
visual-engineering standard skill_chain + playwright directives
unspecified-high standard orchestrate
quick / unspecified-low standard standard (unchanged)

Confidence thresholds lowered: skill_chain 0.7→0.5, orchestrate 0.8→0.6.

Phase 2 — Category → Skill Auto-Activation

Skill directives injected into system prompt automatically per category — no slash command needed:

  • deep → code-analysis + react-agent (trace call chain, root cause first)
  • ultrabrain → plan-execute + react-agent (plan before implement)
  • visual-engineering → playwright-browser
  • writing → react-agent (structure, prose quality)

Phase 3 — Proactive Background Agents

  • deep / ultrabrain → explore + librarian fire in parallel
  • visual-engineering / unspecified-high → explore fires
  • Results merge into context if ready within 2s

Phase 4 — Loop Auto-Activation

  • Keywords "liên tục", "không dừng", "until done", "autonomous" → Ralph loop auto-starts
  • Category ultrabrain + query > 300 chars → Ultrawork loop
  • Completion detection from response content (hoàn thành / done / complete)

Phase 5 — Training Feedback Loop Closed

  • notifyChatStarted() at pipeline entry
  • notifyPostChat() + notifyChatEnded() after every successful response
  • AutoScan scheduler now receives signal after every interaction

Model Routing Fixes

  • routeToModel() cross-references live model status — never routes to quota_exhausted model
  • Eliminated hardcoded gpt-4o-mini fallback causing 400 errors
  • model-fallback hook uses dynamic ready models sorted by tier

OMO Infrastructure Integration

  • Hook system fully wired: on:session:start, on:tool:call, session lifecycle hooks
  • Plugin config (cortex-config.jsonc): per-agent/category model overrides, hook disable list
  • 60s stale task detection + cleanup interval

Impact

Metric Before After
Queries using multi-agent orchestration ~20% >60%
Background agents (deep/ultrabrain) ~30% 100%
Loop activation Manual only Auto
Training signal per interaction 0 100%
Latency for quick queries baseline unchanged

v4.3.0 "Synapse"

30 Mar 15:49

Choose a tag to compare

v4.3.0 "Synapse" — Document Intelligence, 10 Core Policies, Architecture Hardening

Document Intelligence

  • cortex_read_document — agents can read PDF, DOCX, XLSX, CSV, HTML at query time
  • Priority-based converter registry with graceful degradation
  • Section-aware chunking by H1–H3 headers; new ChunkType "document"
  • Brain engine Phase 1.5: documents converted to markdown before embedding
  • DocumentMetadataHeader UI: file icon, filename, page/sheet/row count badges

Agent Brain Upgrade — 10 Core Policies

Distilled from Claude Code, Cursor v1–v2, Devin AI, Windsurf Cascade:

  • [autonomous-loop] — Work until COMPLETE, no premature stopping
  • [tool-first-policy] — NEVER guess; use tools to investigate
  • [parallel-execution] — All independent tool calls fired simultaneously
  • [anti-hallucination] — Never invent file names, APIs, or dependencies
  • All 15 agents upgraded with CORE_POLICIES

Filesystem Tools Overhaul (4 → 9 tools)

  • cortex_read_files — batch read up to 10 files via Promise.all
  • cortex_grep_search — regex search, auto-skips node_modules/dist/binary
  • cortex_edit_files — batch apply multiple edits across multiple files
  • cortex_move_file + cortex_delete_file — safe rename and delete
  • cortex_read_file: 10MB limit, offset+limit chunk reading
  • Progressive edit fallback: exact → whitespace-normalized → nearest-line hint
  • Unrestricted mode: AI can read/write any file on the machine (opt-in)

429 Rate Limit Resilience

  • Dynamic model resolution: queries live model list instead of hardcoded names
  • Tier-based selection: fast → tier 1–5, balanced → tier 5–7, premium → tier 8–10
  • Exponential backoff with jitter (±30%) for all agent pool retries
  • Retry-After header support

Architecture Hardening

  • IPC Modules: main.ts split into 9 domain modules
  • HybridVectorStore: unified interface, auto-selects Qdrant → SQLite
  • Circuit Breaker: timed open/half-open/close + daily budget guard ($0.50/day)
  • Graph Incremental Rebuild on every sync
  • Brain Snapshot: auto-snapshot before re-index, restore to previous state
  • Ollama Embedding: local fallback provider (nomic-embed-text)

v4.2.0 "Synapse" — Document Intelligence & Agent Brain Upgrade

25 Mar 17:36

Choose a tag to compare

Cortex v4.2.0 — Synapse

Synapse — the junction between neurons where signals are transmitted. This release connects Cortex to a broader universe of information: any document type, structured data, and the proven wisdom of the world's best AI systems.


What's New

Document Intelligence — inspired by microsoft/markitdown ⭐ 92K

Cortex can now read, index, and answer questions about documents — not just code.

Format How
PDF Text extraction via pdf-parse
DOCX mammoth → HTML → markdown
XLSX / XLS Per-sheet markdown tables
CSV RFC 4180 compliant (handles quoted commas)
HTML turndown markdown conversion
  • cortex_read_document — New AI tool: agents read any document at query time
  • Brain indexing — PDFs, DOCX, spreadsheets fully indexed during project sync
  • UI metadata badge — File icon, name, page count, sheet names shown in chat
  • chunkDocument() — Section-aware chunking by H1–H3 headers; new ChunkType 'document'

Agent Brain Upgrade — 37+ AI tools studied

All 15 specialized agents now share 10 production-proven policies from Claude Code, Cursor v2, Devin AI, Windsurf Cascade:

[autonomous-loop] · [tool-first-policy] · [parallel-execution] · [semantic-search-first] · [anti-hallucination] · [verbosity-calibration] · [code-style-mirror] · [incremental-planning] · [uncertainty-resolution] · [context-injection-awareness]

Fixed

  • CSV parser now RFC 4180 compliant — quoted fields with embedded commas handled correctly
  • PDF converter API corrected for pdf-parse v2.x
  • XLSX converter uses RFC 4180 compliant parser

Install

Download Cortex-4.2.0-arm64.dmg below (Apple Silicon).

Build from Source

git clone https://github.com/nano-step/cortex.git
cd cortex && npm install && npm run dist:mac

See CHANGELOG.md for full history.