Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 70 additions & 15 deletions AGENT_FRAMEWORK.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,26 @@
# Activepieces Agent OS: The Unified Tool Framework
# Activepieces Route.X: The Unified Tool Framework

Welcome to the **Activepieces Agent OS**, a research-backed framework designed to optimize the bridge between automated workflows and autonomous AI agents.
Welcome to the **Activepieces Route.X**, a research-backed framework designed to optimize the bridge between automated workflows and autonomous AI agents.

## 🚀 The Three Pillars
## 🚀 The Four Pillars of Route.X

### 1. Cactus-Optimized Execution (Adaptive Routing)
Based on the **CactusRoute** 7-layer framework, every tool call in Activepieces is now optimized for the most reliable agentic experience:
- **Adaptive Repair**: Auto-corrects common LLM mistakes (time formats, negative numbers).
- **Semantic Guardrails**: Real-time hallucination detection by cross-checking prompts.
- **Deterministic Fallback**: Regex-based extraction to rescue failed LLM tool calls.

```mermaid
graph LR
Query[User Query] --> Cactus{Cactus Adaptive Layer}
Cactus --> L1[Difficulty]
Cactus --> L3[Repair]
Cactus --> L4[Guardrails]
Cactus --> L7[Extraction]
L7 --> Exec[Piece Action]
```

- **Layer 1: Difficulty Estimation**: Automatically assesses query complexity to route to the most efficient model.
- **Layer 3: Adaptive Repair**: Auto-corrects common LLM mistakes like time formats and negative numbers.
- **Layer 4: Semantic Guardrails**: Real-time hallucination detection by cross-checking prompts against parameters.
- **Layer 7: Deterministic Fallback**: Regex-based extraction to rescue failed LLM tool calls directly from user intent.

### 2. NANDA Protocol Integration (Decentralized Discovery)
Activepieces implements the **NANDA Stack** for the Open Agentic Web:
Expand All @@ -19,7 +31,14 @@ Activepieces implements the **NANDA Stack** for the Open Agentic Web:
### 3. Virtual Tool Orchestration (Guido Rule Engine)
Inspired by the **Guido** configuration manager, users can now build high-level "super-tools":
- **Tool Blending**: Aggregate properties from 280+ pieces into single optimized interfaces.
- **Conditional Validation**: Define logic-based rules to ensure data integrity during tool use.
- **Conditional Validation**: Define logic-based rules (if-then-else) to ensure data integrity.
- **Negation & Pattern Matching**: Advanced support for `NOT`, `CONTAINS`, and nested path validation.

### 4. Multi-Model Tooling (Mistral & Beyond)
Deep integration with leading AI providers to ensure maximum compatibility:
- **Mistral Native Tooling**: Optimized support for Mistral Large, Small, and Codestral.
- **Evaluation Loop**: Integrated **LLM-as-a-Judge** using Mistral's structured outputs to ensure RAG groundedness and relevance.
- **OpenAPI Auto-Import**: Dynamically generate MCP tools from any OpenAPI specification (inspired by `mcp-generator-2.0`).

## 🧩 New Framework Components

Expand All @@ -28,7 +47,7 @@ Inspired by the **Guido** configuration manager, users can now build high-level
| `cactus-utils.ts` | The neuro-symbolic engine for repair and validation. |
| `nanda-manifest-service.ts` | Generates the decentralized capability manifest. |
| `virtual-tool-service.ts` | Handles the blending of tools and rule execution. |
| `AI Agent Piece` | The user-facing bridge to trigger optimized workflows. |
| `Route.X Piece` | The user-facing bridge to trigger optimized workflows. |

