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
| Option | Description |
|---|---|
--model, -m | Override the default model for this session |
--provider, -p | Select a specific provider |
--agent, -a | Use a specific agent configuration |
--resume, -s | Resume an existing session by ID |
--no-stream | Disable streaming output (print complete response at once) |
--list-agents | List all available agents |
--help | Show help for this command |
Slash Commands
Inside the chat session, the following slash commands are available:
| Command | Description |
|---|---|
/exit | Quit the session |
/quit | Quit the session |
/help | Show available slash commands |
/soul | Access soul/persona management |
Tool Integration
When tools are enabled, the agent can:
- Read files using
file_readtool - 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