// case study · 2025
Cortex — Codebase Memory Engine
A local CLI daemon that continuously understands a codebase: 21 analysis agents, live file watchers, code-pattern extractors, and Transformers.js embeddings, with incremental loops in 118–197ms. Published to npm.
- // client
- Open Source
- // year
- 2025
- // role
- creator
- // stack
- typescript · node.js · transformers.js · cli · github actions
- // services
- CLI daemon
- Analysis agents
- Embeddings
- Open source

// outcomes
- 0121 analysis agents with live file watchers and pattern extractors
- 02Transformers.js embeddings running locally — no data leaves the machine
- 03Incremental analysis loops in 118–197ms
- 04Open source, published to npm, GitHub Actions CI
Cortex gives a codebase a working memory. It runs as a local daemon, watches files as they change, and keeps an up-to-date map of the project's structure, patterns, and active work — the context you'd otherwise have to reconstruct every session. (The CORTEX.md in this very repo was generated by it.)
21 agents, sub-200ms loops
The engine fans out across 21 analysis agents and computes embeddings locally with Transformers.js, so nothing leaves the machine. The hard constraint was latency: incremental loops land in 118–197ms, fast enough to stay live as you type.
Local CLI daemon with live file watchers
Code pattern extractors feeding a project map
Transformers.js embeddings, fully local
Published to npm with GitHub Actions CI