Skip to content

Latest commit

 

History

History
207 lines (160 loc) · 8.38 KB

README.md

File metadata and controls

207 lines (160 loc) · 8.38 KB

Aktiva AI - A Self-Hosted AI Discord Bot

Your digital companion for managing and interacting with multiple AI personalities on Discord.


Table of Contents

  1. Introduction
  2. Features
  3. Prerequisites
  4. Installation Guide
  5. Using the Bot
  6. Advanced Features
  7. Character Creation Guide
  8. Credit and Acknowledgements

Introduction

Aktiva AI is a versatile self-hosted Discord bot designed to enable users to interact seamlessly with multiple AI personalities in a single environment. Whether you're roleplaying, gathering information, looking for backup to support your argument, or just having fun, Aktiva AI leverages the latest advancements in AI technology through integrations like Hugging Face's Florence-2 Visual AI, OpenRouter APIs, and custom Language Model integration. With features ranging from dynamic character swapping to advanced memory systems, Aktiva AI is your go-to solution for creating an engaging AI-powered Discord server.


Features

Seamless Character Swapping

Talk to multiple AI characters through one bot:

  • Easily trigger AI characters by saying their name or responding to their messages.
  • Use /get_whitelist to pull up a list of available characters on the server.
  • Hide messages from the AI's context by starting the message with //.
  • Each character uses webhooks for unique avatars, ensuring a personalized experience.

Channel-Based Memory

Aktiva AI remembers channel-specific memories and locations:

  • Each channel and thread has its own dedicated memory for an immersive interaction experience.
  • Slash commands can modify or clear memory and location segments dynamically.

Thread Support

Enjoy private or group interactions powered by full Discord thread support. Every thread has isolated memory management, allowing users to have private conversations or roleplaying sessions.

Image Recognition

Integrated with A Cultured Finetune Microsoft's Florence-2 AI MiaoshouAI/Florence-2-base-PromptGen-v2.0, Aktiva AI provides powerful multimodal capabilities:

  • Detect objects and aesthetics in uploaded images.
  • Support for optional AI like Llava for enhanced image-based vibe detection.

Character Message Editing and Deletion

For seamless content control:

  • Edit bot responses directly in Discord using context menu commands.
  • Delete bot responses to maintain moderation standards.

Customizable AI Characters

Add unlimited characters to suit your needs:

  • Place character JSON files in the characters/ folder.
  • Or Use the /aktiva import_character command and input the json
  • Or Use the /aktiva pygmalion_import command and input the uuid
  • SillyTavern's character card and Pygmalion AI card formats are fully supported for input.

PDF File Reading Support

Upload PDF documents for AI characters to read, analyze, and provide insights during interactions.

Web Search Integration

Powered by DuckDuckGo:

  • Allow your AI characters to perform live web searches.
  • Get accurate, real-time information during conversations.
  • Retrieve Images, Videos, and Get Newest Headlines.
  • Add ^ at the beginning of your message to enable web search function and (keyword) for the thing you want the AI to retrieve.

Whitelist Management

Control which AI characters can respond in specific channels:

  • Assign whitelists to channels using slash commands.
  • Customize character availability per channel/thread for tailored interactions.

OpenRouter API Integration

Expand the bot’s capabilities through OpenRouter:

  • Switch AI models via slash commands to experiment with different models.
  • Uses OpenRouter as fall back when local don't work

Gemini API Integration

Expand the bot's capability EVEN MORE with Gemini API:

  • Add the ability to process and absurd amount of text with free gemini api
  • Use the local model to answer it in an in-character manner

Prerequisites

  1. Large Language Model (LLM)

  2. Backend - Koboldcpp

  3. Florence 2 Finetune for Vision Tasks

    • Preloaded with MiaoshouAI’s Florence-2-base for object recognition, text detection, and image compositional analysis.
  4. Config File

    • A .env file containing the necessary API keys for Discord and OpenRouter.

Installation Guide

  1. Clone the Aktiva AI repository:

    git clone https://github.com/Iteranya/AktivaAI.git
    cd AktivaAI
  2. Create a virtual environment:

    python3 -m venv venv
    source venv/bin/activate  # On Windows, use `venv\Scripts\activate`
  3. Create a .env file with the required API keys (refer to example.env in the repository).

  4. Install Python dependencies:

    python3 -m pip install -r requirements.txt
  5. Launch your LLM using Koboldcpp and load the desired model.

  6. Run the bot:

    python bot.py
  7. Whitelist the default bot: /set_whitelist Vida-chan Talk to Vida~


Using the Bot

Getting Started

After starting the bot:

  • Add interesting characters or experiments by placing JSON files in the characters/ folder.
  • Or Use the /aktiva import_character command and input the json
  • Or Use the /aktiva pygmalion_import command and input the uuid

Slash Commands Guide

Leverage the available commands to manipulate or customize the bot:

  • /set_instruction: Modify instructions for a specific AI character.
  • /set_global: Change global data for the channel/thread.
  • /set_instruction: Change the instruction data for the channel/thread.
  • /get_whitelist: Get the available characters you can chat with
  • /clear_whitelist: Clear character restrictions in the channel.

Advanced Features

Changing Models

Aktiva AI supports swapping between models dynamically. Use /set_text_eval_model to change the underlying AI evaluation model and /get_text_eval_model to view the active model.

Whitelist Management Commands

Control character availability across channels with the following:

  • /set_whitelist: Specify characters allowed in a channel.
  • /get_whitelist: List allowed characters in the current channel.
  • /clear_whitelist: Remove all channel-specific character restrictions.

Character Creation Guide

Creating a custom character for Aktiva AI is simple:

  1. JSON-based Configuration:
    • Refer to the structure of characters/default.json
    • This is mandatory for 'assistant style' bot
  2. SillyTavern Character Cards:
    • Use the /import command and add compatible json card
    • Good for 'roleplay style' bot
  3. Pygmalion:
    • Use get_pygmalion command and insert character uuid
    • Easier access to Pygmalion coming up

Credits and Acknowledgements

Aktiva AI owes its existence to:

  • The amazing beta testers at the Ambruk Academy Discord Server.
  • The incredible open-source community for libraries like Koboldcpp, Microsoft's Florence AI, and Hugging Face.
  • ChatGPT, who wrote this Read Me file.

Join the journey. Happy experimenting! ❤️ I don't do emoji, sorry That was ChatGPT trying to be nice.

Further queries on my Discord Server: Aktiva Institute