LogoLogo
  • Introduction
  • Getting Started
    • Overview
  • Voyager Digital Dash
  • Agent Apollo AI Framework
  • Token $VOYAGE
  • Related Links
Powered by GitBook
On this page
  • Key Features
  • Installation Guide
  • CLI Usage
  • Web Intergration
  • Contributing
  • License

Agent Apollo AI Framework

This chapter introduces the enhanced capabilities of the Apollo AI Agent Framework, designed to deliver cutting-edge crypto analysis with advanced AI integrations, customizable personalities, and comprehensive market tools. This guide will provide an in-depth walkthrough of its features, installation, usage, and customization options to empower developers and crypto enthusiasts alike.

Key Features

  1. Multi-AI Provider Support:

    • Seamlessly integrate with OpenAI, Anthropic, and Google AI APIs.

    • Choose the provider that best suits your application needs.

    • Flexible configuration to switch between providers effortlessly.

  2. Customizable AI Personalities:

    • Tailor your AI agent’s behavior to meet specific use cases.

    • Built-in personalities include:

      • Apollo: A charismatic and futuristic crypto expert from the year 2157, ideal for engaging market analysis.

      • Sage: A wise and thoughtful crypto oracle who offers insightful commentary on market trends.

      • Trader: A fast-talking Wall Street-style crypto trader who delivers quick and energetic responses.

    • Create custom personalities to align with your brand or niche.

  3. Persistent Memory:

    • Enable long-term memory with SQLite integration.

    • Allows the AI agent to recall past conversations and user preferences.

    • Improves user experience by offering continuity and personalized interactions.

  4. Real-Time Crypto Market Analysis:

    • Integrate real-time data feeds to monitor cryptocurrency markets.

    • Analyze price movements, trading volumes, and other key metrics.

    • Get up-to-date insights to make informed decisions.

  5. Sentiment Analysis:

    • Utilize advanced natural language processing (NLP) techniques to gauge public sentiment.

  6. Portfolio Tracking:

    • Monitor your cryptocurrency investments directly within the framework.

    • View performance metrics and historical data.

Installation Guide

Clone the Repository

Begin by cloning the repository to your local machine:

git clone https://github.com/AgentApollo-VOYAGE/voyagerAIFramework.git
cd voyagerAIFramework

Install Dependencies

Install the necessary dependencies using npm:

npm install

Ensure all required packages are installed successfully before proceeding.

CLI Usage

Setting Up Environment Variables

  1. Copy the environment template file:

    cp .env.example .env
  2. Open the .env file and configure the following:

    • Preferred AI provider (e.g., OpenAI, Anthropic, Google).

    • API keys for the chosen provider(s).

    • Trending tokens API endpoint for real-time market data.

Running the Chat Interface

Once your environment variables are set up, start the chat interface:

node chat.js

Interact with your AI agent via the command-line interface to experience its capabilities firsthand.

Web Intergration

Basic React Integration

To integrate the Apollo Agent into a React application, follow these steps:

  1. Copy the required files from src/agents/apollo into your React project directory.

  2. Use the following code to set up a basic chat component:

import { useState, useEffect } from 'react';
import { ApolloAgent } from './agents/apollo/ApolloAgent';

function ChatComponent() {
  const [messages, setMessages] = useState([]);
  const [apollo, setApollo] = useState(null);
  const [input, setInput] = useState('');

  useEffect(() => {
    const initApollo = async () => {
      const agent = new ApolloAgent();
      await agent.initialize();
      setApollo(agent);
    };
    initApollo();
  }, []);

  const handleSubmit = async (e) => {
    e.preventDefault();
    if (!input.trim() || !apollo) return;

    const content = input.trim();
    setInput('');

    try {
      const response = await apollo.sendMessage(content);
      setMessages(prev => [...prev, { role: 'user', content }, { role: 'assistant', content: response }]);
    } catch (error) {
      console.error('Error sending message:', error);
    }
  };

  return (
    <div className="chat-container">
      <div className="messages-container">
        {messages.map((msg, i) => (
          <div key={i} className={`message ${msg.role}`}>
            {msg.content}
          </div>
        ))}
      </div>

      <form onSubmit={handleSubmit} className="input-form">
        <input
          type="text"
          value={input}
          onChange={(e) => setInput(e.target.value)}
          placeholder="Type your message..."
          className="message-input"
        />
        <button type="submit" disabled={!apollo}>Send</button>
      </form>
    </div>
  );
}

export default ChatComponent;

2. Personality Switching

Enhance the user experience by integrating a personality selector:

import { useState } from 'react';

const PERSONALITIES = {
  apollo: {
    name: 'Apollo',
    description: 'Charismatic crypto expert from 2157'
  },
  sage: {
    name: 'Sage',
    description: 'Ancient wise crypto oracle'
  },
  trader: {
    name: 'Trader',
    description: 'Fast-talking Wall Street crypto trader'
  }
};

function PersonalitySelector({ onSelect, apollo }) {
  const [currentPersonality, setCurrentPersonality] = useState('apollo');

  const handlePersonalityChange = (value) => {
    setCurrentPersonality(value);
    if (apollo) {
      apollo.setPersonality(value);
    }
    onSelect(value);
  };

  return (
    <div className="personality-selector">
      <label htmlFor="personality-select">Choose AI Personality:</label>
      <select
        id="personality-select"
        value={currentPersonality}
        onChange={(e) => handlePersonalityChange(e.target.value)}
      >
        {Object.entries(PERSONALITIES).map(([key, personality]) => (
          <option key={key} value={key}>
            {personality.name} - {personality.description}
          </option>
        ))}
      </select>
    </div>
  );
}

export default PersonalitySelector;

This component enables dynamic personality switching, providing tailored responses to suit various scenarios.

Contributing

Contributions are welcome! If you wish to contribute to the Voyager AI Framework, please:

  1. Review the contributing guidelines.

  2. Submit a pull request with a clear description of the changes.

  3. Participate in discussions to enhance the framework’s features.

License

This project is licensed under the ISC License, promoting open and collaborative development.

PreviousVoyager Digital DashNextToken $VOYAGE

Last updated 4 months ago