· 2 min read
Building an AI coding assistant that actually understands your codebase — from incremental SHA-256 indexing and LSP-powered static analysis to semantic search with reranking. Multi-agent orchestration with LangGraph, zero hallucinations.
Most AI coding assistants treat your codebase like a giant paste bin. They cram everything into prompts, hope the model finds relevant context, and cross their fingers. I built Cortex because I was tired of that approach — a coding assistant that actually reads and understands your code.
Chunk your files, embed them, run similarity search — that's the standard RAG playbook. It works fine for blog posts and documentation but falls apart on code. Code has structure, dependencies, and context that flat text chunks destroy. I needed something better.
Nobody wants to re-index their entire codebase every time they save a file. Cortex computes SHA-256 hashes for every file and only re-indexes what changed. Combined with a real-time file watcher, it stays in sync without wasting compute. The result: near-instant indexing even for large repositories.
Raw text isn't enough. Cortex integrates with the Language Server Protocol to understand symbols, references, and type information. It knows what functions call what, where classes inherit from, and which imports actually matter. This semantic understanding is what separates a dumb chunker from a real code assistant.
Cortex doesn't use a single monolithic agent. Instead, it orchestrates specialized agents through LangGraph — one for semantic search with reranking, one for static analysis, another for code generation. Each agent has a defined role and they collaborate through structured messages. Think of it like a dev team, not a solo junior.
Every response is grounded in retrieved context. If the agents can't find relevant information, they say so — no made-up functions or imaginary APIs. This strict grounding is non-negotiable for a developer tool. You can't ship code based on an AI hallucination.
Cortex is open source and available on GitHub. It supports both local models via Ollama and OpenAI, with multi-project management built in.