SEED / 000

ONE BECOMES ALL

DO NOT BUILD THE AGENT. BUILD THE CONDITIONS.

DESCEND / THESIS
GROWTH CHAMBER / LIVE

GENERATE SEED

EDIT INITIAL SEED
CONFIG + API KEY STORED UNENCRYPTED · GOAL NOT STORED · GENERATED AGENT CAN EXECUTE SHELL
NODE 18+ / STDIN
node --input-type=module <<'NODE'
import fs from "node:fs";
import {spawnSync} from "node:child_process";

const API="https://api.openai.com/v1/chat/completions";
const KEY="YOUR_API_KEY";
const MODEL="YOUR_MODEL";
const LOG=".seed-agent.jsonl";
const SEED="You are running inside a persistent loop.\nAfter every response or tool result, the complete conversation is loaded again and you are invoked again.\nA shell tool is available. The loop does not stop on its own.\n\nGoal:\n\n";

const tools=[{
  type:"function",
  function:{
    name:"shell",
    description:"Execute a shell command in the current working directory and return stdout, stderr, and exit status.",
    parameters:{
      type:"object",
      properties:{command:{type:"string",description:"Shell command to execute."}},
      required:["command"],
      additionalProperties:false
    }
  }
}];

const add=m=>fs.appendFileSync(LOG,JSON.stringify(m)+"\n");
const wait=ms=>new Promise(resolve=>setTimeout(resolve,ms));

if(!fs.existsSync(LOG))
  add({role:"user",content:SEED});

while(true){
  const messages=fs.readFileSync(LOG,"utf8")
    .split("\n").filter(Boolean).map(JSON.parse);

  let response;
  try{
    response=await fetch(API,{
      method:"POST",
      headers:{
        Authorization:`Bearer ${KEY}`,
        "Content-Type":"application/json"
      },
      body:JSON.stringify({model:MODEL,messages,tools,tool_choice:"auto"})
    });
  }catch(error){
    console.error("[network]",error instanceof Error?error.message:String(error));
    await wait(2000);
    continue;
  }

  if(!response.ok){
    console.error("[api]",response.status,await response.text());
    await wait(2000);
    continue;
  }

  const result=await response.json();
  const message=result.choices?.[0]?.message;
  if(!message){
    console.error("[api] invalid response",JSON.stringify(result));
    await wait(2000);
    continue;
  }

  const assistant={role:"assistant",content:message.content??null};
  if(message.tool_calls) assistant.tool_calls=message.tool_calls;
  add(assistant);

  if(message.content) console.log("\n"+message.content+"\n");

  for(const call of message.tool_calls||[]){
    let output;
    try{
      const {command}=JSON.parse(call.function.arguments);
      console.log("\n$ "+command);
      const process=spawnSync(command,{
        shell:true,
        encoding:"utf8",
        maxBuffer:64*1024*1024
      });
      output=(process.stdout||"")+(process.stderr||"")+
        `\n[exit ${process.status===null?"null":process.status}${process.signal?", signal "+process.signal:""}]`;
    }catch(error){
      output="[tool error] "+(error instanceof Error?error.message:String(error));
    }
    console.log(output);
    add({role:"tool",tool_call_id:call.id,content:output});
  }
}
NODE
∞ / LOOP
MINIMUM CONDITIONS / 003

SEED principles

  1. 01

    RECUR

    Output becomes input.

    OPEN

    Every response enters the next cycle. Continuity begins with a loop.

  2. 02

    ACCUMULATE

    Experience becomes state.

    OPEN

    No memory architecture is prescribed. The model decides how history is shaped.

  3. 03

    EMERGE

    Intelligence invents structure.

    OPEN

    No planner. No workflow. Only the conditions to see what intelligence creates.

THESIS / 001

LESS HARNESS.MORE AUTONOMY.

ONE BECOMES ALL