AI Native Application Development

Although AI technologies have been widely used, developers generally need to have deep expertise in AI native application development and face certain challenges, such as steep learning curve and complex integration.

Common AI enablement is implemented by providing an AI application framework. However, if simpler syntax expressions can be provided in languages to lower the threshold for developers to write AI native applications, the development will become simpler and more efficient. Therefore, the Cangjie language is committed to build a declarative paradigm similar to that in the AI domain through DSL capabilities by referring to the development of web and mobile technologies.

Agent DSL is a native AI capability that is in consideration and development in the Cangjie language. It is a domain-specific language designed for AI agent development and multi-agent collaboration and is embedded in the Cangjie language. So the Agent DSL is an eDSL. Developers do not need to learn complex libraries and frameworks and can use AI functions in a simple and intuitive manner through the Agent DSL.

// Definition of the Agent
@agent class Planner {
  @prompt[pattern=APE] (
    action: "Help users make a travel route.",
    purpose: "Allow users to visit scenic spots within a planned time and get adequate rest.",
    expectation: "Generate a reasonable travel route, including time, scenic spot, commute, and other information."
    )
}

// Usage of the Agent
let agent = Planner()
let result = agent.chat("I want to go to Shanghai.")

Based on the above code snippet, it is clear that declaration and usage syntaxes of the Agent in the Cangjie language is the same as that of Cangjie syntax. In this way, use of the Agent can provide the static check capability of the Cangjie language without bringing extra learning burden to developers, fully utilizing the advantages of efficient programming, security, and reliability of the Cangjie language.

The Agent DSL not only improves the efficiency of AI application development, but also allows the code to accurately correspond to the operations and decision-making processes of the AI Agent. The overall design of the Agent DSL aims to achieve the following effects:

  • Advanced abstraction: As a built-in language abstraction in the DSL, the definition and description of the Agent are more natural and intuitive, and are easy to understand and maintain.
  • Simplified multi-agent collaboration programming: Different agent collaboration modes are abstracted through streaming symbols, and developers can easily utilize multi-agent collaboration to develop applications with higher intelligence.
  • Intelligent development tool chain: On the basis of the Agent DSL, the tool chain provides developers with all-round intelligent support from application development to performance commissioning and optimization.

In addition to the Agent DSL, an AI native application framework is also being built. Through the cooperation between native languages and frameworks, developers can enjoy new application programming experience in the all-scenario intelligent era.