# High-Level Architecture

### <mark style="color:green;">Glitch Gremlin's</mark> Architecture Relies on a Split Between On-Chain and Off-Chain Components&#x20;

#### On-Chain:

A Solana program (“*GlitchGremlinProgram*”) that handles token escrow, records chaos requests, updates request states, and provides governance hooks.

#### Off-Chain:&#x20;

An AI-driven aggregator that periodically queries the blockchain for pending chaos requests, performs the requested tasks in a test environment, and writes back the results to the chain.

***

<mark style="background-color:yellow;">By offloading the computationally heavy and dynamic AI tasks to an off-chain environment, the system preserves Solana’s throughput and keeps costs predictable. The on-chain program maintains trustless accountability and ensures that $GREMLINAI tokens are properly managed.</mark>


---

# 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://ggai.gitbook.io/ggai-docs/high-level-architecture.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.
