This project is licensed under the GNU Affero General Public License v3.0 — see the LICENSE file for details.
A terminal-first orchestration daemon for multi-agent AI workflows.
Cortex runs as a background daemon that watches your knowledge vault, routes tasks to the right AI supplier (Gemini, Claude Code, Codex), and surfaces approvals and results through an interactive TUI — without everything going through a single context window.
Cortex is based on obsidian brain that became relevant, but studing the implementation, I found a lot of gaps in terms of precision and token usage.
I decided to create cortex to use the best models for the correct aplication, and don't denpends of the IA to do everything in one shot, because even with well written agents, a lot of tasks has been executed directly from the provider and model that received the task to distribute.
┌─────────────────────────────┐
│ cortex daemon │
│ │
vault writes ───► │ FileWatcher │
hook events ───► │ SocketReceiver ──► Router │
│ │
└──────────────┬──────────────┘
│ AppEvent stream
┌──────────────▼──────────────┐
│ cortex tui │
│ project tabs, approvals, │
│ event log, review flow │
└─────────────────────────────┘
Lobes are project domains (or some delegated functions). Each lobe has a path in the vault with structured subdirectories (inquiries/, plans/, docs/, tasks/).
Suppliers are the underlying execution providers: Gemini, Claude Code, Codex.
Agents are task-specific executors that map to a supplier.
The daemon and TUI are separate processes. The TUI connects to the daemon when you need to interact; the daemon keeps running regardless.
Drop a markdown file with YAML frontmatter into <lobe>/inquiries/. The daemon detects it, routes it to the right supplier, writes the result to <lobe>/docs/, and updates the inquiry status.
---
type: inquiry
id: INQ-001
title: What are the tradeoffs between X and Y?
kind: research # research | decision | analysis
status: pending # daemon picks this up
output: docs/x-vs-y
---
Context and question body here.| Kind | Supplier |
|---|---|
research |
Gemini |
decision |
Opus |
analysis |
Opus or Gemini |
cargo build --release
cp target/release/cortex ~/.local/bin/Copy and edit the example config:
cp cortex.example.toml ~/.config/cortex/cortex.tomlOptionally install as a systemd user service:
cp cortex.service ~/.config/systemd/user/
systemctl --user enable --now cortexcortex.toml is gitignored. See cortex.example.toml for the full schema.
[monitor]
socket_path = "/tmp/cortex.sock"
[[lobes]]
name = "my-project"
path = "~/vault/projects/my-project"
[[suppliers]]
name = "gemini"
type = "gemini"
[[suppliers]]
name = "claude-code"
type = "claude-code"cortex daemon # start the background daemon
cortex tui # open the interactive TUI
cortex event '<json>' # send an event (used by editor hooks)| Key | Action |
|---|---|
Tab / → |
Next lobe |
Shift+Tab / ← |
Previous lobe |
n |
New inquiry |
a |
Accept pending review |
r |
Reject pending review |
q |
Quit |
Wire your editor hooks to send events to the daemon:
echo '{"type":"agent_started","desc":"elixir-dev"}' | nc -U /tmp/cortex.sock- Rust 1.77+
geminiCLI (for research inquiries)claudeCLI (for decision/analysis inquiries)obsidianCLI (for vault writes)