> ## Documentation Index
> Fetch the complete documentation index at: https://backdrift.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Spec Chat

> Iterate on your backend with conversational AI.

**Spec Chat** is Backdrift's conversational interface for refining your backend specification. Instead of editing JSON or code, you chat with the AI to add features, modify entities, and adjust behavior.

## How It Works

After your initial prompt generates a spec, you can continue the conversation:

```
You: "Add a comments feature to tasks"

AI: "I've added a Comment entity with the following fields:
- id (string, primary key)
- task_id (foreign key to Task)
- author_id (foreign key to User)
- content (string)
- created_at (datetime)

Comments are scoped to the same tenant as their parent task."
```

The AI understands context from your existing spec and makes intelligent decisions about relationships, permissions, and data modeling.

## Common Operations

### Adding Features

```
"Add file attachments to tasks"
"Add a comments section to projects"
"Add tags to tasks with autocomplete support"
```

### Modifying Entities

```
"Make the due_date field required"
"Add a 'blocked' status to tasks"
"Change priority from string to enum: low, medium, high, urgent"
```

### Adjusting Permissions

```
"Only admins should be able to delete projects"
"Viewers should not see the 'salary' field on employees"
"Allow members to update tasks but not delete them"
```

### Adding Workflows

```
"Send an email when a task is assigned"
"Run a nightly job to archive completed tasks older than 30 days"
"When a user signs up, create a default organization for them"
```

## Capability Detection

Spec Chat automatically detects what cloud capabilities your request needs:

| Request                           | Detected Capability          |
| --------------------------------- | ---------------------------- |
| "Send email notifications"        | Email (SES)                  |
| "Upload profile pictures"         | File Storage (S3)            |
| "Run a nightly cleanup job"       | Scheduled Jobs (EventBridge) |
| "Process payments asynchronously" | Durable Workflows            |

If you request something we don't support yet, the AI will suggest alternatives:

```
You: "Add SAML single sign-on"

AI: "SAML is not currently supported. However, I can configure:
- Email/password authentication with MFA
- Social login (Google, GitHub) via Cognito federation

Would you like me to add social login instead?"
```

## Chat History

Your conversation history is saved per project. You can:

* Review previous changes
* Understand why certain decisions were made
* Pick up where you left off

## Tips for Effective Chatting

<AccordionGroup>
  <Accordion title="Be Specific">
    ❌ "Add notifications"
    ✅ "Send an email to the project owner when a task is marked complete"
  </Accordion>

  <Accordion title="One Change at a Time">
    ❌ "Add comments, file attachments, and activity logging"
    ✅ "Add comments to tasks" → "Add file attachments" → "Add activity logging"
  </Accordion>

  <Accordion title="Ask Questions">
    You can ask the AI to explain its decisions:

    * "Why did you add a tenant\_id to comments?"
    * "What indexes will be created for tasks?"
    * "How will file uploads work?"
  </Accordion>

  <Accordion title="Undo Changes">
    If you don't like a change:

    * "Undo the last change"
    * "Remove the comments feature"
    * "Go back to before I added file attachments"
  </Accordion>
</AccordionGroup>

## Applying Changes

After chatting, your changes are in a **draft** state. Click **Apply Spec** to save them to your project.

Only applied specs can be:

* Used to generate Blueprints
* Validated
* Deployed

<Card title="Validation" icon="shield-check" href="/workflow/validation">
  Learn how Backdrift validates your spec before deployment.
</Card>
