Member-only story
Building Nyravelle's Syntax: Give an AI Workflow Its Own Language
Part 2 of 24 in the series: Building Nyravelle, a Programming Language for AI Workflows
Imagine describing an AI workflow without writing a long chain of Python function calls, configuration dictionaries, and conditional statements.
Instead of explaining every implementation detail, you could write something like this:
workflow SupportAssistant {
input question: string
documents = retrieve(question)
answer = generate(question, context: documents)
if answer.confidence < 0.80 {
return request_approval(answer)
}
return answer
}The code describes the workflow in terms of its purpose: accept a question, retrieve relevant documents, generate an answer, and request approval when confidence is too low.
That is the direction we want Nyravelle to take.
In Part 1, we introduced the idea of building a programming language for AI workflows. In this article, we will make the idea more concrete by designing its syntax, defining a preliminary grammar, and implementing a small Python program that validates a limited subset of that syntax.











