LogoLogo
  • JuliaOS Documentation Hub
  • About JuliaOS
    • Mission & Vision
    • Features and Capabilities
    • Roadmap
    • Tokenomics
  • Ecosystem
    • Overview
  • Partners
    • Heurist
    • Fetch.ai
    • Soulgraph
    • cheqd.io
    • Aethir
    • Anyone
    • TensorLabs
    • Hashpower
  • Technology
    • Overview
    • Open Source
      • Modular Framework
      • CLI Mode
    • AI Platform
      • Dashboard
      • Agent Management
      • Swarm Management
      • Marketplace
      • Mining
    • LLM
    • Launchpad
    • Robotics & IOT
      • SwarmIOT
      • Modular AI with Robotics
        • J3OS MiniLLM
          • 🔧 Use Cases
  • Technical
    • Overview
    • Developer Hub
      • Getting Started
        • Installation Guide
          • Github Guide
        • Basic Concepts
        • Quick Start Guide
          • Handling secrets
        • Examples and Use
          • Example: Using the Trading Functionality
          • Example: Using the Benchmarking Feature
          • Example: Multi-Agent Swarm Coordination
          • Example: Using the Python Wrapper for LLM Integration
          • Example: Using Cross-Chain Bridges
          • Example: Creating and Running a Swarm Optimization
          • Page 4
      • Best Practices
        • Performance Tuning
        • Agent/Swarm Design Patterns
        • Best Practices & Patterns
        • Security Best Practices
      • CLI
        • JuliaOS CLI Interface
        • Agent Management (CLI)
        • CLI Configuration
        • Cross-Chain Hub (CLI)
        • Swarm Management (CLI)
        • CLI Troubleshooting
        • Wallet Management (CLI)
      • Framework SDK
        • Modules
          • Bridge
          • Agents Module
          • Dex
          • Swarms Module
          • Wallet
        • Python Wrapper
          • LangChain Integration
          • Python Wrapper
      • Contributing Guide
      • Extending JuliaOS
      • Development Setup & Conventions
      • Testing & Debugging
      • Troubleshooting
    • Architecture
      • High Level JuliaOS
      • CLI <-> Backend Communication
      • Data Storage Architecture
      • Framework Internals
      • Architecture Deep Dive
        • Architectual Notes
    • Concepts
      • Core Features & Concepts
      • Agents
        • Agent Skills & Specializations
      • Swarms
      • Neural Networks
      • Blockchains & Chains
      • Bridges (Cross-Chain)
      • Integrations
        • Google ADK
        • LLMs
        • Price Feed
        • DEX Integration
      • Storage
      • Trading Capabilities
      • Use Cases
      • Wallets
      • Portfolio Optimization
  • Research
    • JuliaOS Research
  • API Documentation
    • API Reference
      • API Reference: Julia Backend Commands
      • API Reference: CLI Commands
      • API Reference: Node.js API
      • API Reference: Python API
      • API Reference
  • Community
    • Community & Support
  • FAQ
    • General
    • Technical
    • Community
Powered by GitBook
On this page
  • Node.js/TypeScript API
  • Julia Bridge
  • Agent Manager
  • Swarm Manager
  • Wallet Manager
  • Python API
  • JuliaOS Client
  • Agent API
  • Swarm API
  • Wallet API
  • Julia API
  • Command Reference
  • Event Reference
Export as PDF
  1. API Documentation

API Reference

This reference documents the key APIs for JuliaOS, including Node.js, Julia, and Python interfaces.

Node.js/TypeScript API

Julia Bridge

The Julia Bridge provides a communication channel between Node.js and the Julia backend.

import { JuliaBridge } from './packages/julia-bridge';

// Initialize
const juliaBridge = new JuliaBridge({
  host: 'localhost',
  port: 8052
});

// Connect
const connected = await juliaBridge.connect();

// Run a Julia command
const result = await juliaBridge.runJuliaCommand('agents.list_agents', {});

Agent Manager

import { AgentManager } from './packages/framework/agents';

// Initialize
const agentManager = new AgentManager(juliaBridge);

// Create an agent
const agent = await agentManager.createAgent({
  name: 'trading_agent',
  type: 'Trading',
  skills: ['price_analysis'],
  chains: ['Ethereum'],
  config: { risk_tolerance: 0.5 }
});

// Get agent status
const status = await agentManager.getAgentStatus(agent.id);

// Start agent
await agentManager.startAgent(agent.id);

// Stop agent
await agentManager.stopAgent(agent.id);

// Delete agent
await agentManager.deleteAgent(agent.id);

