Based Crash Course
Welcome to the Based Crash Course! This guide introduces you to Based, a powerful, domain-specific programming language designed to build platform agnostic conversational agents. Deploy conversational workflows on chat, voice, email, SMS, and more with ease, enabling seamless data exchange and a unified user experience across platforms.What Is Based?
Based is a high-level AI instruction language crafted to design dynamic conversational agents that operate flawlessly across multiple communication channels. It provides developers with an elegant, high-level syntax to build interactive workflows quickly and reliably. Key features of Based include:- Intuitive and Expressive Syntax: Develop complex conversational logic with clarity and brevity.
- Specialized Constructs: Utilize built-in keywords like
talk
,loop
,until
, andask
to manage conversation flow and state effortlessly. - Cross-Platform Flexibility: Create agents deployable on chat, voice, email, SMS, and more—all while sharing data seamlessly across channels.
Core Conversation Flow Constructs
Based scripts use a trio of keywords to build interactive conversations:talk
: Sends a message or prompt to the user and waits for a response (or specify False as the second argument to wait for the user to send a message first).loop
: Begins a conversational block that allows for repeated prompting.until
: Specifies the condition under which the loop should end.
talk
keyword is not used in isolation. It is usually enclosed in a loop
/until
structure. This pattern keeps the conversation repeating until valid input is obtained.
Example Usage:
Core Language Constructs
The ask
Method
The ask
method is used to extract structured data from a response. By providing an example object, you can ensure that the output is formatted predictably for further processing.
Example:
Full Example: An Interactive Workflow
Below is a complete example that combinestalk
, loop
, until
, and ask
to build a seamless interactive conversation:
Additional Notes
- Based’s design abstracts away complexity while providing powerful control over conversational flows.
- The constructs
loop
,talk
,until
, andask
empower you to design robust, interactive workflows. - While this guide focuses on core constructs, Based supports integration with external services (APIs, email systems, SMS gateways) using an intuitive syntax.