back to tutorials

How to Insert a Large Files into the Backstory

Recognizing the need for more efficient data input, ChatBotKit has introduced a game-changing feature that allows for the input of large files into the context of an AI model, specifically into the backstory. The backstory in ChatBotKit serves as the system or developer prompt, where we describe the purpose, behavior, and linguistic style of the bot. As AI models become bigger and cheaper, there's more room for information in the backstory. However, directly pasting large amounts of text can be challenging to manage. That's where ChatBotKit's new feature comes in.

This tutorial will guide you through the process of using this new feature. By the end, you'll be able to effectively input large files into your AI model's backstory, thus enabling it to have more informed and nuanced interactions.

Step 1: Inserting a File Reference into the Backstory

To insert a file reference, use a special syntax starting with FILE_ followed by the ID or the name of the file. For instance, if your file has id cm8g3dg65000c64sorjwtayey, you'd insert ${FILE_cm8g3dg65000c64sorjwtayey}.

Step 2: Using the New Feature

In practice, the file could be as large as several megabytes. Once the bot is engaged, it reads the file, making the content immediately available. This content is then used in subsequent interactions.

Step 3: Continuous Synchronization

With this feature, you can continuously synchronize data into the file, creating a kind of database. This doesn't change how the bot is configured. You only need to edit the file, and the information will propagate into the bot.

Step 4: Testing the Setup

To test the setup, start a chat with the bot. For instance, if you've inserted a file that contains the name of the bot and you ask the bot, "what is your name?" The bot should respond with their name that comes directly from the content of the file.

In conclusion, the real power of this feature lies in the flexibility it provides for updating the bot's information. You can continuously update the data in the file, either manually or via the API/SDK, without needing to touch the backstory at all. This means that the bot can evolve and adapt to new data swiftly and smoothly, without any disruption to its initial configuration. This feature significantly streamlines the process of managing and updating data in AI models, opening up a whole new level of efficiency and effectiveness.

Remember, this is just one of the many features offered by ChatBotKit to facilitate the creation of conversational AI agents. We encourage users to find creative ways to use this new feature and would love to hear your feedback!