How it works

From a commit to a cited answer.

Cortex watches git, keeps a vector index of the markdown current, and answers questions from the passages it retrieves. It runs on one machine for one person.

Indexing

Four steps, every 30 seconds.

  1. Discover

    Cortex walks its scan roots and treats each folder with a .git directory as a repository. Repositories on an exclusion list are never entered.

  2. Compare

    For each repository it asks git for HEAD. If it matches the commit it indexed last time, the repository is skipped.

  3. Diff

    A changed repository gets one git diff, limited to markdown. A new repository gets a full listing of its markdown files.

  4. Embed

    Added and modified files are chunked, embedded, and written to Milvus. Deleted and renamed files lose their old chunks.

Cortex's Status page: six tiles (repos, files, chunks, Milvus, embedder, last tick) above a table of the five indexed repositories with their file counts, chunk counts, and last commit.Cortex's Status page: six tiles (repos, files, chunks, Milvus, embedder, last tick) above a table of the five indexed repositories with their file counts, chunk counts, and last commit.
Status: five repositories indexed, each with its last commit.
Chunking and storage

Split by heading, stored by meaning.

These are the defaults. Each one is a setting.

Indexing defaults
SettingDefaultWhat it does
Files indexed.md, .markdown, .mdxMarkdown only. Source code is not indexed today.
Poll interval30 secondsHow often each repository's HEAD is checked.
Loose-file scanAt most every 10 minutesMarkdown that lives outside any repository is found by walking the folder, which costs more than a HEAD check.
Chunk size500 tokens, 50 overlapHeadings split first. A section that is still too long is split again. Code fences are never cut.
Smallest chunk100 tokensAnything shorter merges into the previous chunk.
Embeddingsvoyage-context-4, 1,024 dimensionsChunks of one file are embedded together, so each carries some of its document's context.
IndexMilvus HNSW, cosineThe collection holds each chunk's text, repository, path, heading trail, and commit.
Search and answers

Search finds passages. Ask writes from them.

Search returns the closest chunks as they are. Ask hands those chunks to Claude with one rule: answer only from this text, and cite it.

Ask modes
ModeModelChunksLength
Sonnet (depth)Claude Sonnet 5.512Up to 1,024 tokens
FastClaude Haiku 4.56At most three sentences

The system prompt is cached between questions. Every claim in an answer carries a [repo:path#section] citation, and the page turns those into chips. If the retrieved text does not contain the answer, the reply is "Not in the index."

Cortex's Search page with a repository filter: five ranked passages from one repository, each with its path, heading trail, and score.Cortex's Search page with a repository filter: five ranked passages from one repository, each with its path, heading trail, and score.
Search with a repository filter: five passages, ranked.
Cortex's Ask page in Fast mode: six retrieved chunks and a short cited answer naming who must approve an over-the-air release.Cortex's Ask page in Fast mode: six retrieved chunks and a short cited answer naming who must approve an over-the-air release.
Fast mode: six chunks, a short answer, and its citations.
Boundaries

What stays, what leaves, what is kept out.

Where text goes
WhereWhat it receives
Local MilvusEvery chunk and its vector. This is the index, and it stays on the machine.
VoyageChunk text, to be embedded, and each question.
AnthropicA question and the chunks retrieved for it, to be answered.
ChronicleThe service's logs.

The backend listens on 127.0.0.1 only and has no authentication layer, so nothing on the network can reach it.

Sensitive material is kept out three ways. Repositories on an exclusion list are never discovered. Files whose paths contain sensitive words are never listed. And on every tick Cortex sweeps the index and deletes any chunk that matches, in case something got in before a rule existed.