Frequently asked questions

Common questions about the kitengi language and the app at app.kitengi.dev.

What is kitengi?

Kitengi is a Turing-complete dataflow programming language designed for humans and AI to work with together. Programs are expressed as a graph of nodes connected by threads. Data flows through the graph as messages. There is no global mutable state and no implicit sequencing — a node runs only when all of its required inputs have received a message.

The language is designed so that humans can understand programs at a glance, and AI can write them accurately with minimal context. Strong conventions — one way to declare a node, one way to connect ports, one way to define a pattern — make both reading and writing predictable.

Why is kitengi designed for AI?

Most programming languages require an AI to hold a large amount of context to generate correct code — library APIs, idioms, type hierarchies, implicit conventions. Kitengi eliminates most of that.

To write a kitengi program, an AI only needs to know the list of available node kinds and their port signatures. The syntax is unambiguous, there is no hidden state to track, and the structure is the same across every program. This means AI can write correct programs with a much smaller working context than general-purpose languages.

Patterns extend this further: a well-defined task can be described as a pattern interface (input ports, output ports, what it does), and the AI generates the implementation. Humans can then use the pattern without needing to read its internals.

Why is kitengi easier for humans to understand?

In a kitengi program every connection between nodes is explicit — there is no hidden control flow, no shared mutable state mutated from a distance, and no implicit execution order. You can look at any node and immediately see exactly what inputs it expects and where its outputs go.

The visual editor makes this even clearer: the program is literally a diagram. Nodes are boxes; threads are arrows. Understanding a program is a matter of following the arrows.

What is app.kitengi.dev?

It is the visual editor for kitengi programs. You can create programs, connect nodes by drawing threads, run your program, and inspect the output — all in the browser with no install required.

Do I need to install anything?

No. The editor at app.kitengi.dev runs entirely in your browser. The kitengi runtime is included — you can write and execute programs without installing any software.

If you want to run programs from the command line, a JavaScript runtime is available separately. There is also a desktop app built with Electron (kitengi-electron) that provides the same editor with native desktop integration and bridge connectivity for filesystem and networking nodes.

What is the difference between a .kti and a .ktip file?

A .kti file is a full program — it includes a program | declaration, nodes, threads, and start routes.

A .ktip file is a single reusable pattern — a subgraph packaged as a node that others can reference by URL. It has named input and output ports and can include test cases.

What are patterns?

A pattern is a subgraph packaged into a reusable node. From the outside it looks like any other node — it has named input and output ports. Internally it contains its own nodes and threads.

Patterns can be defined inline inside a .kti file using { } blocks, or shared as standalone .ktip files on GitHub and referenced by URL from any program.

How does data flow between nodes?

Output ports are connected to input ports by threads. When a node fires it pushes a message to each of its output threads. A message carries an ID, a port name, and a data payload.

Nodes that require multiple inputs (like add, which needs both a and b) wait until all required inputs have arrived with the same message ID before running. This is called syncing and ensures values from the same causal origin are always paired together.

What port types are supported?
TypeDescription
nullNo data payload — used as a trigger signal.
numberAn integer value.
textA string value.
booleanTrue or false.
objectA JSON object (key-value map).
arrayA JSON array (ordered list).
binaryA raw byte sequence — used by TCP, HTTP, and stream-handling nodes.
anyAccepts any data type.
What built-in node types are available?

Core

NodeWhat it does
startEntry point. Emits a trigger when the program begins.
literalEmits a fixed inline value when triggered.
constantStores a value (write) and re-emits it (read).
addAdds two numbers.
multiplyMultiplies two numbers.
divideDivides a by b.
negateArithmetic negation of a number.
compareEmits true if two values are equal.
branchRoutes to true or false based on a boolean.
mergeForwards any arriving message immediately.
printPrints a value to the console.
loopIteration building block — stores and re-emits a value per step.
eachIterates over lists and maps, emitting item + index per entry, then done.
divergePushes a new ID for parallel processing.
convergePops an ID after parallel processing.
storeKey-value store — set and get values by key.
sleepDelays a message by a fixed duration.
message-idGets the current message ID.
patternPackages a subgraph into a reusable node.

Collections

NodeWhat it does
map-getReads a value from a map by key.
map-setProduces a new map with a key set to a value.
list-popSplits a list into head and tail.
to-listCombines inputs into a list.
lengthGets the length of a list or text.
lines-to-mapConverts text lines to a map.
map-to-linesConverts a map to text lines.

Text

NodeWhat it does
splitSplits text into a list by delimiter.
joinJoins list elements into text.
json-encodeEncodes a value as JSON text.
url-parseParses a URL into its components.

Networking

NodeWhat it does
tcp-listenListens for incoming TCP connections.
tcp-writeWrites data to a TCP connection.
tcp-closeCloses a TCP connection.
http-parse-headersParses HTTP headers from text.
http-format-responseFormats an HTTP response.

Filesystem

NodeWhat it does
file-readReads a file via the bridge.
file-writeWrites a file via the bridge.
dir-readLists directory contents via the bridge.
dir-createCreates a directory via the bridge.

Streaming

NodeWhat it does
stream-splitSplits a stream into chunks.
stream-concatConcatenates streams together.
text-to-streamConverts text to a stream.
stream-to-textConverts a stream to text.
Can I share patterns with other people?

Yes. Save a pattern as a .ktip file, publish it to a public GitHub repository, and reference it in any program using the GitHub URL as the pattern ref:

pattern:adder:github.com/you/your-patterns/[email protected]

The app fetches the pattern at load time. Breaking changes should be released as a new major version following the /v2/, /v3/ path convention.

Can I save and reload my programs?

Yes. The editor lets you copy the .kti source of any program to the clipboard. Paste it back into the editor to reload it at any time. Programs can also be loaded from a file.

What looms exist?

A program's loom determines which node kinds are available. It is declared in the .kti file with a loom: line after program | .

LoomDescription
GeneralDefault. Runs in any environment using core nodes only.
ServerHTTP server programs that run via the kitengi-bridge. Adds TCP and streaming nodes.
BrowserBrowser-side programs (reserved).
DesktopDesktop application programs (reserved).
MobileMobile application programs (reserved).

A General program may be promoted to any specific loom. Once set, the loom is locked.

Is kitengi open source?

Yes. The language spec, runtimes, and community patterns are all open source on GitHub:

What debugging tools does the editor have?

The editor includes several tools to help you understand and debug programs:

  • Data flow visualization — nodes pulse and edges animate as messages flow through the graph, so you can see execution in real time.
  • Slow mode — slows down execution so you can follow each step visually.
  • Pause — pauses execution so you can inspect the current state of the graph.
  • Pending message badges — nodes display a count badge showing how many messages are waiting at their input ports.
  • Compare/diff — compare two versions of a .kti file side by side with a diff viewer.
  • Pattern test runner — view, create, and run test cases for patterns directly in the right panel.
Where can I find example programs?

The app includes built-in example programs — open the sidebar and look in the Examples section. You can also browse the spec repository on GitHub for annotated examples.