cortex chat

Start an interactive streaming chat session with any supported LLM provider. This is the primary interface for interacting with the CortexPrism agent.

Usage

cortex chat [options]
cortex chat -m gpt-4o                 # Override model
cortex chat -s sess_abc123            # Resume an existing session
cortex chat --resume sess_abc123      # Resume (long flag)
cortex chat --no-stream               # Disable streaming output
cortex chat -p anthropic              # Select provider
cortex chat -a code-reviewer          # Use a specific agent
cortex chat --list-agents             # List available agents

Options

OptionDescription
--model, -mOverride the default model for this session
--provider, -pSelect a specific provider
--agent, -aUse a specific agent configuration
--resume, -sResume an existing session by ID
--no-streamDisable streaming output (print complete response at once)
--list-agentsList all available agents
--helpShow help for this command

Slash Commands

Inside the chat session, the following slash commands are available:

CommandDescription
/exitQuit the session
/quitQuit the session
/helpShow available slash commands
/soulAccess soul/persona management

Tool Integration

When tools are enabled, the agent can:

  • Read files using file_read tool
  • Execute shell commands with approval gates
  • Search the web via DuckDuckGo
  • Execute code in sandboxed environments

Session Persistence

Each chat session creates a per-session SQLite database (sess_*.db) that stores full message history. Sessions can be resumed later using --resume or the interactive session browser via cortex sessions.

Agent Loop Flow

User types message
  → memory retrieval (FTS5 + vector search)
  → memory injection into system prompt
  → LLM call (stream or complete)
  → parse tool calls from response
  → validate through Parallax security
  → execute approved tools
  → re-prompt LLM with results
  → persist response to session history
  → write episodic memory summary (async)
  → per-turn reflection (async, if enabled)

Examples

# Start a basic chat session with default provider
cortex chat

# Use a specific model
cortex chat -m claude-sonnet-4-5

# Resume a previous session
cortex chat -s sess_a1b2c3d4

# Use a specific agent
cortex chat -a code-reviewer

# Chat without streaming
cortex chat --no-stream