MechaMental
Guides

Using Cortex

Chat with your AI apps, view the cognitive chain, and work with artifacts in the Cortex interface.

Overview

Cortex is MechaMental's built-in chat interface for interacting with your AI applications. It lets you send messages to a configured bundle (a published endpoint), see streaming responses, inspect the cognitive chain of intermediate reasoning, and view generated artifacts in the scratchpad.

Getting Started

Open Cortex

Click Cortex in the sidebar navigation. The Cortex interface opens with a bundle selector and a chat area.

Select a Bundle

A bundle is a published configuration that packages an app's endpoint for end-user access. You need to select a bundle before chatting.

  1. Use the bundle selector at the top of the Cortex interface
  2. Browse available bundles by workspace or organization
  3. Click a bundle to select it -- the chat area activates

No Bundles?

If no bundles appear, you need to create one first. Bundles are configured from the app settings and require a deployed release with at least one endpoint.

Start Chatting

  1. Type your message in the input field at the bottom
  2. Press Enter (or click the send button) to submit
  3. The response streams in real time if the pipeline has SSE streaming enabled
  4. The conversation history persists in the current thread

Cognitive Chain

When your pipeline uses secondary events (steps with Event Action set to Secondary), Cortex displays these as the cognitive chain alongside the main response. The cognitive chain shows:

  • Which tools the AI decided to call and why
  • Data retrieved from sources and memory
  • Intermediate reasoning before the final response
  • Any secondary inference steps (thinking, planning)

Click on a cognitive chain event to expand its details. This is valuable for debugging and understanding how the AI reached its conclusion.

Scratchpad

The scratchpad is a side panel that appears when your pipeline generates artifacts (via artifact_create steps). It provides a workspace for viewing and interacting with generated content:

  • Code artifacts -- displayed with syntax highlighting
  • Markdown documents -- rendered with full formatting
  • HTML content -- shown in a sandboxed preview
  • Downloads -- all artifact types can be downloaded

Artifacts are scoped to the current execution, thread, or namespace depending on how the artifact_create step is configured.

Thread Management

Cortex maintains conversation threads that preserve full message history:

  • New conversation -- start a fresh thread
  • Return to previous threads -- navigate back to earlier conversations
  • Thread history -- persists across sessions, tied to the namespace

Tips for Effective Use

  • Use secondary events for transparency -- configure thinking or planning inference steps with Event Action set to "Secondary" so they appear in the cognitive chain without cluttering the main response
  • Stream tokens for responsiveness -- enable Stream Tokens on your primary inference step so users see the response as it is generated
  • Generate artifacts for structured output -- use artifact_create steps for code, reports, or documents so they appear in the scratchpad with proper rendering

On this page