Secure Multi-Agent AI Framework
-
Cortex is a powerful CLI tool that splits AI tasks into specialized agents. Instead of using one model for everything, you assign specific roles: one agent for writing code, another for brainstorming ideas, and a third for general tasks.
-
Privacy First: Your chat history is securely encrypted locally using military-grade AES-128 (Fernet) cryptography. No one can read your data without your master password.
-
🤖 Multi-Agent System: Assign different providers (Ollama, Gemini, OpenAI, OpenRouter) to different tasks.
-
🔒 Encrypted History: All chats are saved in an AES-256 encrypted database.
-
🦙 Full Ollama Support: Run everything 100% locally using models like glm-4.7-flash.
-
☁️ Cloud Providers: Seamlessly integrate Google Gemini, OpenAI, and OpenRouter (including free models).
-
⚙️ JSON Configuration: Easy setup via a simple config.json file.
-
🖥️ Clean CLI Interface: Beautiful terminal UI powered by art.
- Cortex is working in terminal
- Clone the repository Cortex
git clone https://github.com/Alexx-coder/Cortex.git
cd Cortex- Create a virtual environment
python -m venv .venv
source .venv/bin/activate- Install dependencies:
pip install -r requirements.txt- Run Cortex:
python runner.py- All settings are managed in ~/.cortex/config.json.
-
Add your API keys (Gemini, OpenAI, OpenRouter). Leave blank if you want to use only local Ollama.
-
Change the Ollama model name to match your downloaded model (e.g., glm-4.7-flash:latest).
-
Assign providers to agents:
"agents": {
"code": "ollama",
"ideas": "openrouter",
"other": "ollama"
}-
Note: On the first launch, you will be asked to create a password. It will be saved as a secure local token, so you won't have to enter it every time.
-
Advanced Agent Settings: You can fully customize each agent's behavior directly in config.json:
"agents": { "code": { "provider": "ollama", "temperature": 0.2, "max_tokens": 8096, "system_prompt": "You are a senior Rust developer. Only output code." }}- When you start Cortex, you will be asked for a Master Password to decrypt your chat database.
| Command | Description |
|---|---|
/new <name> |
Create a new encrypted chat session |
/chats |
List all saved chats |
/switch <id> |
Switch to another chat session |
/message: <agent> <text> |
Send a prompt to a specific agent (code, ideas, other) |
/export |
Save a chat to .md file |
/load |
Load a file to context |
/clear |
Forget the current context |
/settings |
View current provider and agent configuration |
/help |
Show all commands |
/about |
Information about the project |
/stop |
Exit Cortex |
- Example:
Cortex > /new Python Project
Cortex > /message: code write a fast fibonacci function
Cortex > /message: ideas how can I optimize this further?
-
Cortex does not send your chat history to any third-party servers for storage. All history is encrypted using the
cryptography library's Fernet implementation. -
Fernet provides authenticated encryption using AES-128 in CBC mode with PKCS7 padding and HMAC using SHA256 for integrity. This ensures that your chats cannot be read or tampered with without your master password. The database is saved locally in
~/.cortex/chats.db. -
Note: If you lose your master password, you lose access to your chat history, as the encryption is cryptographically secure.
-
When the program is started, Cortex will log information and errors in file
~/.cortex/cortex.log -
If you want to watch logs Cortex, write in terminal:
-
If you have
Windows(it's cmd):
cd %USERPROFILE%\.cortex
type cortex.log- If you have
Linux,MacOSand etc:
cd ~/.cortex
cat cortex.log- Contributions, issues, and feature requests are welcome! Feel free to check the issues page
- This project is under the MIT License.