# Compound Agents and Workflows

#### 1. Role in the REVOX Ecosystem

REVOX is not just a collection of independent agents - it is an **orchestration system**. Compound Agents represent the next level of intelligence: they are **assembled from Primitive Agents, Plugins, and Context Knowledge** into workflows that can accomplish complex, multi-step objectives.

Workflows provide the **blueprint** for how these components interact. This transforms the ecosystem from a set of isolated functions into a **flexible, composable network** capable of adapting to both developer-defined logic and user-driven prompts.

***

#### 2. Architecture of Workflows

* **Domain-Specific Language (DSL)**
  * A lightweight scripting framework that allows developers to define agent interactions with precision.
  * Supports branching logic, loops, conditional triggers, and parallel execution.
  * Example: A developer writes a workflow that *monitors ETH gas fees every 10 seconds and only triggers swaps when network cost is below a set threshold*.
* **Prompt-Based Assembly**
  * For non-technical users, workflows can be created by simply describing goals in natural language.
  * The system interprets the prompt, maps it to relevant agents and plugins, and builds the workflow automatically.
  * Example: A user types *“Alert me when Uniswap liquidity for REX/USDT drops below $1M and recommend an alternative pool.”*
* **Composability as a Core Principle**
  * Workflows allow simple blocks to be chained, nested, or reused.
  * A Compound Agent can itself be reused as a building block inside a larger workflow, creating hierarchical systems.
  * This composability ensures scalability: small, well-tested modules can be continuously recombined into novel solutions.

***

#### 3. Practical Examples

* **DeFi Liquidation Guard**
  * **Workflow**: Wallet Agent + Token Price Plugin + Prediction Agent.
  * **Function**: Continuously monitors loan collateral on Aave. If the health factor approaches 1.1, the workflow triggers an alert, calculates repayment options, and executes a partial repayment if approved by the user.

<figure><img src="/files/3s80s4JCimdalygVtcA5" alt="" width="563"><figcaption></figcaption></figure>

* **Cross-Chain Arbitrage Agent**

  * **Workflow**: Ticker Agent + Chain RPC Plugin (BSC & Arbitrum) + Wallet Agent.
  * **Function**: Detects price gaps between DEXs on different chains. Executes a two-legged swap if price differential >2% and estimated gas fees <0.5% of trade size.

  <figure><img src="/files/2yhEitk48vL4nMxb6fOs" alt="" width="563"><figcaption></figcaption></figure>
* **DAO Proposal Monitor**

  * **Workflow**: Context Knowledge (Governance Archive) + Etherscan Plugin + Sentiment Plugin.
  * **Function**: Tracks new DAO proposals, summarizes historical context, checks Twitter sentiment, and delivers a digest report to the user’s Web Extension dashboard.

  <figure><img src="/files/KkOmHpyIX1LhP469i6a4" alt="" width="563"><figcaption></figcaption></figure>
* **E-Commerce Shopping Agent**
  * **Workflow**: SKU Knowledge Base + Location Plugin + Payment Plugin.
  * **Function**: Finds the cheapest vendor for a specified product, compares shipping times to the user’s location, and automates checkout with stored wallet credentials.

<figure><img src="/files/Li0QUx7wU9DzWT9SDlS7" alt="" width="563"><figcaption></figcaption></figure>

* **Research Automation**
  * **Workflow**: Google Search Plugin + Context Knowledge (whitepapers) + Chart Agent.
  * **Function**: Gathers latest AI+blockchain papers, extracts methodology sections, compares with known models in Context Knowledge, and visualizes innovation trends.

***

#### 4. Advantages of Workflows

* **For Developers**
  * Fine-grained control with DSL, enabling reproducible, testable, and scalable automation.
  * Modular design reduces duplication - tested building blocks can be reused in new workflows.
* **For Users**
  * Natural language prompts lower the barrier: powerful workflows can be created without coding.
  * Intuitive UI integration via the REVOX Web Extension allows oversight, quick edits, and visualization of workflow execution.


---

# 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.revox.ai/building-blocks-of-revox/compound-agents-and-workflows.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.
