Workspaces
Overview
Workspace is a contextual panel that surfaces the structured artifacts associated with a specific point in a Mantra conversation. It provides a persistent, inspectable view of the work generated at that moment — separate from the conversational thread, but directly tied to it.
Workspace Properties
Point-in-time binding — Each Workspace reflects the state of a Data Answer at the exact moment it was generated. Scrolling back through a conversation and selecting a prior exchange restores the Workspace to that state, including its SQL, lineage, and results.
Artifact container — The Workspace holds the outputs that cannot live naturally within a chat message: structured code, rendered visuals, tabular data. These require a dedicated surface to be useful.
Conversation-scoped, not session-scoped — The Workspace is not a persistent workspace in the traditional tool sense. It has no independent lifecycle. Its content is always derived from, and subordinate to, the conversation that produced it. When you ask follow-up questions, Mantra sees your edited SQL and builds on it.
Current Artifact Types
| Artifact | Description |
|---|---|
| SQL | The query generated to answer the user's question |
| Lineage | A chart or summary rendering of the SQL for less technical users |
| Results | The data returned from executing the SQL |
What the Workspace Is Not
- Not a persistent project or saved file
- Not shared across conversations
- Not editable independent of the conversation that produced it
Opening a Workspace
When Mantra generates SQL in a conversation, an Open in Workspace button appears on the message. Click it to open the workspace alongside the conversation.
The workspace has two tabs:
- Answer — The SQL generated to answer your question, along with results and lineage. Use the toolbar here to run queries, save, and view lineage.
- Context — The tables, columns, and metadata Mantra used to build the answer. This tab updates as you ask questions but is otherwise read-only.
Editing and Running Queries
Edit the SQL directly in the editor — add filters, adjust aggregations, or modify join logic as needed.
Click Run to execute and preview results. A successful run syncs any edits so Mantra can reference them in follow-up questions.
Your edits are synced when you run a query successfully, click Sync manually, or save a Datamap. A failed query run will not sync your changes — fix the SQL and run again.
Sync Status
The workspace header shows a sync status indicator that tells you whether your current SQL is saved:
| Status | Meaning |
|---|---|
| Synced | Your current SQL matches the saved state |
| Manual changes detected | You have local edits that haven't been synced — click Sync to save without running, or run the query to sync automatically on success |
| Syncing... | A sync is in progress |
| Sync failed | The sync attempt failed — click Retry to try again |
Unsaved Changes Protection
If you try to navigate away (close the workspace, switch conversations, or open a different workspace) while you have unsynced edits, a confirmation dialog lets you choose to Sync your edits before navigating or Continue without Syncing to discard the local changes.
Saving as a Datamap
Once you're satisfied with the query results, click Save in the toolbar to save the workspace SQL as a Datamap. You can create a new Datamap, link to an existing one, or update one that's already linked.
Creating a New Datamap
If the workspace isn't linked to an existing Datamap:
- Click Save to open the Save dialog
- Under Create New, type a name for your Datamap
- Press Enter or click + to confirm the name
- Click Create Datamap
Linking to an Existing Datamap
You can also link the workspace to an existing Datamap and update its SQL:
- Click Save to open the Save dialog
- Select a Datamap from the Existing Datamaps list
- Optionally rename the Datamap
- Click Update Datamap
Updating a Linked Datamap
When the workspace is already linked to a Datamap:
- Click Save to open the Update dialog
- Optionally rename the Datamap
- Click Update Datamap
If multiple workspaces are linked to the same Datamap, updating the Datamap from any one of them will update the SQL in all other linked workspaces to reflect the change.
Multiple Workspaces Per Conversation
Each SQL-generating message in a conversation has its own independent workspace. Click Open in Workspace on any message to switch to that workspace.
- Isolated Changes: Edits to one workspace don't affect others
- Separate Datamaps: Save each workspace as its own Datamap, or link multiple workspaces to the same Datamap
- Agent Context: Mantra uses the SQL from the most recently opened workspace when answering follow-up questions
Troubleshooting
Changes not persisting after a run
If your edits aren't appearing after a successful run, check the sync status indicator. If it shows Sync failed, click Retry. If the run itself failed (query error), your edits are still local — fix the SQL and run again.
Related Topics
- Datamaps Overview — Learn about the two ways to build Datamaps
- Building Datamaps — Manual SQL-driven Datamap creation
- Version Control — Understand Datamap versioning