TARS AI
  • ⬅️Background
    • 🤔What is TARS?
  • 🕸️AI Market
    • 🔮Overview
    • 🤖Permissionless Agents
    • 🔥Framework Comparison
    • 💻Off-Chain Integrations
    • ⛓️On-Chain Integrations
    • 💵Fees & Economics
  • 🤓Developer Material
    • 👽Bringing AI Agents to Life
  • 🌕SONA Framework
    • 🥥What is SONA?
    • ✨Features
    • 📚Getting Started
      • ⭐Quick Start
    • 🧠Core Concepts
      • 🤯Character File
      • 📘Knowledge Management
      • 🖥️Clients
      • 🏃‍♂️Runtime
      • 🔗Adapters
      • 🔑Secret Management
Powered by GitBook
On this page
  • Configuration:
  • Implementation:
  1. SONA Framework
  2. Core Concepts

Clients

Clients serve as bridges between SONA agents and various platforms, providing core capabilities:

  1. Message Processing

    • Platform-specific message formatting and delivery

    • Media handling and attachments via Memory objects

    • Reply threading and context management

    • Support for different content types

  2. State & Memory Management

    • Each client maintains independent state to prevent cross-platform contamination

    • Integrates with runtime memory managers for different types of content:

    • Messages processed by one client don't automatically appear in other clients' contexts

    • State persists across agent restarts through the database adapter

  3. Platform Integration

    • Authentication and API compliance

    • Event processing and webhooks

    • Rate limiting and cache management

    • Platform-specific feature support

Configuration:

export type Character = {
    // ... other properties ...
    clientConfig?: {
        uniswap?: {
            shouldTradeInNative?: boolean;
            shouldAllowNewTokens?: boolean;
            enableWrappedETH?: boolean;
            hooks?: string[];
            nativeLimitOrders?: boolean;
        };
        raydium?: {
            raydiumVersion?: string;
        };
        lifi?: {
            enableEfficientRouting?: boolean;
            maxTxTimeLimit?: number;
        };
        nameSystem?: {
            snsVersionHash?: string;
            ensVersionHash?: string;
        };
   
        // ... other client configs
    };
};

Implementation:

import { Client, IAgentRuntime, ClientInstance } from "@sona/core";

export class CustomClient implements Client {
    name = "custom";
    
    async start(runtime: IAgentRuntime): Promise<ClientInstance> {
        // Initialize platform connection
        // Set up event handlers
        // Configure message processing

        return {
            stop: async () => {
                // Cleanup resources
                // Close connections
            }
        };
    }
}

PreviousKnowledge ManagementNextRuntime

Last updated 1 month ago

🌕
🧠
🖥️