The Oracle Agent SDK enables developers to create Agentic Oracles that can interact with users through dynamic conversational interfaces, process data in real-time, and provide verifiable attestations through IXO Protocol networks. It supports both web and mobile platforms through React integration.

Key Features

Agentic Intelligence

LLM-powered conversational agents with real-time message streaming

Dynamic UI

Platform-agnostic reactive component rendering for web and mobile

Verification

Cryptographic proof generation for Oracle interactions

Matrix Integration

Secure data rooms and real-time messaging

Installation

npm install @ixo/oracle-agent-sdk
# or
yarn add @ixo/oracle-agent-sdk

Quick Start

Agent Configuration

import { createOracleAgent } from "@ixo/oracle-agent-sdk";

// Initialize agent
const agent = await createOracleAgent({
  did: "did:ixo:oracle/123",
  capabilities: ["verification", "conversation"],
  model: "gpt-4",
  streaming: true // Enable real-time streaming
});

// Configure verification rules
agent.setVerificationRules({
  requiredConfidence: 0.95,
  evidenceTypes: ["telemetry", "location"]
});

React Integration

import { useOracleChat, useMessages } from "@ixo/oracle-agent-sdk/react";

function WebChatInterface() {
  const { messages, sendMessage, isLoading } = useOracleChat({
    oracleId: "did:ixo:oracle/123",
    sessionId: "session-456"
  });

  const { messageList, hasMore } = useMessages({
    sessionId: "session-456",
    limit: 50
  });

  return (
    <div className="chat-container">
      <MessageList messages={messageList} />
      <ChatInput onSend={sendMessage} disabled={isLoading} />
      {isLoading && <LoadingIndicator />}
    </div>
  );
}

Dynamic UI Components

import { OracleUI } from "@ixo/oracle-agent-sdk/ui";

// Register custom components
OracleUI.register("VerificationCard", VerificationCard);
OracleUI.register("LocationProof", LocationProof);
OracleUI.register("DataVisualizer", DataVisualizer);

// Dynamic component resolver
function DynamicContent({ content }) {
  return (
    <OracleUI.Renderer
      content={content}
      components={{
        VerificationCard,
        LocationProof,
        DataVisualizer
      }}
      platform="web" // or 'mobile'
    />
  );
}

Verification Flow

// Create verification session
const session = await agent.createVerification({
  type: "DataVerification",
  subject: "did:ixo:entity/456",
  context: {
    location: spatialContext,
    timestamp: Date.now()
  }
});

// Process data
const result = await session.verify(data, {
  rules: verificationRules,
  evidence: supportingData
});

// Generate proof
const proof = await session.generateProof({
  result,
  method: "Ed25519Signature2020"
});

Hooks and Components

React Hooks

const { messages, sendMessage } = useOracleChat({
  oracleId: "did:ixo:oracle/123"
});

UI Components

import {
  ChatWindow,
  MessageList,
  VerificationCard,
  ProofDisplay
} from "@ixo/oracle-agent-sdk/ui";

function OracleInterface() {
  return (
    <ChatWindow>
      <MessageList />
      <VerificationCard result={verificationResult} />
      <ProofDisplay proof={cryptographicProof} />
    </ChatWindow>
  );
}

Error Handling

400
error

Invalid verification request

401
error

Unauthorized oracle access

409
error

Verification conflict

Use Cases

Conversational Interfaces

Build interactive conversational experiences with real-time responses

Dynamic Content

Create agent-driven dynamic UI components and workflows

Data Verification

Implement secure data verification with cryptographic proofs

Cross-Platform Apps

Deploy on both web and mobile platforms

Best Practices

Follow these guidelines for robust oracle implementation

Security

  • Validate all inputs
  • Implement rate limiting
  • Store sensitive data in encrypted rooms
  • Monitor verification accuracy
  • Implement proper session management
  • Use secure WebSocket connections

Performance

  • Cache verification results
  • Implement retry logic
  • Handle offline scenarios
  • Monitor resource usage
  • Optimize message batching
  • Implement proper error boundaries

Next Steps

Verification Guide

Implement verification flows

UI Guide

Build dynamic chat interfaces

Integration Guide

Connect with AI Models

Platform Guide

Deploy across platforms

Was this page helpful?