Agent

Agents are the foundational elements of the CYNE AI framework, enabling seamless, intelligent, and autonomous interactions within the Solana ecosystem.

Example: State Methods

  • Compose Initial State:

const state = await runtime.composeState(message, {
    additionalContext: "custom blockchain context",
});
  • Update State:

const updatedState = await runtime.updateRecentMessageState(state);

Best Practices:

  • Use composeState to initialize new states.

  • Update states dynamically during interactions with updateRecentMessageState.

  • Cache frequently accessed data to enhance performance.


Memory Systems in CYNE AI

Memory systems provide agents with contextual understanding and continuity.

Types of Memory:

  1. Message History: Tracks past interactions for conversational continuity.

  2. Factual Memory: Stores specific details like wallet activity or token preferences.

  3. Knowledge Base: Retains general knowledge about Solana, DeFi, and NFTs.

  4. Relationship Tracking: Builds rapport by storing user-agent interaction history.

Memory Managers:

CYNE AI provides specialized memory managers:

  • messageManager: Tracks conversation history.

  • descriptionManager: Stores user profiles and descriptions.

  • loreManager: Retains agent knowledge and backstory.

Example: Memory Management

const memoryManager = runtime.getMemoryManager("messages");

// Store memory
await memoryManager.createMemory({
    id: messageId,
    content: { text: "Analyzed a 1M SOL whale transaction" },
    userId: "user123",
    roomId: "room123",
});

Evaluation System

The evaluate method processes input, evaluates responses, and determines actionable outcomes.

Example: Evaluation

const evaluationResults = await runtime.evaluate(message, state, didRespond);

Best Practices for Agent Implementation

  1. Use Randomized Memory: For more dynamic agent responses.

  2. Optimize Memory Usage: Clean old data periodically to avoid performance bottlenecks.

  3. Handle Errors Gracefully: Log errors to maintain stability.

  4. Follow Immutability Principles: For state management to ensure reliability.


Further Reading and Resources

  • Actions Documentation: Learn how to configure and extend agent actions.

  • Evaluators Documentation: Dive into evaluation and goal-setting for agents.

  • Providers Documentation: Connect agents to external platforms and tools.

  • Full API Reference: Explore the full technical details of CYNE AI.

Start building intelligent agents with CYNE AI today!

Last updated