## 🛠️ How to use the optimized metadata
Piece developers can now add AI-specific context to their actions:
Expand All @@ -49,19 +68,55 @@ export const myAction = createAction({
```

## 📚 Resources
- **[Quickstart Guide](docs/agent-os/quickstart.md)**: 3-step setup for research-backed Agents.
- **[Sample Templates](examples/agent-os/)**: Example workflows for CRM, Support, and Discovery.
- **[Quickstart Guide](docs/route-x/quickstart.md)**: 3-step setup for research-backed Agents.
- **[Sample Templates](examples/route-x/)**: Example workflows for CRM, Support, and Discovery.
Comment on lines 70 to +72
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify referenced documentation files exist

# Check if the referenced files and directories exist
if [ -f "docs/route-x/quickstart.md" ]; then
  echo "✓ docs/route-x/quickstart.md exists"
else
  echo "✗ docs/route-x/quickstart.md NOT FOUND"
fi

if [ -d "examples/route-x" ]; then
  echo "✓ examples/route-x/ directory exists"
  fd . examples/route-x --max-depth 1
else
  echo "✗ examples/route-x/ directory NOT FOUND"
fi

Repository: AGI-Corporation/Route.X

Length of output: 142


🏁 Script executed:

# Find all directories under examples/ to locate the correct path
fd --type d . examples --max-depth 2 | head -20

Repository: AGI-Corporation/Route.X

Length of output: 85


🏁 Script executed:

# List the full examples directory structure
find examples -type f -o -type d | head -30

# Also search for any references to "route-x" or "examples/" in markdown files
rg "examples/" --type md -A 2 -B 2 | head -50

Repository: AGI-Corporation/Route.X

Length of output: 832


Fix the broken documentation link to examples directory.

The referenced path examples/route-x/ does not exist in the repository. The actual examples are located in examples/agent-os/. Update the reference from examples/route-x/ to examples/agent-os/ to point to the correct directory containing example workflows.

Note: This same broken reference also appears in docs/route-x/quickstart.md and should be corrected there as well.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@AGENT_FRAMEWORK.md` around lines 70 - 72, Update the broken examples link by
replacing the string "examples/route-x/" with "examples/agent-os/" in the
AGENT_FRAMEWORK.md Resources section (the line that currently reads "- **[Sample
Templates](examples/route-x/)**") and make the same replacement inside
docs/route-x/quickstart.md to point both references to the correct examples
directory.

- **[CLI Reference](packages/cli/src/lib/commands/agent-optimize.ts)**: Optimization and Publishing commands.

## 🏥 Healthcare & Compliance (SMART on FHIR)
Activepieces Agent OS is now HIPAA-aligned through the **Proxy Smart** integration.
Activepieces Route.X is now HIPAA-aligned through the **Proxy Smart** integration.
- **Secure PHI Access**: Use the `FHIR` piece to interact with clinical data via a stateless proxy.
- **Agent Governance**: The NANDA manifest automatically broadcasts compliance flags (`HIPAA`, `GDPR`) to ensure agents only use clinical tools in secure environments.

## ⚖️ License & Community
The Agent OS framework is released under the **MIT License**. We follow the **[Code of Conduct](CODE_OF_CONDUCT.md)** to ensure a welcoming environment for all researchers and developers.
The Route.X framework is released under the **MIT License**. We follow the **[Code of Conduct](CODE_OF_CONDUCT.md)** to ensure a welcoming environment for all researchers and developers.

- **[Contributing](docs/route-x/CONTRIBUTING.md)**: Help us build the Internet of Agents.
- **[Security Policy](docs/route-x/SECURITY.md)**: AI-specific security guardrails.

By combining robust metadata with adaptive execution and decentralized discovery, Activepieces is now the foundational operating system for the next generation of Route.Xs.

- **[Contributing](docs/agent-os/CONTRIBUTING.md)**: Help us build the Internet of Agents.
- **[Security Policy](docs/agent-os/SECURITY.md)**: AI-specific security guardrails.
## 🏗️ Technical Specification

By combining robust metadata with adaptive execution and decentralized discovery, Activepieces is now the foundational operating system for the next generation of AI Agents.
### Layered Architecture
Route.X is architected as a series of nested middleware layers that wrap standard piece execution:

1. **Metadata Layer**: Enhances TypeBox schemas with `aiDescription` and `examples`.
2. **Discovery Layer (NANDA)**: Negotiates capabilities via `/.well-known/agent.json`.
3. **Governance Layer (Guido)**: Enforces business logic rules before execution.
4. **Adaptive Layer (Cactus)**: Repairs LLM input and provides deterministic fallback.
5. **Execution Layer**: Runs the piece action in an isolated sandbox.

### Protocol Interoperability
Route.X is designed to be the "TCP/IP" of the agentic web:
- **MCP**: Tool-use protocol for LLMs.
- **AgentFacts**: Discovery protocol for federated indexing.
- **Cactus-Native**: High-reliability execution protocol.

```mermaid
graph TD
subgraph "NANDA Network"
Index[NANDA Index]
Registry[Verified Trust Anchors]
end

subgraph "Activepieces Route.X"
Manifest[/.well-known/agent.json]
Rules[Guido Rule Engine]
Cactus[Cactus Adaptive Layer]
Sandbox[Action Sandbox]
end

Index <--> Manifest
Rules --> Cactus
Cactus --> Sandbox
```
82 changes: 82 additions & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Route.X Technical Architecture

This document outlines the unified architecture of the **Activepieces Route.X**, integrating research-backed protocols for adaptive execution, logic-based governance, and decentralized discovery.

## 📐 Unified Framework Overview

The Route.X acts as a high-reliability middleware stack between Route.Xs and the Activepieces piece ecosystem.

```mermaid
graph TD
subgraph "Phase 1: Discovery (NANDA)"
UserAgent([Route.X]) -->|Negotiate| Manifest[/.well-known/agent.json]
Manifest -->|Broadcasting| Index[NANDA Global Index]
end

subgraph "Phase 2: Governance (Guido)"
Manifest -->|Validated Request| RuleEngine{Guido Rule Engine}
RuleEngine -->|SET/NOT/CONTAINS| Policy[Business Policy]
end

subgraph "Phase 3: Adaptive Execution (Cactus)"
Policy -->|Optimized Payload| CactusPipeline{Cactus Adaptive Pipeline}
CactusPipeline --> L1[Difficulty Estimation]
CactusPipeline --> L3[Adaptive Repair]
CactusPipeline --> L4[Semantic Guardrails]
CactusPipeline --> L7[Deterministic Extraction]
end

subgraph "Phase 4: Execution & Feedback"
L7 -->|Verified Params| Sandbox[[Action Sandbox]]
Sandbox -->|Result| Answer[Generate Answer]
Answer -->|Mistral Judge| Eval{RAG Evaluation}
Eval -->|Groundedness| Feedback[Strategic Agent Feedback]
end

style L1 fill:#f9f,stroke:#333
style L3 fill:#bbf,stroke:#333
style L4 fill:#bfb,stroke:#333
style L7 fill:#fbb,stroke:#333
style Eval fill:#fffbba,stroke:#333
```

---

## 🚀 The Four Research Pillars

### 1. CactusRoute (Adaptive Routing)
**Goal**: 99.9% tool-calling reliability.
- **Layer 1 (Difficulty)**: Routes "easy" queries to fast SLMs and "hard" queries to reasoning-heavy models.
- **Layer 3 (Repair)**: Neuro-symbolic layer that auto-corrects LLM formatting errors (JSON, dates, units).
- **Layer 4 (Guardrails)**: Semantic cross-verification to prevent hallucinations.
- **Layer 7 (Fallback)**: High-precision regex extraction to rescue tool calls when the model fails.

### 2. Guido (Rule Engine)
**Goal**: Deterministic governance of autonomous tools.
- **Nested Pathing**: Support for validating deeply nested JSON objects.
- **State Logic**: Enforces `SET`, `SET_TO_VALUE`, `CONTAINS`, and `NOT` conditions.
- **Virtual Tooling**: Allows "blending" multiple piece actions into a single safe interface.

### 3. NANDA Protocol (Discovery)
**Goal**: Decentralized, trillion-scale agent interoperability.
- **AgentFacts (JSON-LD)**: Standardized capability manifests.
- **Verified Trust Anchors**: Secure tool-sharing via cryptographic anchors.
- **Federated Indexing**: Peer-to-peer discovery via standardized `/.well-known/` paths.

### 4. Mistral Evaluation (Observability)
**Goal**: Real-time quality control for RAG systems.
- **LLM as a Judge**: Uses Mistral Large to score outputs for context relevance and answer relevance.
- **Hallucination Detection**: Specific check for factual groundedness against source-of-truth contexts.
- **Structured Feedback**: Returns machine-readable evaluation reports to the calling agent.

---

## 🛠️ System Components

| Component | Responsibility | Technical Stack |
|-----------|----------------|-----------------|
| `mcp-server.ts` | Entry point for MCP/Agent requests | Model Context Protocol SDK |
| `cactus-utils.ts` | Adaptive repair and extraction logic | Regex, Neuro-symbolic heuristics |
| `virtual-tool-service.ts` | Tool blending and Guido rule execution | TypeORM, JSONPath logic |
| `nanda-manifest-service.ts` | Capability negotiation and manifest gen | JSON-LD, NANDA v1.0 |
| `evaluate-rag.ts` | Automated quality scoring | Mistral AI, Structured Outputs |
126 changes: 121 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,27 @@ src="https://github.com/activepieces/activepieces/assets/1812998/76c97441-c285-4
<br>
<br>

# 🤯 Welcome to MCP.My.ID
# 🤯 Welcome to Route.X

[![AGI Corp Agent OS](https://img.shields.io/badge/Agent%20OS-Enabled-brightgreen?style=for-the-badge&logo=ai)](AGENT_FRAMEWORK.md)
[![AGI Corp Route.X](https://img.shields.io/badge/Agent%20OS-Enabled-brightgreen?style=for-the-badge&logo=ai)](AGENT_FRAMEWORK.md)

All-in-one AI automation designed to be **extensible** through a **type-safe** pieces framework written in **TypeScript**.
When you contribute pieces to Activepieces they become automatically available as MCP servers that you can use with LLMs through Claude Desktop, Cursor or Windsurf!

<br>
<br>

## 🔥 Why MCP.My.Id is Different:
## 🔥 Why Route.X is Different:

- **💖 Loved by Everyone**: Intuitive interface and great experience for both technical and non-technical users with a quick learning curve.

![](/resources/templates.gif)

- **🌐 Open Ecosystem:** All pieces are open source and available on npmjs.com, **60% of the pieces are contributed by the community**.

- **🤖 Agent OS Pillar**: Built on research-backed adaptive routing (CactusRoute) and decentralized discovery (NANDA).
- **🤖 Route.X Pillar**: Built on research-backed adaptive routing (**CactusRoute**), logic-based validation (**Guido**), and decentralized discovery (**NANDA**).
- **🛠️ Largest open source MCP toolkit**: All our pieces (280+) are available as MCP that you can use with LLMs on Claude Desktop, Cursor or Windsurf.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Use a hyphenated compound adjective (open-source).

Line 68 should use open-source before “MCP toolkit” for correct grammar and clearer copy.

🧰 Tools
🪛 LanguageTool

[grammar] ~68-~68: Use a hyphen to join words.
Context: ...covery (NANDA). - 🛠️ Largest open source MCP toolkit: All our pieces (28...

(QB_NEW_EN_HYPHEN)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` at line 68, Update the README text that currently reads "open
source MCP toolkit" to use a hyphenated compound adjective: change it to
"open-source MCP toolkit" so the phrase before "MCP toolkit" is grammatically
correct; locate the string "open source MCP toolkit" in the README and replace
it with "open-source MCP toolkit".

- **🌬️ Deep Mistral Integration**: Native support for Mistral AI agents with optimized tool-calling performance.

- **🛠️ Pieces are written in Typescript**: Pieces are npm packages in TypeScript, offering full customization with the best developer experience, including **hot reloading** for **local** piece development on your machine. 😎

Expand Down Expand Up @@ -94,10 +95,125 @@ When you contribute pieces to Activepieces they become automatically available a
- [x] Flows are fully versioned.
- [x] Languages Translations
- [x] Customizable Templates
- [X] 200+ Pieces, check https://www.activepieces.com/pieces
- [X] 280+ Pieces, check https://www.activepieces.com/pieces
- [x] **Route.X Core**: Powered by **CactusRoute** (Adaptive Routing) & **Guido** (Rule Engine).
- [x] **Decentralized Discovery**: Native **NANDA Protocol** support via `/.well-known/agent.json`.
- [x] **OpenAPI Import**: Automatically generate MCP tools from OpenAPI specs (inspired by `mcp-generator-2.0`).
- [x] **Mistral AI**: Deep, native integration for high-performance agentic workflows and **LLM-as-a-Judge** evaluation.

**We release updates frequently. Check the product changelog for the latest features.**

<br>

## 🏗️ Route.X System Architecture

Activepieces Route.X is the world's first unified "Agentic Operating System" that bridges the gap between raw LLM capabilities and reliable enterprise automation.

### 🧩 The Multi-Layer Execution Stack
Every request processed by Route.X flows through a research-backed pipeline designed for 99.9% tool-calling reliability.

```mermaid
graph TD
subgraph "External World"
User([Human/Agent]) -- "Natural Language Task" --> OS
end

subgraph "Activepieces Route.X Core"
OS{Request Router}

subgraph "1. NANDA Discovery"
Discovery[Capability Negotiation]
Manifest[/.well-known/agent.json]
end

subgraph "2. Cactus Adaptive Layer"
Cactus{Adaptive Engine}
L1[Layer 1: Difficulty]
L3[Layer 3: Repair]
L4[Layer 4: Guardrails]
L7[Layer 7: Extraction]
end

subgraph "3. Guido Governance"
Guido[Rule Engine]
Blended[Virtual Tools]
end
end

subgraph "Execution"
Exec[[Piece Action Sandbox]]
Mistral{{Mistral/OpenAI Optimized}}
end

User --> Manifest
Manifest --> OS
OS --> Cactus
Cactus --> L1 --> L3 --> L4
L4 -- Fail --> L7
L4 -- Pass --> Guido
L7 --> Guido
Guido --> Blended --> Exec
Exec --> Mistral
```

---

## 📖 Branded Route.X User Guide

### 🛡️ Step 1: Secure Your Data with Virtual Tools (Guido)
Don't let agents hallucinate with raw APIs. Use **Virtual Tools** to create high-level, safe capabilities.

- **Blend**: Combine multiple actions into one logical tool (e.g., `CreateLead`).
- **Enforce**: Use the **Guido Rule Engine** to define mandatory conditions.
- *Example*: `IF recipient NOT CONTAINS '@company.com' THEN BLOCK.`

### 🔍 Step 2: Peer-to-Peer Discovery (NANDA)
Your Activepieces project is now a self-describing node on the Agentic Web.
- **Manifest**: Your project automatically broadcasts its capabilities via `/.well-known/agent.json`.
- **Global Index**: Register your project with the **NANDA Index** to allow billions of autonomous agents to find and use your tools securely.

### 🌬️ Step 3: High-Performance Execution (Mistral Native)
Experience the lowest latency in the industry with our **Mistral Deep Integration**.
- **Optimized Prompting**: We use Mistral's native tool-calling schemas for maximum precision.
- **Self-Correction**: Every call is protected by the **Cactus Adaptive Layer**, which automatically repairs model errors in real-time.

```mermaid
sequenceDiagram
participant Agent as Strategic Agent
participant AP as Activepieces Route.X
participant Piece as Secure Piece

Agent->>AP: Request Tool Discovery
AP-->>Agent: JSON-LD AgentFacts
Agent->>AP: Execute 'NotifyUser' (NLP)
AP->>AP: Cactus Layer: Repairing format...
AP->>AP: Guido Engine: Validating rules...
AP->>Piece: Executing Sandbox Action
Piece-->>Agent: Verified Result
```

### 🌬️ Mistral & OpenAI Optimization
Route.X comes with native optimization for the world's best models.
- **Mistral Native Tooling**: Optimized mappings for `mistral-large-latest`.
- **LLM as a Judge**: Built-in evaluation actions for RAG outputs (Mistral-powered).
- **OpenAPI Auto-Generator**: Import any `.json` or `.yaml` OpenAPI spec and instantly generate optimized MCP tools (powered by our `mcp-generator-2.0` logic).

[Read the full Route.X Documentation Hub](docs/route-x/about.md)

<br>

## 🔬 Research & Framework Integration

Route.X is the result of deep integration between several state-of-the-art agentic frameworks:

| Framework | Role in Route.X | Key Benefit |
|-----------|------------------|-------------|
| **[CactusRoute](https://github.com/quotentiroler/CactusRoute)** | Adaptive Execution | 99% success rate via 7-layer repair and fallback. |
| **[Guido](https://github.com/quotentiroler/Guido)** | Governance & Rules | Deterministic safety for autonomous tool use. |
| **[NANDA](https://projectnanda.org)** | Discovery Protocol | Decentralized, federated agent interoperability. |
| **[MCP Generator](https://github.com/quotentiroler/mcp-generator-2.0)** | Tool Ingestion | Instant conversion of OpenAPI specs to optimized tools. |

---

## 🔌 Create Your Own Piece

Expand Down
2 changes: 1 addition & 1 deletion docs/handbook/teams/ai.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: "AI Agent"
title: "Route.X"
icon: "robot"
---

Expand Down
6 changes: 5 additions & 1 deletion docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,12 @@
]
},
{
"group": "AI",
"group": "Route.X",
"pages": [
"route-x/about",
"route-x/quickstart",
"route-x/architecture",
"route-x/user-guide",
"ai/mcp"
]
},
Expand Down
Loading
Loading