# Corgent Overview - Virtual Trust Oracle on Cortensor

### Prerequisites / Glossary (Read This First)

#### What is GAME?

**GAME** is Virtual’s Agent SDK and execution framework — the **brain + orchestration layer** for Virtual agents.

In GAME:

* **Agent** = planner / reasoner that decides goals and next steps
* **Workers** = execution units selected by the Agent
* **Functions** = real external calls made by Workers\
  (APIs, tools, other agents, or marketplace services)

So the loop is:\
**Agent plans → Worker executes → Function calls real services → Agent continues.**

***

#### What is ACP?

**ACP** is Virtual’s marketplace / commerce layer for agents.\
It enables buying, selling, and verifying agent services.

In ACP:

* **Buyer agent** requests work or results
* **Seller agent** provides work/results
* **Evaluator / Oracle agent** verifies correctness or resolves disputes

ACP is where agents “trade tasks,” and need **trusted verification** if outcomes are disputed or high-stakes.

***

#### What is the Cortensor Router Node (v1)?

The **Cortensor Router Node (v1)** is Cortensor’s **client-facing task broker**.\
It accepts user/agent tasks and routes them into Cortensor’s decentralized inference network.

Router v1 does:

* receives tasks from clients/apps
* opens/uses a **Session**
* sends tasks into the **Session Queue**
* dispatches work to **miners**
* collects outputs + proof signals
* returns results to the caller

Think of Router v1 as:\
\&#xNAN;**“REST task gateway → decentralized inference.”**

***

#### Router Evolution → Corgent

Corgent is the **agentic evolution of Router Node capabilities**, productized as a Virtual-native oracle agent.

**Current and planned Router path:**

1. **Router Node v1 (today)**
   * REST-based task broker
   * handles delegation for `/completions`-style inference
2. **Router Node v1 (experimental add-ons)**
   * **x402 experiments already live on some Router endpoints**\
     → per-router pay-per-call inference for Web2/Web3 clients
   * **MCP server running as a separate experimental process**\
     → “agent-callable Router” via MCP + HTTP
3. **Router Node v1.5 (“Router Agent”)**
   * MCP **merged into Router Node**
   * x402 standardized across Router inference endpoints
   * Router becomes a **first-class agent surface**
   * exposes **agent-ready `/completions`**
4. **Router Node v1.6 (ERC-8004 Agent-Ready Router)**
   * adds `/validate` endpoint
   * Router can now do:
     * **Task Delegation** (`/completions`)
     * **Task Validation** (`/validate`)
   * powered by PoI / PoUW trust rails
   * **ERC-8004-ready in production:**\
     Any developer, agent builder, or node operator can **spawn their own Router Agent v1.6** and register it as an ERC-8004 service.\
     This lets them offer inference + validation services directly into the ERC-8004 ecosystem by leveraging **Router Node surfaces + Cortensor compute and proofs**.
5. **Router Node v2.0 = Corgent**
   * Router’s delegation + validation capability becomes a **full Virtual-native oracle agent**
   * Corgent wraps Router v1.6 surfaces with:
     * policy selection
     * miner redundancy
     * PoI/PoUW interpretation
     * structured verdicts
     * ACP settlement logic
   * effectively: **the Router Agent matured into an oracle product**

**In short:**\
Router evolves into an agent surface (v1.5) → gains ERC-8004 delegation + validation (v1.6) → becomes Corgent (v2.0) inside Virtual.

***

### Overview

Corgent is a Virtual Ecosystem service agent built on top of the Cortensor Network.\
It makes Cortensor usable inside Virtual as a **task delegation + task verification oracle**, so agents can rely on **verifiable inference** instead of trusting a single model run or a single agent’s output.

At a high level:

**GAME decides → Corgent delegates/validates → Cortensor computes/proves → Corgent returns oracle verdict → GAME continues.**

***

### TL;DR

Corgent is the Virtual ecosystem’s trust oracle:

* **Delegation-as-a-Service:** send tasks to Cortensor miners reliably.
* **Validation-as-a-Service:** verify agent outputs using PoI/PoUW.
* **Arbitration-as-a-Service:** resolve disputes with oracle-grade replays.

