DEV Community

GZOO
GZOO

Posted on

Cortex – A Local-First Knowledge Graph for Developers

I work on multiple projects. Decisions, patterns, and context end up scattered across hundreds of files. I forget what I decided three months ago. I re-solve problems I already solved in another repo.

So I built Cortex — a local-first knowledge graph for developers.

It watches your project directories, extracts knowledge automatically using LLMs, and gives it back to you when you need it.

What it does

  • Watches your project files (md, ts, js, json, yaml) for changes
  • Extracts entities: decisions, patterns, components, dependencies, constraints
  • Infers relationships between entities across projects
  • Detects contradictions when decisions conflict
  • Queries in natural language with source citations
  • Routes intelligently between cloud and local LLMs

How it works

Cortex runs locally. You point it at your project directories and it builds a knowledge graph in the background. When you query it, you get answers grounded in your actual codebase — not hallucinated guesses.

The extraction pipeline uses configurable LLM providers (OpenAI, Anthropic, Ollama, LM Studio) so you can keep everything local if you want.

Quick start

npx @gzoo/cortex init
npx @gzoo/cortex watch ~/projects
npx @gzoo/cortex query "what patterns am I using for error handling?"
Enter fullscreen mode Exit fullscreen mode

Why I built this

I kept losing context. Not code — context. The reasoning behind decisions, the constraints I discovered, the patterns I settled on. Cortex captures that stuff automatically so I can actually find it later.

It's open source, MIT licensed, and on npm.

GitHub: github.com/gzoonet/cortex
npm: npmjs.com/package/@gzoo/cortex

Would love feedback. What kinds of knowledge do you lose track of across projects?

Top comments (0)