AGENT-NATIVE WORK

Graph your agent runtime

Connect reasoning, tools, and memory, then choose when your agent takes another turn

ARCHITECTURE

Inside an agent run

Ditto is a Node.js agent runtime by CodeSoul. Its Graph defines a round of computation, Workers execute the nodes, and the Loop uses the result to choose the next step

Make dependencies explicit

A Graph connects nodes through their input, output, and dependencies. This example loads text into Context, then selects items for inference.

Read the configuration reference
agent.json
  1. INPUTinput
  2. NODECONTEXT.LOAD
  3. NODECONTEXT.SELECT
  4. OUTPUTcontent

QUICKSTART

Bring the graph to life

Start with the Context Worker. This example runs with Node.js 24+ and npm 11+, with no model key or external service required

Full walkthrough
Install in an empty directory
npm init -y
npm pkg set type=module
npm install @codesoul-co/ditto
cp node_modules/@codesoul-co/ditto/agent_example.json agent.json

DOCUMENTATION

Build your own agent

Common questions

How does agent-native work differ from a human workflow?

Take a research report. A human workflow records who drafts it and who reviews it. In Ditto, the Graph describes how the agent gathers evidence and drafts an answer. If a source is missing, the Loop can send it back to search. We call this executable structure agent-native work.

Can I scale just one part of an agent?

Yes. Start in one process, then move a busy Worker to its own HTTP service. For example, give the inference Worker its own compute and replicas while memory stays on its current host. The Graph still calls the same nodes. Your deployment platform manages when to add or remove replicas.

Worker deployment guide
Can a coding LLM help me build the loop?

Draw the Graph in the editor, write agent.json by hand, or ask a coding LLM to edit that same file. It specifies dependencies, state updates, and stopping conditions. Review the diff, then use compileAgent() to validate the structure and compile an execution plan.

Graph editor examples
How can an agent improve its own harness?

Recursive self-improvement (RSI) can target the harness itself. For example, an agent can propose a graph that verifies sources before answering. Your application compiles the candidate, runs it and the current graph on the same evaluation set, and decides which version to use. You define the tests and the rule for accepting a change.

How do subgraphs and parallelism help agents work together?

A personal agent can reuse a retrieval subgraph across tasks. In a multi-agent system (MAS), a planner can send work to two specialists whose inputs are ready. They run in parallel up to the configured concurrency limit, and a synthesis node waits for both results before writing the report.

Run the multi-agent example

Have another technical question? Email the Ditto team
duanzhenke@code-soul.com