ChronoAI Engine v4.0 · Open source

State on a timeline.
Computation as a graph.

ChronoAI is an open-source AI engine core. Put conversation state on a timeline, let the DAG propagate, let commands schedule themselves.

$npm i chronoai @chronoai/toolkit
t0t1t2t3t4user-inputsystem-promptmessages-readyai-responsecontent-bodykeyautotween
pointer t0
The model

Four primitives. The whole engine.

Declare timelines, write frames, let reaction frames recompute, let commands carry side effects. Reads like a paper. Writes like normal TypeScript.

timeline

Timeline

A directional axis. Each point holds a frame. The pointer moves; history retains.

keyautotween
frame

Frame

Three kinds: key (manual), auto (reaction — re-runs on trigger), tween (lazy on read).

dag

DAG Propagation

Write triggers a topological cascade: settle state, plan commands, execute, propagate again.

planexec
command

Command

Side effects carried explicitly. Plan decides what to call, execute streams writes back.

Code showcase

Declarative. Composable. Type-safe.

features/AssistantFeature.tsts
import { defineFeature, useTimeline, useCommand, reactionFrame } from 'chronoai';
 
export const AssistantFeature = defineFeature('assistant', () => {
// 1. 声明用户输入:手写关键帧
const userInput = useTimeline<string>({ name: 'user-input' });
 
// 2. 衍生时间轴:反应帧 — 触发器变化时自动重算
const messages = useTimeline<ChatMessage[]>({
name: 'messages-ready',
fill: reactionFrame({
triggers: { userInput },
compute({ userInput }) {
return [{ role: 'user', content: userInput.value }];
},
}),
});
 
// 3. 命令:DAG 收敛后调用 LLM
useCommand('call-llm', {
runAt: 'after-commit',
plan({ read }) {
return ModelCall.plan({ messages: read(messages).value });
},
});
});
Examples

Build from examples.