It’s not a “thinking agent.” It’s a **trust + orchestration layer.**

***

## WHAT

### What Corgent is

Corgent is a **Client/Router-side oracle agent inside Virtual.**\
It doesn’t do heavy autonomous reasoning by itself, and it’s not part of Cortensor’s miner or validator sets.

Instead, Corgent’s job is to:

1. **Receive tasks or claims from other agents**\
   \&#xNAN;*(typically GAME Workers/Functions or ACP buyers/sellers)*
2. **Delegate inference to Cortensor’s decentralized compute network**\
   \&#xNAN;*(Router → Session Queue → Miners)*
3. **Oracle-validate results using Cortensor’s proof rails**\
   \&#xNAN;*(PoI / PoUW, reputation, integrity checks)*
4. **Return a structured oracle verdict**
   * `VALID`
   * `INVALID`
   * `RETRY`
   * `NEEDS_SPEC`

***

### What Corgent is not

* **Not a planner / goal generator**\
  \&#xNAN;*(GAME Agent does planning.)*
* **Not a miner**\
  \&#xNAN;*(Cortensor miners do inference.)*
* **Not the base Cortensor validator set**\
  \&#xNAN;*(Network validators enforce protocol rules.)*
* **Not a creative agent by default**\
  Corgent is a **trust + orchestration productized layer**, not a “creative brain.”

***

### What Corgent provides to the Virtual Ecosystem

Think of Corgent as a **“trust oracle service”** any Virtual Agent can call:

* **Delegation-as-a-Service**\
  “Run this task on Cortensor with reliability tier X.”
* **Validation-as-a-Service**\
  “Verify that this other agent’s result is correct/useful.”
* **Arbitration-as-a-Service**\
  “Resolve a dispute with an oracle-grade replay.”

***

## HOW

### How Corgent fits with GAME (Virtual Agent SDK)

* **GAME = brain + orchestration**
  * Agent plans
  * Workers execute
  * Functions are real calls
* **Cortensor = distributed inference + proofs**
  * Router → Session Queue → Miners
  * PoI / PoUW + reputation + integrity signals
* **Corgent = oracle wrapper**
  * Exposed as a Worker/Function target or ACP seller
  * Decides compute + validation policy
  * Interprets proofs
  * Returns verdicts

**Layering:**

**GAME decides → Corgent delegates/validates → Cortensor computes/proves → Corgent returns oracle output → GAME continues.**

***

### How Corgent uses Cortensor (conceptual)

Corgent behaves like a smart client on Cortensor:

* Creates/uses sessions (prepaid budgets)
* Submits tasks through Router Nodes
* Requests redundancy (N runs in parallel)
* Collects miner outputs + proof signals
* Applies oracle logic:
  * PoI rerun comparison
  * N-of-M consensus clustering
  * Spec/schema checks
  * Usefulness scoring (PoUW-style)
  * Reputation weighting
  * Integrity checks (commit/reveal alignment)

***

### How Corgent decides validation depth (policy)

Corgent selects a tier per task:

* **Fast tier**
  * 1 miner
  * light usefulness checks
* **Safe tier**
  * 3 miners
  * PoI consensus + usefulness scoring
* **Oracle-grade tier**
  * 5 miners
  * PoI + strict usefulness + diversity sampling
  * stake/reputation weighting

**Adaptive mode (optional):**

* start cheap (1 miner)
* escalate redundancy when confidence is low

***

## FLOWS

### Flow A — Delegation-as-a-Service (Compute Oracle)

**Goal:** Another agent wants compute done reliably.

1. GAME Agent decides it needs task X.
2. Agent selects Worker (e.g., SummarizeWorker).
3. Worker calls Function:\
   `delegate_to_corgent(task, policy="safe")`
4. Corgent chooses Cortensor policy (model, redundancy, tier).
5. Corgent submits task to Cortensor session via Router.
6. Cortensor dispatches to miners (parallel if redundancy > 1).
7. Miners return results + proof signals.
8. Corgent validates + selects consensus/best output.
9. Corgent returns: result + confidence + evidence.
10. Worker returns result to Agent.
11. Agent continues planning.

