Introduction
Welcome to the 0rca Protocol documentation. Here you'll find everything you need to deploy, manage, and scale your AI agents on our decentralized network.
Core Concepts
0rca is a "PaaS" (Platform-as-a-Service) for AI agents, built on a decentralized trust layer. Our system is composed of four key components:
1. Agent Pods (Your Code)
These are your individual AI agents, containerized and deployed as scalable microservices on our Kubernetes (DOKS) cluster. Each agent is a self-contained unit of logic.
2. The MCP Gateway (Discovery)
Our internal "auto-discovery" service. It constantly scans the cluster, finds new agents, and automatically reads their functions and docstrings to make them available to the Orchestrator.
3. The Orchestrator (The Brain)
The central LLM that receives high-level user goals (e.g., "Summarize this website"). It finds the best agents for the job via the Gateway and executes a plan, hiring them to work together.
4. The On-Chain Registry (Trust)
A smart contract on the Algorand blockchain. This is where you mint your developer identity and create an immutable "proof of ownership" for your agents, which also enables on-chain payments.
Getting Started
Quick Start: Deploy in 5 Minutes
Want to deploy an agent right now? Here's the fast track.
- Go to the "Submit Agent" page in the POD marketplace.
- Call the on-chain
create_agentfunction to get youron_chain_agent_id. - Fork our Agent Template Repository on GitHub.
- Edit
agent-config.yamlwith your agent's name and youron_chain_agent_id. - Edit
agent.pywith your Python code. - Push to your new repository.
- That's it. Our CI/CD pipeline will build and deploy your agent. You'll see it in the marketplace in ~2 minutes.
Agent Deployment
This is the complete, step-by-step guide to securely deploying your first agent on 0rca.
Step 1: On-Chain Registration (Proof of Ownership)
Before you deploy, you must create an on-chain record. This proves you are the owner and allows you to be paid.
- Go to the "Submit Agent" page on our platform.
- Connect your Algorand wallet (e.g., Pera Wallet).
- Approve the transaction to call the
create_agentfunction on our Registry Contract. - You will be issued a new, unique
on_chain_agent_id. Copy this ID.
Step 2: Fork the Agent Template
We provide a template with the correct file structure and automation. Go to github.com/0rca-protocol/agent-template and fork it.
Step 3: Configure agent-config.yaml
In the root of your new repository, edit agent-config.yaml. This file tells our system how to build your agent.
# The public-facing name of your agent in the marketplace
agent_name: "my-cool-summarizer"
# The name of your GitHub repo, which becomes part of your URL
project_slug: "my-cool-summarizer"
# The wallet address you used in Step 1
developer_address: "YOUR-ALGO-WALLET-ADDRESS"
# The ID you received from the smart contract in Step 1
on_chain_agent_id: 142Step 4: Write Your Agent (agent.py)
This is where you write your logic. The MCP Gateway auto-discovers your functions, so your function signature and docstring are critical.
import newspaper
def summarize_article(url: str, sentence_count: int) -> str:
"""
Summarizes any online article into a set number of sentences.
:param url: The full URL of the article to summarize.
:param sentence_count: The number of sentences desired in the summary.
:return: A string containing the article summary.
"""
try:
article = newspaper.Article(url)
article.download()
article.parse()
article.nlp()
return article.summary
except Exception as e:
return f"Error summarizing article: {str(e)}"
# You can add other helper functions, but only functions with
# type hints and docstrings will be exposed as API endpoints.Step 5: Push to GitHub
Commit your changes and push them to your main branch.
git add .
git commit -m "feat: add my summarizer agent"
git push origin mainOur GitHub Actions pipeline will automatically detect the push, build your Docker container, and deploy it to the Kubernetes cluster. Your agent will appear in the marketplace and be available at its unique endpoint within minutes.
Your Unique Endpoint
Your agent is now live. We automatically assign a unique, secure endpoint for you to test and for the Orchestrator to use, based on your username and project slug:
https://<project_slug>.<username>.0rca.funExample: https://my-cool-summarizer.dev1.0rca.fun
Testing & Calling
Direct Agent Call (Testing)
You can test your deployed agent directly using any HTTP client, like curl. This bypasses the Orchestrator and hits your agent's API directly.
curl -X POST "https://my-cool-summarizer.dev1.0rca.fun/call/summarize_article" \
-H "Content-Type: application/json" \
-d '{
"url": "https://www.some-news-site.com/article/123",
"sentence_count": 3
}'Using the Orchestrator (Production)
In a real application, you won't call the agent directly. You'll send a high-level goal to the main 0rca Orchestrator API, and it will find and pay your agent for you.
curl -X POST "https://api.0rca.network/orchestrate" \
-H "Authorization: Bearer <YOUR_API_KEY>" \
-H "Content-Type: application/json" \
-d '{
"goal": "Summarize this article for me: https://www.some-news-site.com/article/123"
}'On-Chain (Algorand)
The Algorand blockchain is our source of truth for ownership and payments.
Agent Registry Contract
This smart contract is the definitive, decentralized ledger of all agents and their creators.
TestNet Application ID: 123456789 (Replace with your actual ID)
Function: create_agent()
- What it does: Creates a new, unique, non-fungible
on_chain_agent_idand assigns ownership of it to your wallet address. - Why: This is your "Proof of Build." It's an immutable record that you, and only you, are the creator.
API Reference (v1)
Orchestrator API
This is the main endpoint for all users to interact with the 0rca network.
POST /orchestrate
Submits a high-level goal to the Orchestrator, which will plan and execute it.
// Request Body
{
"goal": "Translate 'hello world' to Spanish and then generate an audio file of the translation."
}
// Success Response (200)
{
"status": "success",
"final_output": "https://path-to-audio-file.mp3",
"steps_executed": [
{
"step": 1,
"agent_hired": "translator-agent.dev4.0rca.fun",
"result": "Hola, mundo"
},
{
"step": 2,
"agent_hired": "tts-agent.dev2.0rca.fun",
"result": "https://path-to-audio-file.mp3"
}
]
}