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

# AI Training

> The AI Training API allows you to programmatically manage training scenarios, directories, and knowledge search for your AI assistant.

The AI Training API allows you to programmatically manage training scenarios, directories, and knowledge search for your AI assistant. Training scenarios teach the AI how to respond to specific situations unique to your business.

## Training Types

* **Behavioral** — Always-active instructions that control tone, style, guardrails, and escalation rules. Included in every conversation.
* **Scenario-specific** — Triggered by semantic matching when a customer's question is similar. Indexed as vector embeddings for retrieval.

## Key Concepts

* **Scenarios** — Question-answer pairs with a title (trigger) and body (instruction). Can be restricted to specific channels or contact segments.
* **Directories** — Folders for organizing scenarios by topic.
* **Draft/Published** — Draft scenarios are saved but not used by the AI. Publishing makes them active.

## Available Endpoints

<CardGroup>
  <Card title="List Trainings" icon="list" href="./get_all">
    Retrieve all training scenarios
  </Card>

  <Card title="Get Training" icon="magnifying-glass" href="./get">
    Get a single training by ID
  </Card>

  <Card title="Create Training" icon="plus" href="./create">
    Create a new training scenario
  </Card>

  <Card title="Update Training" icon="pen" href="./update">
    Update an existing training
  </Card>

  <Card title="Delete Training" icon="trash" href="./delete">
    Delete a training scenario
  </Card>

  <Card title="Toggle Draft" icon="toggle-on" href="./toggle_draft">
    Publish or unpublish a training
  </Card>

  <Card title="Move to Directory" icon="folder-arrow-down" href="./move">
    Move a training into a directory
  </Card>

  <Card title="Search" icon="magnifying-glass" href="./search">
    Semantic search across training and knowledge base
  </Card>

  <Card title="Generate Scenario" icon="wand-magic-sparkles" href="./generate_scenario">
    Generate a scenario title from a chat session
  </Card>
</CardGroup>

## Best Practices

* Use `search` before creating to avoid duplicates
* Start with draft scenarios, review, then publish
* Use behavioral type for tone and guardrails, scenario-specific for Q\&A
* Organize related scenarios into directories
* Restrict to channels/segments when a scenario only applies to specific contexts
* Use `generate_training_from_session` to learn from real conversations