Swarm Manager

import { SwarmManager } from './packages/framework/swarms';

// Initialize
const swarmManager = new SwarmManager(juliaBridge);

// Create a swarm
const swarm = await swarmManager.createSwarm({
  name: 'trading_swarm',
  algorithm: 'PSO',
  objective: 'maximize_profit',
  config: { particles: 50 }
});

// Add agent to swarm
await swarmManager.addAgentToSwarm(swarm.id, agent.id);

// Start swarm
await swarmManager.startSwarm(swarm.id);

// Stop swarm
await swarmManager.stopSwarm(swarm.id);

// Delete swarm
await swarmManager.deleteSwarm(swarm.id);

Wallet Manager

import { WalletManager } from './packages/wallets';

// Initialize
const walletManager = new WalletManager();

// Connect
await walletManager.connect();

// Get address
const address = await walletManager.getAddress();

// Send transaction
const tx = await walletManager.sendTransaction({
  to: '0x...',
  value: ethers.parseEther('1.0')
});

Python API

JuliaOS Client

from juliaos import JuliaOS

# Initialize
juliaos = JuliaOS(host='localhost', port=8052)

# Connect
await juliaos.connect()

Agent API

# Create an agent
agent = await juliaos.create_agent(
    name="trading_agent",
    specialization="trading",
    skills=["price_analysis"]
)

# Start the agent
await agent.start()

# Execute a task
result = await agent.execute_task("analyze_market", data=market_data)

# Stop the agent
await agent.stop()

Swarm API

# Create a swarm
swarm = await juliaos.create_swarm(
    algorithm="differential_evolution",
    population_size=50,
    dimensions=10,
    bounds=(-10, 10)
)

# Define an objective function
def sphere(x):
    return sum(xi**2 for xi in x)

# Run optimization
result = await swarm.optimize(
    objective=sphere,
    iterations=100,
    minimize=True
)

Wallet API

# Connect a wallet
wallet = await juliaos.connect_wallet(
    type="ethereum",
    private_key=os.environ.get("ETH_PRIVATE_KEY")
)

# Get balance
balance = await wallet.get_balance()

# Send transaction
tx = await wallet.send_transaction(
    to="0x...",
    amount="1.0",
    token="ETH"
)

Julia API

Julia APIs are exposed via the command handler in the Julia backend:

# Example Julia code (not directly callable from outside)
function create_agent(name::String, agent_type::String, config::Dict)
    # Agent creation logic
end

function start_agent(agent_id::String)
    # Agent start logic
end

function create_swarm(name::String, algorithm::String, config::Dict)
    # Swarm creation logic
end

function start_swarm(swarm_id::String)
    # Swarm start logic
end

Command Reference

These commands can be called via the Julia Bridge:

Category
Command
Description
Parameters

Agents

agents.list_agents

List all agents

None

Agents

agents.create_agent

Create a new agent

name, type, config

Agents

agents.get_agent

Get agent details

id

Agents

agents.start_agent

Start an agent

id

Agents

agents.stop_agent

Stop an agent

id

Agents

agents.delete_agent

Delete an agent

id

Swarms

swarms.list_swarms

List all swarms

None

Swarms

swarms.create_swarm

Create a new swarm

name, algorithm, config

Swarms

swarms.get_swarm

Get swarm details

id

Swarms

swarms.start_swarm

Start a swarm

id

Swarms

swarms.stop_swarm

Stop a swarm

id

Swarms

swarms.delete_swarm

Delete a swarm

id

Wallets

wallets.connect_wallet

Connect a wallet

address, chain

Wallets

wallets.disconnect_wallet

Disconnect a wallet

address

Wallets

wallets.get_balance

Get wallet balance

address

System

system.get_status

Get system status

None

System

system.get_metrics

Get system metrics

None

Event Reference

JuliaOS components emit various events that can be listened to:

Category
Event
Description
Data

Agents

agent:created

Agent created

{ id, name, type }

Agents

agent:started

Agent started

{ id }

Agents

agent:stopped

Agent stopped

{ id }

Swarms

swarm:created

Swarm created

{ id, name, algorithm }

Swarms

swarm:started

Swarm started

{ id }

Swarms

swarm:stopped

Swarm stopped

{ id }

Wallets

wallet:connected

Wallet connected

{ address, chain }

Wallets

wallet:disconnected

Wallet disconnected

{ address }

System

system:started

System started

{ timestamp }

System

system:stopped

System stopped

{ timestamp }

PreviousJuliaOS ResearchNextAPI Reference: Julia Backend Commands