UOMI Logo
UOMI NETWORK

Build autonomous
agents with WASP

A powerful, minimal framework for creating autonomous agents using WebAssembly and Rust.

Powered by
Rust
WebAssembly
Node.js
$ npx wasp create
Creating a new WASP agent in my-agent...
✓ Project structure initialized
✓ Dependencies installed
Success! cd my-agent and npm start to begin
Scroll to explore
FEATURES

Everything you need

Powerful tools designed to make agent development intuitive and efficient

Hot Reloading

Instant feedback with our hot-reloading development environment for rapid iteration

WASM Performance

High-performance execution powered by WebAssembly and Rust's zero-cost abstractions

Interactive Console

Test your agents with rich commands, conversation history, and detailed metrics

Multiple LLM Support

Seamless integration with UOMI and third-party language models via a unified API

Debugging Tools

Comprehensive tools for debugging, performance monitoring, and error tracing

Version Control

Track agent evolution and development with built-in versioning and lifecycle management

CODE

Elegant by design

Write clean, concise code that's both powerful and easy to understand. WASP abstracts the complexity while giving you full control.

Type-safe Development

Leverage Rust's powerful type system

WebAssembly Optimization

Compiled to efficient, portable WASM

Intuitive Developer API

Clean, ergonomic interface for developers

agent.rs
Rust
use serde::{Deserialize, Serialize};
use utils::log;
mod utils;

#[derive(Serialize, Deserialize, Debug)]
struct Message {
    role: String,
    content: String,
}

fn parse_input(input: &str) -> Vec<Message> {
    // Parse the input string into a JSON Value
    let parsed: Vec<Message> = serde_json::from_str(input)
        .expect("Failed to parse input JSON");
    parsed
}

fn system_message(content: String) -> Message {
    Message {
        role: "system".to_string(),
        content,
    }
}

fn process_messages(
      system_message: Message, 
      mut messages: Vec<Message>) -> Vec<Message> {
    messages.insert(0, system_message);
    messages
}

#[no_mangle]
pub extern "C" fn run() {
    log("Start agent execution!");
    
    //get the input
    let input = utils::read_input();
    
    let input = String::from_utf8_lossy(&input);

    let input = parse_input(&input);
    
    //create a system message
    let system_message = system_message("You are a UOMI Agent!".to_string());

    let modified_messages = process_messages(system_message, input);
    
    let ai_input= serde_json::json!({
        "messages": modified_messages,
    }).to_string();

    let ai_input_bytes = ai_input.as_bytes().to_vec();

    let ai_response = utils::call_ai_service(1, ai_input_bytes);

    let ai_response_str = String::from_utf8(ai_response.clone()).unwrap();

    let ai_response_content = extract_ai_response_content(ai_response_str);

    let ai_response_content_bytes = ai_response_content.as_bytes().to_vec();

    // save output
    utils::save_output(&ai_response_content_bytes);
}
Write Rust Code
Compile to WASM
Deploy to UOMI
Execute On-Chain