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
  • Key Methods:
  • State Management:
  1. SONA Framework
  2. Core Concepts

Runtime

Key Methods:

  • initialize(): Sets up the agent's runtime environment, including services, plugins, and knowledge processing.

  • processActions(): Executes actions based on message content and state.

  • evaluate(): Assesses messages and state using registered evaluators.

  • composeState(): Constructs the agent's state object for response generation.

  • updateRecentMessageState(): Updates the state with recent messages and attachments.

  • registerService(): Adds a service to the runtime.

  • registerMemoryManager(): Registers a memory manager for specific types of memories.

  • ensureRoomExists() / ensureUserExists(): Ensures the existence of rooms and users in the database.

State Management:

interface State {
    // Core identifiers
    userId?: UUID;
    agentId?: UUID;
    roomId: UUID;

    // Character information
    bio: string;
    lore: string;
    messageDirections: string;
    postDirections: string;

    // Conversation context
    actors: string;
    actorsData?: Actor[];
    recentMessages: string;
    recentMessagesData: Memory[];

    // Goals and knowledge
    goals?: string;
    goalsData?: Goal[];
    knowledge?: string;
    knowledgeData?: KnowledgeItem[];
    ragKnowledgeData?: RAGKnowledgeItem[];
}

// State management methods
async function manageState() {
    // Initial state composition
    const state = await runtime.composeState(message, {
        additionalContext: "custom context"
    });

    // Update state with new messages
    const updatedState = await runtime.updateRecentMessageState(state);
}

PreviousClientsNextAdapters

Last updated 1 month ago

🌕
🧠
🏃‍♂️