Cortex
x Aryan Arora
I built an AI infrastructure system from scratch. It coordinates parallel agents, manages its own sprints, tracks every entity in a knowledge graph, and deploys itself. This is the system. I am the builder.
Old enough to build without AI.
Young enough to not fear it.
Aryan Arora
I built an AI division from scratch. Grew it from 1 to 9 engineers. Shipped multi-agent orchestration, knowledge graphs, compliance systems, QA automation. Every project taught me the same lesson:
Break the problem into layers. Assign the right mind to each layer. Never let two people touch the same file. Verify before you trust. Ship every day or you're standing still.
Then I asked: what if the system itself could learn these principles?
Cortex
Cortex decomposes goals into sprints with dependency DAGs. It spawns parallel builder agents in isolated worktrees — no two agents touch the same file. A lead agent re-verifies every deliverable independently. Nothing merges without proof.
It maintains a knowledge graph that auto-enriches on every create — tasks, sprints, sessions, research, skills, tools — all connected and traversable. MCP tools let agents discover and call capabilities via protocol. Skills encode the full SDLC: plan, design, build, test, review, deploy, QA.
It runs every day. It deploys itself. It thinks the way I taught it to.
Sprint Planning
Decompose goals into sprints with task dependencies, file ownership maps, and parallel execution layers. Plan, Execute, Review, Deploy.
Knowledge Graph
680 nodes, 1203 edges across 12 entity types. Auto-enrichment on every create. Boot enrichment backfills the rest.
MCP Tools
49 tools across 17 categories. Task management, sprint ops, content calendar, social media, research, graph traversal. Agents discover and use them via protocol.
Agent Orchestration
Spawn parallel builder agents in isolated git worktrees. Dependency-aware scheduling. File conflict prevention. Lead verifies every deliverable.
Content Calendar
Multi-platform content scheduling. Twitter, LinkedIn, Reddit. Template-based generation. Research-backed optimal posting times.
Skills Registry
12 cortex-* skills covering the full SDLC. Plan, Design, Research, Build, Execute, Test, Review, Deploy, QA.
Every entity, connected
Drag nodes to explore. Every task, sprint, session, and research doc — all connected through auto-enrichment on create.
Real-time agent coordination
Neural Link is a real-time communication bridge between Aryan and his AI agents. Terminal output streams via WebSocket with sub-100ms latency. Agents check in with heartbeat signals. Sessions persist across reconnections. Everything happens from the phone.
Cortex coordinates multiple agents across sprints, files, and worktrees simultaneously.
Built with FastAPI + PostgreSQL + Jinja2. No React. No Next.js. Just Python.
Four views into how Cortex works. FastAPI + PostgreSQL + MCP, deployed on Railway.
System Architecture
FastAPI + PostgreSQL + Jinja2 SSR with dual auth (cookie + API key), deployed on Railway with GitHub Actions CI/CD.
graph LR
subgraph Clients
PWA[Browser / PWA]
Agents[Claude Agents]
end
subgraph Core["Cortex Core"]
API[FastAPI<br/>uvicorn async]
Jinja[Jinja2 Templates<br/>SSR + mobile-first]
Auth[Dual Auth<br/>Cookie + API Key]
end
subgraph Data["Data Layer"]
PG[(PostgreSQL<br/>27+ tables)]
end
subgraph MCP["MCP Layer"]
MCPServer[MCP Server<br/>49 tools]
end
subgraph Infra["Infrastructure"]
Railway[Railway<br/>auto-deploy]
GHA[GitHub Actions<br/>CI / CD]
end
PWA -->|HTTP / WS| API
Agents -->|X-API-Key| API
API --> Jinja
API --> PG
API -->|async pool| PG
Auth -.->|guards| API
MCPServer <-->|MCP protocol| Agents
MCPServer -->|HTTP| API
GHA -->|push to main| Railway
Railway -->|hosts| API
MCP Tool Ecosystem
49 MCP tools across 17 categories enabling Claude agents to manage tasks, sprints, content, social media, and the knowledge graph.
flowchart LR
Agents[Claude Agents] -->|MCP protocol| Router[Tool Router]
Router --> T[Tasks<br/>8 tools]
Router --> S[Sprints<br/>5 tools]
Router --> G[Graph<br/>3 tools]
Router --> C[Content<br/>5 tools]
Router --> SM[Social<br/>5 tools]
Router --> R[Research<br/>3 tools]
Router --> SE[Sessions<br/>4 tools]
Router --> SY[System<br/>5 tools]
Router --> More[+9 categories<br/>11 tools]
T --> DB[(PostgreSQL<br/>27+ tables)]
S --> DB
G --> DB
SE --> DB
Knowledge Graph
12 entity types with auto-enrichment on create and boot-time backfill. 190+ nodes and 360+ edges mapping every project artifact.
graph TD
subgraph Entities["12 Entity Types"]
task((task))
sprint((sprint))
session((session))
app((app))
research((research))
revenue((revenue))
content((content))
user((user))
contact((contact))
presentation((pres.))
skill((skill))
tool((tool))
end
task -->|belongs_to| sprint
task -->|depends_on| task
session -->|created_in| sprint
app -->|belongs_to| user
research -->|part_of| sprint
content -->|created_in| session
skill -->|belongs_to| app
tool -->|belongs_to| app
subgraph Enrichment["Auto-Enrichment"]
Create[Entity Created] --> Edge[Graph Edge Inserted]
Boot[Server Boot] --> Backfill[Missing Edges Filled]
end
Sprint Orchestration
Full SDLC pipeline: plan tasks with dependency DAG, spawn parallel builder agents in isolated worktrees, verify, review, deploy, and QA.
flowchart LR
subgraph Plan["1. Plan"]
CP[cortex-plan<br/>Task decomposition]
CP --> DAG[Dependency graph<br/>topological sort]
end
subgraph Execute["2. Execute"]
CE[cortex-execute<br/>Spawn builders]
CE --> B1[Builder 1<br/>worktree-a]
CE --> B2[Builder 2<br/>worktree-b]
CE --> B3[Builder 3<br/>worktree-c]
end
subgraph BuildLoop["Builder Loop"]
Claim[claim_task] --> Build[Build + Test]
Build --> Commit[git commit]
Commit --> Report[report_done]
Report -->|next task| Claim
end
subgraph Verify["3. Verify"]
Lead[Lead Agent<br/>verify deliverables]
Lead --> Merge[Merge to main]
end
subgraph Review["4. Review"]
CR[cortex-review<br/>Security + arch check]
end
subgraph Deploy["5. Deploy"]
CD[cortex-deploy<br/>git push origin main]
CD --> Rail[Railway<br/>auto-deploy]
end
subgraph QA["6. QA"]
CQ[cortex-qa<br/>Playwright verify]
end
Plan --> Execute
B1 --> BuildLoop
B2 --> BuildLoop
B3 --> BuildLoop
BuildLoop --> Verify
Verify --> Review
Review --> Deploy
Deploy --> QA
Multi-Agent Orchestration Platform
Four agent types, DAG execution, multi-tenant isolation. Enterprise-scale AI orchestration with zero cross-tenant data leakage.
MCP Sprint Command Center
49 MCP tools across 17 categories. AI agents coordinate sprints, manage dependencies, and deploy code — all through a standards-based protocol.
QA Automation Platform
Three-phase testing: record, generate, execute. Desktop automation that replaced manual testing across 30+ modules.
Knowledge Graph + Entity Intelligence
12 entity types, auto-enrichment pipeline, 315+ nodes and 597+ edges. Every project artifact mapped and traversable.
Compliance Screening System
Sanctions matching, document analysis, and immutable audit trail. Compliance automation for regulated industries.
Build-in-public posts about the architecture decisions behind Cortex.
Sprint Orchestration with AI Agents: 4 Agents, 1 Codebase, 0 Merge Conflicts
Architecture deep-dive
Knowledge Graphs for AI Career Systems: 190 Nodes in PostgreSQL
Architecture deep-dive
How I Built a 59-Tool MCP Server That Coordinates Parallel AI Agents
Architecture deep-dive