Using Colang

Colang is an event-based modeling language to enable the design of highly flexible conversational interactions between a human and a bot. Since learning a new language is not an easy task, Colang was designed as a mix of natural language and Python. If you are familiar with Python, you should feel confident using Colang after seeing a few examples, even without any explanation. Under the hood, Colang scripts are interpreted by a Python runtime that is currently part of NeMo Guardrails and packaged as part of Chat Engine microservice.

Configuring dialogs involves defining the rules that the Chat Engine must follow to generate a response. The Colang language is also used by NeMo Guardrails to build programmable rails for your LLM applications.

Colang based files have .co extension. The current ACE Agent release supports two different versions of Colang syntax.

Colang 1.0 - Sample bots such as Stock Bot, Food Ordering Bot, and Gaming NPC Bot use Colang 1.0 syntax. Colang 1.0 will be deprecated in future releases. Refer to the Colang Language Syntax Guide to understand how this works. For building a bot from scratch using Colang 1.0, follow the instructions in this tutorial.

Colang 2.0 - Colang 2.0 is the latest iteration of the Colang language and Colang runtime that builds upon the guardrailing and conversational interaction management capabilities of Colang 1.0 and adds support for multimodality at its core. This includes many new concepts such as parallel actions, hierarchical flows, support for UMIM actions and events, and much more. Colang 2.0 is currently available in a preview version with ACE Agent. Syntax guide for Colang 2.0 is available here.

On top of the capabilities supported by NeMo Guardrails, NVIDIA ACE Agent adds additional capabilities on top of the Colang language. You have the flexibility to invoke the following entities from Colang:

  • Non-LLM based models like Joint Intent & Slot, Name Entity Recognizer, and Extractive Question Answering model.

  • Execute your custom business logic using plugins.

  • Call prebuilt Retrieval Augmented Generation (RAG) pipelines.