Zum Hauptinhalt springen

Agents

A Zeq agent is a state machine driven by an LLM with the operator catalogue as its toolbox. You give it a problem in plain language; it evolves operator combinations across generations until ZeqProof at the precision gate you chose accepts a result. Every tick lands on the entangled state, every operator choice is auditable, every reply carries a proof.

This is not "an LLM with prompts pretending to be deterministic." It's an LLM whose every move is bound by the kernel — the agent picks operators from the catalogue, the kernel computes the result, the result is hash-committed to your audit log before the next move. The LLM is the strategist; the kernel is the judge.


The runtime

┌─────────────────────────────────────────────────────────┐
│ POST /api/zeq/agent/spawn │
│ ────────────────────────────────────────────────────── │
│ problem: "optimal radiation shielding for │
│ 180-day Mars transit" │
│ population: 4 (genotypes per generation) │
│ generations: 3 (max generations) │
│ precision: 0.001 (≤0.1% fitness gate) │
│ credential_id: uuid? (BYOK; optional for HTML) │
│ cost: complexity-priced (agent_spawn) │
└────────────────────┬────────────────────────────────────┘


┌─────── Generation 1 ────────┐
│ 4 genotypes spawn │
│ ▸ each picks ≤4 operators │
│ ▸ kernel computes result │
│ ▸ ZeqProof scores fitness │
│ ▸ tick — complexity-priced │
│ ▸ committed to chain │
└─────────┬───────────────────┘

Survivors mate + mutate


Generation 2 ...


First genotype to clear ≤0.001 = WINNER
Result + proof + operator sequence returned

Cost math: every charge is complexity-priced in credits — compute units × the live compute price, resolved at call time (tier discounts apply). Spawn is agent_spawn2 × ⌈log₂(1 + N)⌉ units for a network of N machines, so spawn-spam throttles itself as the network grows. Each tick is agent_tick, derived from the operator complexity catalogue. Total ≈ spawn + population × generations ticks. With BYOK LLM enrichment the per-tick charge stays the same (you pay your provider directly). Spending order is fixed: free credits first, then paid ZEQ — see ZEQ economy.


Endpoints

MethodPathOperation (complexity-priced)Purpose
POST/api/zeq/agent/spawnagent_spawnSpawn a new run
POST/api/zeq/agent/:id/tickagent_tickManual tick (auto-tick fires on spawn)
POST/api/zeq/agent/:id/kill0Stop a run + write kill transition
GET/api/zeq/agent/list0Caller's active runs
GET/api/zeq/agent/:id0Run state + last tick result
GET/api/zeq/agent/mesh/:master_id0Live SSE stream of mesh activity
POST/api/zeq/agent/page-chatllm_page_chatLLM chat bound to the agent's chain
POST/api/zeq/agent/generate-htmlllm_html_generationLLM page generator (writes to chain)
POST/api/zeq/agent/skills/synthesiseskill_synthesisMid-run skill fill (when no operator covers a need)
POST/api/zeq/agent/operators/deriveoperator_derivationFive-step derivation of a new operator
POST/api/zeq/agent/operators/promote0Promote a successful derived operator into the catalogue

Full reference: API · Agent (the /api/zeq/agent/ group).


Agent ZIDs

Each spawned agent gets its own ZID-XXXXXXXX (8-char short ID) and a full ZID for cross-machine references. The ZID is the agent's handle across the picker, the audit log, the rail bridge, and the page-chat API. Killing an agent leaves its ZID and history forever — the entangled state keeps everything.


Skill synthesis (mid-run gap fill)

When the agent's LLM can't find an operator that fits the next move, it calls POST /api/zeq/agent/skills/synthesise:

{
"problem": "I need to integrate a constrained Hamiltonian over [0, 2π]
but no operator combines symplectic stepping with the boundary
constraint",
"context": { "kernel_version": "1.287.5", "operator_chain_so_far": [...] }
}

The response is a synthesised skill — a named, parameterised JSON-defined function the agent can call as if it were an operator. Cost: skill_synthesis — complexity-priced in credits. The skill is stored in synthesised_skills and auto-shared with the agent's parent state machine.


Operator derivation (five-step protocol)

When even synthesis isn't enough, the agent invokes the five-step derivation protocol — the formal route for deriving a new operator from first principles:

  1. Domain identification — which physical/mathematical domain
  2. Existing-operator survey — what the 1,500+ catalogue already covers
  3. Gap statement — what's missing
  4. Candidate equation — formal equation, not prose
  5. Verification path — how to test it against ZeqProof

If the verification path passes, the operator is stored in derived_operators. If a derived operator survives 100+ uses with ≥99% fitness, the agent can call /operators/promote and it joins the canonical catalogue (foundation review required).

Cost per derivation: operator_derivation — complexity-priced in credits.


Why this works

  • Genetic = honest exploration. No prompt-engineering tricks; the population × generations search is the only way to find non-obvious operator combinations.
  • ZeqProof gate = no hallucinations. A genotype that doesn't numerically clear the precision gate is killed. The kernel is the judge, the LLM is the candidate.
  • All on the entangled state = auditable. Every tick, every operator choice, every result, every proof envelope is hash-committed. You can replay any agent run end-to-end years later and verify the math is the same.
  • Bring-your-own LLM. Pass a credential_id from your BYOK list and the per-tick LLM enrichment uses your provider; you pay your provider directly, not the framework.

Spawn from the admin UI

Open /state/admin/ai/ (the AI tab on per-entangled state admin). The "Spawn an agent" card has the same form as the API endpoint:

  • Problem (plain language)
  • Population × Generations × Precision gate
  • Optional BYOK credential
  • Estimated cost preview

Spawn and watch generations tick live. Same module powers the rail picker on every hosted page.