Skip to content

Repository files navigation

⚡ Cortex

Autonomous AI Terminal Agent Engine

Python Version License PRs Welcome OS Platform


Cortex Interactive Terminal Demo


⚡ Overview

Cortex is a high-performance, open-source autonomous AI terminal agent engine designed for native operating system automation, intelligent tool synthesis, and zero copy-paste developer workflows.

It operates directly inside your local environment—executing terminal commands, synthesizing custom Python tools on-the-fly, analyzing codebases using AST symbol navigation, and deploying multi-agent parallel swarms.

cortex • DeepSeek-V4-Pro (custom) • session: default • d:\workspace
────────────────────────────────────────────────────────────────────────────

⏺ execute_command(command="git status")
  ╵ On branch main
  ╵ Your branch is up to date with 'origin/main'.

● Cortex
I have inspected your local repository. Everything is up to date and clean.

🔥 Key Features

  • 🧬 Self-Evolving Tool Creator (cortex meta): Dynamically writes, compiles, and registers custom Python tools on-the-fly when faced with missing capabilities.
  • 🐙 GitHub Autonomous Dev (cortex github): Clones repositories, analyzes issue specs, applies code fixes, runs tests, and submits Pull Requests automatically.
  • 🐝 Multi-Agent Swarm Matrix (cortex swarm): Deploys 100 parallel sub-agents (Architect, Coder, Security Auditor, Tester) simultaneously inside your terminal workspace.
  • 🔌 Model Context Protocol (MCP) Support: Connects to external MCP servers (~/.cortex/mcp_servers.json) via Stdio/SSE to fetch dynamic tool schemas.
  • 🧩 AST Symbol Navigator: Parses Abstract Syntax Tree structures across Python, TypeScript, and JavaScript codebases to locate symbols and definitions instantly.
  • 🧠 Automatic Memory Consolidation: Summarizes session histories into long-term vector facts and high-speed SQLite FTS5 full-text search indexes.
  • 🛡️ Interactive Safety & Sandboxing: Prompts for user confirmation before executing mutating actions, with optional Docker container sandboxed execution.

🚀 Quick Start

Installation

# Clone repository
git clone https://github.com/codexbt/cortex.git
cd cortex

# Install dependencies and setup package
pip install -e .

Configuration

Configure your LLM provider API keys (OpenRouter, Google Gemini, OpenAI, or Custom Channel):

cortex config --openrouter-key "YOUR_API_KEY" --model "DeepSeek-V4-Pro"

Usage

# Start interactive REPL
cortex

# Execute direct command
cortex run "Inspect disk usage and list top 5 memory-heavy processes" -y

# Deploy multi-agent swarm
cortex swarm "Build a REST API in FastAPI with SQLite and unit tests"

🛠️ Slash Commands Reference

Type / inside the interactive terminal to trigger live dropdown autocompletion:

Command Description
/audit <path> Perform deep security, bug, and code quality audit
/fix <issue> Interactively diagnose, patch, and re-test code
/plan <goal> Generate technical architecture implementation plan
/swarm <task> Deploy parallel multi-agent matrix
/architect <app> Build full-stack application & launch local dev server
/shadow <cmd> Monitor command execution & auto-heal errors in-place
/meta <tool> Synthesize custom Python tool dynamically
/mcp List configured Model Context Protocol servers
/symbols Parse source file AST symbols and definitions
/skills Manage persistent reusable Markdown skills
/gateway Control Omni-Channel HTTP/Telegram/Discord gateway daemon
/fts <query> Search SQLite FTS5 full-text memory index
/tools Display active Tool Registry

🤝 Contributing

Contributions are welcome! Please check out CONTRIBUTING.md to learn how to add custom tools in under 10 lines of code.


📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

We built Cortex 100% open-source because we believe the future of AI engineering belongs to the open developer community, not closed silos. We are looking for developers, contributors, and builders to take Cortex to the next level (adding multi-modal terminal vision, local LLM optimizations, and custom agent plugins).

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages