moonkoog — a MoonBit port of JetBrains Koog (1.1.1): a type-safe agent-orchestration framework. The prompt/message model, LLM client contract, tool registry with a JSON-schema descriptor model, and the AIAgent tool-calling loop (Koog's singleRunStrategy), built to compose with the moon-heke full-stack suite.
Dependencies
// A tool: name + JSON-schema descriptor, and a body that runs on decoded args.
struct Add {}
impl @tools.Tool for Add with descriptor(_) {
{
name: "add",
description: "add two integers a and b",
required_parameters: [
{ name: "a", description: "first", ptype: @tools.TInteger },
{ name: "b", description: "second", ptype: @tools.TInteger },
],
optional_parameters: [],
}
}
impl @tools.Tool for Add with execute_raw(_, args) { /* a + b */ ... }
// An agent over any LLM client (a scripted MockClient in tests; the real
// DeepSeek/OpenAI-compatible client rides moonllm — see the roadmap).
let agent = @agent.AIAgent::new(
client,
model=@llm.deepseek_v4_flash,
tool_registry=@tools.ToolRegistry::new().add(Add::{}),
)
let answer = agent.run("what is 2 + 3?") // -> the model's final text| Koog concern | Koog module (1.1.1) | moonkoog |
|---|---|---|
| Message / Prompt / PromptBuilder | prompt-model | prompt/ |
| LLModel / LLMProvider / LLMCapability | prompt-llm | llm/ |
| Tool / ToolDescriptor / ToolRegistry | agents-tools | tools/ |
| LLMClient contract, AIAgent, singleRunStrategy | prompt-executor-clients, agents-core | agent/ |
$ moon check --target all --deny-warn
$ moon test --target all # pure packages on every backend; the agent loop on nativemoonkoog — a MoonBit port of JetBrains Koog (1.1.1): a type-safe agent-orchestration framework. The prompt/message model, LLM client contract, tool registry with a JSON-schema descriptor model, and the AIAgent tool-calling loop (Koog's singleRunStrategy), built to compose with the moon-heke full-stack suite.
Dependencies