# AI

[SmartBots AI](https://docs.mysmartbots.com/s/ai/) is a conversation-based AI system designed to work with Playground scripts, enabling bots to conduct contextual, conversational interactions.

## SmartBots AI for Developers

The most convenient way to use SmartBots AI is through **conversations**.

While you can send raw requests to the AI, conversations allow you to maintain context across messages and responses.

* Create a conversation using [Bot.AI.getConversationByName(residentName)](/doc/31b8e339-f3ba-44ee-b92f-04209a86dcca).
* The resulting conversation object can be reused for subsequent messages.
* SmartBots AI keeps track of context within a conversation.
* Conversation options can be configured individually for each conversation.
* Conversations are **system-wide**, tied to a **script + bot + specific resident**.

## Main Concepts

### Instructions

Rules for the bot: how it should react, how to role-play, and what knowledge it should have. (See examples in **Instructions** section.)

### Token

Each request to SmartBots AI consumes tokens. Read more about token usage.

## AI Commands Reference

| **Commands** |
|----------|
| [Bot.AI.chat](/doc/1f3b41b4-a544-4c85-b5b1-7f25a1e71518) |
| [Bot.AI.configure](/doc/bc5c10a8-0295-4272-865a-e8d9198dc86e) |
| [Bot.AI.getConversationByName](/doc/31b8e339-f3ba-44ee-b92f-04209a86dcca) |
| [Bot.AI.forgetConversation](/doc/a0291606-58af-4adf-9d86-69dcf8ac29f2) |
| **Conversation Commands** |
| [Conversation.chat](/doc/ae6abac9-2233-4c83-9a5b-a46559499ab4) |
| [Conversation.configure](/doc/83d2b4c6-515b-4c89-bf1b-c34550c12f51) |

---

**Documents**

- [Bot.AI.getConversationByName](https://www.mysmartbots.com/docs/s/dev/doc/botaigetconversationbyname-ABnhVLWuuX)
- [Conversation.chat](https://www.mysmartbots.com/docs/s/dev/doc/conversationchat-vTyBAVTpXG)
- [Conversation.configure](https://www.mysmartbots.com/docs/s/dev/doc/conversationconfigure-Ce2rDfBD0e)
- [Tokens](https://www.mysmartbots.com/docs/s/dev/doc/tokens-QR7hEdJtQd)
- [Bot.AI.chat](https://www.mysmartbots.com/docs/s/dev/doc/botaichat-ZrbHVjtyFe)
- [Bot.AI.configure](https://www.mysmartbots.com/docs/s/dev/doc/botaiconfigure-pIC3cvi3W2)
- [Bot.AI.forgetConversation](https://www.mysmartbots.com/docs/s/dev/doc/botaiforgetconversation-Fpfa3WtyEt)