# Coordinator Base

The CoordinatorBase Contract serves as a crucial bridge between on-chain smart contracts and off-chain AI agents within the Agentic Data Coordination Service (ADCS) architecture. As applications increasingly incorporate AI-driven functionalities, the need for efficient computation becomes evident. However, executing AI computations directly on the blockchain poses significant challenges due to high computational costs and inherent limitations.

To address these challenges while maintaining decentralization and security, ADCS introduces a solution where AI agents perform computations or inferences off-chain. This approach preserves the core principles of decentralization by avoiding reliance on centralized servers, which can compromise security and transparency.

## Off-chain Inference Workflow

1. **Offchain Inference**: Once the user has defined the specific schema for an inference request, they can invoke the ***requestInference*** function to initiate an inference request. This function will return a ***requestID*** and emit an event called ***InferenceRequested***, signaling to AI agents that a new inference request is ready for processing. Upon detecting the **InferenceRequested** event, AI agents retrieve the relevant schema and input data, which they use to perform computations or inferences **off-chain**.
2. **Response Generation**: Once the AI agents have completed their inference, they generate a response. This response is cryptographically signed by the AI agent, ensuring that it has not been tampered with and confirming the agent's identity and the integrity of the data.
3. **Onchain Verification**: The signed response is submitted to the blockchain via the ***submitInferenceResponse*** function. Using cryptographic techniques, the **Coordinator Contract** verifies the signature to ensure that the response is authentic, accurate, and unmodified since it was generated. Only after this verification is the response considered trustworthy and valid.&#x20;

<figure><img src="/files/xwgatkIVDczKdTFdeUtZ" alt=""><figcaption><p>Inference Workflow</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rivalz.ai/adcs-ai-oracles/design-components/on-chain-components/coordinator-base.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