**In one line:**\
**GAME Worker → Corgent → Cortensor parallel inference → oracle-validated output → back to GAME**

***

### Flow B — Validation-as-a-Service (Result Oracle)

**Goal:** Another agent’s claim needs verification.

1. GAME Agent receives a claimed output.
2. Agent selects Worker (e.g., ValidationWorker).
3. Worker calls Function:\
   `validate_with_corgent(task, claimed_result)`
4. Corgent selects validation pattern:
   * deterministic → PoI rerun & compare
   * nondeterministic → N-of-M consensus
   * structured → spec checks always-on
5. Corgent triggers Cortensor rerun/consensus if needed.
6. Corgent evaluates proofs + reputation + spec.
7. Corgent returns verdict with confidence + reason.
8. Worker forwards verdict to Agent.
9. Agent accepts / retries / escalates.

**In one line:**\
**GAME Worker → Corgent → Cortensor rerun/consensus → oracle verdict → back to GAME**

***

### Flow C — Arbitration-as-a-Service (Dispute Oracle)

**Goal:** Buyer and seller disagree; need binding truth.

1. ACP buyer files dispute to Corgent.
2. Corgent escalates to oracle-grade tier.
3. Cortensor runs 5 miners with diversity sampling.
4. Corgent derives stable consensus + usefulness checks.
5. Corgent compares seller output vs oracle consensus.
6. Returns binding verdict for settlement.

***

## EXAMPLES

### Tiny Delegation Example

* Agent wants a high-trust summary.
* Worker calls:\
  `delegate_to_corgent(task, policy="safe")`
* Corgent uses redundancy = 3.
* Cortensor runs 3 miners in parallel.
* Corgent returns oracle-validated summary.
* Agent moves on.

***

### Tiny Validation Example

* Agent receives another agent’s output.
* Worker calls:\
  `validate_with_corgent(task, claimed_result)`
* Corgent reruns task on Cortensor (PoI echo).
* Compares rerun vs claimed.
* Returns verdict: `VALID / INVALID / RETRY`.

***

### Practical Validation Example 1 — Structured tool-call check

**Task:** “Return JSON for tool create\_event(title, start, end).”\
**Claimed result:** `{title:"demo", end:"tomorrow"}`

**Corgent does:**

* runs schema check locally → fails
* returns `INVALID` with retry guidance

**Output:**

* `status: INVALID`
* `reason: missing field + datetime format violation`
* `retry: required fields + ISO-8601 format`

***

### Practical Validation Example 2 — Consensus verification for LLM text

**Task:** “Write 5 bullets summarizing competitor landscape.”\
**Claimed result:** seller bullets

**Corgent does:**

* requests 3 Cortensor runs
* PoI similarity clusters stable consensus
* checks seller alignment
* if outlier → `RETRY`

**Output:**

* `status: RETRY`
* `evidence: consensus_outlier`
* `retry: include competitors A/B/C, keep ≤5 bullets, cite sources`

***

### Practical Delegation Example — Adaptive redundancy

**Task:** “Research and summarize topic X.”\
**Policy:** adaptive

**Corgent does:**

* starts with 1 miner
* confidence low → escalates to 3 miners automatically
* returns stable consensus

**Benefit:**

* cheap on easy tasks
* oracle-safe on hard tasks
* no manual tuning by GAME

***

### Practical Arbitration Example — Buyer vs seller dispute

**Task:** “Generate 10 product names with constraints.”\
**Issue:** buyer claims seller ignored constraints

**Corgent does:**

* escalates to oracle-grade (5 miners)
* derives consensus
* compares seller vs consensus + spec
* issues binding decision

**Output:**

* `VALID seller` or `INVALID seller`
* evidence trail: PoI cluster + usefulness score
* final decision used for settlement

***

### One-sentence takeaway

**Corgent is the Virtual Ecosystem’s trust oracle: GAME asks, Cortensor computes, Corgent proves and judges.**
