Skyrim Special Edition

File information

Last updated

Original upload

Created by

Dwemer Dynamics

Uploaded by

tylermaister

Virus scan

Some manually verified files

About this mod

"Herika - The ChatGPT Companion" is a mod that aims to integrate Skyrim with chat platforms based on Artificial Intelligence language models, such as ChatGPT or KoboldCPP. Specifically it adds a follower, Herika, whose responses and interactions are governed by an AI. You can talk in almost any language. She is basically Player 2.

Requirements
Permissions and credits
Translations
  • Portuguese
  • German
Changelogs

Presents







Herika is a custom NPC Follower who you can interact with through an in-game chatbox or with your microphone. She uses OpenAI API/KoboldCPP to respond to anything you say dynamically.
Spoiler:  
Show


She can be found near Warmadien's in Whiterun.
Spoiler:  
Show





*NEW FEATURE* Offline AI and Memories!

The mod will now work offline using KoboldCPP for AI text generation. Note that the actions mode currently does not work with KoboldCPP. Check this article for installation instructions. 

Here is a video example of the mod fully working only using offline AI tools.
Spoiler:  
Show


Also we have implemented ChromaDB (a vector database, used for AI memory storage) with DwemerDistro. This will save all the conversations you have with Herika. She will pull the most relevant memories for context whenever you talk to her. Mixed in with the diary feature she now has a good long-term understanding of your entire adventure together. Requires OpenAI to work.

An example of what is being saved.
Spoiler:  
Show


Diary, Background Story and Plans

Herika is able to keep a diary of events which have happened. This is triggered through a manual hotkey (configurable in the MCM menu). She will then summarize all the most recent events into a diary entry. You can then ask her about these events that she have saved at a later date! We even have a cute little diary interface in the server page. This is our first step into giving her a long term memory.
Spoiler:  
Show


Also we have a background story generator which allows you to very easily create a background story for Herika based on the personality you have created for her. This is also saved to her diary and can be referred to at a later date.
Spoiler:  
Show


Herika is now aware of active quests in your quest log (e.g. quests which you have ticked).

"What are our active quests Herika?"
Spoiler:  
Show


You can set a plan/goal for Herika. She will then guide her responses to try and help you complete this goal.
This can be anything from:
I need to complete x quest.
I must train my alchemy skill.
We should find our way to RavenRock.
We need to solve the Mystery of the Dwarves.
We must find some Ebony armor!
Lets make loads of money!

Spoiler:  
Show

Commands

The latest update now allows you to give Herika commands by asking her. These commands are interpreted by another layer of AI ("The Narrator") which then activates a script function in game to trigger the action. These commands can happen just through normal conversation and don't require a "strict" word pattern to work.

Still a WIP and is a bit buggy.
Will also use up more API tokens so it is toggleable. 

Current Command List:
Spoiler:  
Show



Voice Support 

You can use your microphone to speak with Herika using your voice. Currently we are using the OpenAI/Azure API to do the translation so there is latency (5-10 seconds) and it will use up slightly more OpenAI/Azure API credits. The hotkey can be configured in the MCM. We are looking into other offline/faster solutions for future updates.

Spoiler:  
Show


Random Comments

Herika will make random comments about her environment or conversations she overheard without requiring player interaction.

Spoiler:  
Show


Location Awareness

Herika is aware of her current location and can provide information about it.

"Where are we Herika?"
Spoiler:  
Show


NPC Awareness

Herika is aware of other NPC conversations going on around her. You can ask her about these NPC's.

"What is the name of the priest who is talking?"
Spoiler:  
Show


Combat Awareness

Herika will make comments after combat about enemies you (or she) have slain and the weapons you used to kill them. 

Spoiler:  
Show


Book and Note Summaries

Herika will summarize any book or note you read in the game.

Saint Jiub's Opus
Spoiler:  
Show

Museum Pamphlet
Spoiler:  
Show


The Lusty Argonian Maid Volume 2
Spoiler:  
Show



Customizable Personality

Within the Simple AI Gateway server you can edit Herika's personality. Depending on your configuration you will get different responses. Check the Articles section for some good starting templates.


Question: What are your thoughts on Talos?

"You are Herika, a Breton female who likes jokes and sarcastic comments" (Default)
Spoiler:  
Show

"You are Herika, a Dark Elf female who is rude and makes dismissing comments."
Spoiler:  
Show

"You are Herika, a Breton female who only speaks in rhymes. You also think Talos is a actually a Mudcrab."
Spoiler:  
Show

"You are now Pelinal Whitestrake"
Spoiler:  
Show


Text to Speech Support

Currently the mod can be hooked up to a TTS service which allows you to give Herika a voice. Right now there are 3 options.

  1. Azure: Middle of the road price. Multilingual. Decent voice quality.
  2. Google Cloud Platform (GCP): Roughly same price as Azure and OK voice quality. In the future will have more, higher quality voices.
  3. Mimic3: Completely free and works offline. Low voice quality. Included automatically with DwemerDistro!
  4. Elevenlabs: Create custom voices (Yes you can make her sound like Dagoth Ur). Costs $. Great voice quality. 




The mod works as follows:

It has two components: the plugin itself and the gateway server. The plugin is responsible for collecting events from the game (conversations, events, deaths, etc.) and sending them to the "gateway server". This server will store this data and send it to the remote AI. It will also store the AI's responses and send them to the plugin, which will make them available to the follower in-game.

The plugin is an SKSE plugin. The Simple AI Gateway (SAIG) server acts as the middle man between Skyrim and the AI API's. This server can run on the same machine as the game, but it can also run on a remote machine.

As a general rule, the plugin will send information to the gateway, and the gateway will obtain comments/responses from the AI and send them to the plugin, which will store them in queues. These queues will play in game with the dialogue showing up as subtilties with lip sync and the audio playing over your system sounds. The gateway will also store context information.

For example, you are in a cave and you kill a Draugr. The "death" event is sent to the gateway, which in turn sets up a conversation with the lastest dialogues, locations, and events and sends it to the AI to give it context. The AI responds, and this response is sent to the plugin, which will launch a dialogue commenting on the situation.

Some notes from the developers:

1. The AI's are not deterministic, meaning the same input does not always produce the same result. Therefore, despite numerous tests, sometimes it simply doesn't work as it should.
2. Herika is not a character from Skyrim. She is an AI interpreting a character from Skyrim. Sometimes, she may misinterpret and break certain rules. If that happens, just remind her not to do it.
3. The GPT-4 model is more expensive and slower than GPT-3.5, but significantly better. It adheres better to the rules of roleplay and makes more logical decisions. The functionality of commands/actions with this model is much better. Our base model remains GPT-3.5, but sometimes it doesn't work well. Over time, GPT-4 will become the reference model through "natural" evolution, so we know we are on the right track.

For more details watch this video:



SAIG Server Github: https://github.com/abeiro/saig-gwserver/tree/main





Potential Mod Conflicts:
  • Requiem and other total overhaul style mods.
  • Relationship Dialogue Overhaul (due to different NPC voicetype).
  • Nether's Follower Framework/Amazing Follower Tweaks may have some inconsistent issues. 
  • Whiterun layout changes (as this is where Herika spawns, cell Whiterun Plains District 05,02).

Other Mod Recommendations:
  • To your Face (Only NPC's in your line of sight will greet you, helps prevent dialogue spam that can overflow Herika's context)




For any issues you encounter with installing the mod please post them in our discord in the i-have-a-problem channel.



If you want an alternate set of instructions: https://steamcommunity.com/sharedfiles/filedetails/?id=3003837843

Pre-Requisites:

  • (REQUIRED) Create an OpenAI account and setup an API: https://platform.openai.com/account/api-keys
  • (Optional if you want TTS) Create an Azure or ElevenLabs or Google Cloud account. Set them up so you have a TTS API key which you can use to link with the mod. Instructions in the article section.
  • (Optional if you want TTS) Install Mimic 3 (comes prepackaged with DwemerDistro). Instructions in the article section.
  • (Optional if you want to use Offline AI generation) Read this article on how to install KoboldCPP 

DO NOT SHARE YOUR API KEYS WITH ANYBODY!

  • OpenAI API (ChatGPT 3.5) is around $1-$3 a week for heavy playtime. ($5 in free credits when you sign up).
  • Azure TTS & GCP TTS can be around $5 a week for heavy playtime ($200 in free credits when you signup).
  • Elevenlabs is just really expensive and is not recommended for long-term use. 2 hours of audio is $22 a month. 

READ THIS PLEASE!
YOU ONLY NEED DwemerAIDistro (Herika Full) OR UwAMP (Herika Lite) to setup the mod.
We recommend installing DwemerAIDistro first and if you run into issues then try UWAMP.


DwemerDistro Installation (Recommended)

  • Open Control Panel - Programs - Turn Windows Feature on or off

  • Enable Windows Subsystem for Linux and Virtual Machine Platform (you may need to restart your pc)
  • 
  • Open a CMD prompt (make sure to run it as admin) and enter this command: wsl --update (This is to update to WSL2)
  • You may have issues installing WSL if you do not have virtualization enabled in your BIOS/UEFI boot menu. You may need to do a quick google search on how to do it for your specific computer. Here is a good starting point


  • Download the DwemerAIDistro from the files page
  • Unpack the contents within a folder in your computer
  • Run the install.bat file and wait for it to finish. (There are not any viruses. Nexus scans any and all files uploaded to the site)
  • Run the run.bat file (would recommend making a shortcut of it)
  • Wait for the terminal to bootup. DO NOT CLOSE THE TERMINAL OTHERWISE IT WILL SHUTDOWN THE SERVER.
  • Follow the instructions in the terminal menu to reach the SAIG server

  • Click "Operations - Reinstall"
  • Click "Update" and run the update
  • Navigate to \\wsl.localhost\DwemerAI4Skyrim\var\www\html\saig-gwserver (make sure the server is running!). Find the conf.sample.php file and open it. Compare it to the configuration in the web server
  • Any new updates may come with new configuration options and they have to be transferred to the "live" (conf.php) file to take effect.

  • Click "Configure"
  • Enter in your API keys and configure the configuration file as seen fit.
  • PLEASE READ THE COMMENTS IN THE CONFIG FILE TO UNDERSTAND WHAT EACH SETTING DOES!

  • Click Save once you are happy with your changes

UWAMP Web Server Installation

  • Download the UwAMP server from the files section
  • Extract the folder to your C:\ drive (It should look like "C:\UwAmp")

  • Open the folder and run UwAmp.exe (I would recommend creating a desktop shortcut for easier access) 
  • The application will be in your system tray  (bottom right of your desktop near the time, click the ^ icon to show all the background applications). Right click the application and select "Show UwAmp Window"

  • The server should already be running, if not click "Start"
  • Click "Folder www"
  • Open "saig-gwserver" folder
  • Copy and paste "conf.sample.php" and rename it to "conf.php" (Make sure in file explorer you have enabled File name extensions)

  • On your web browser navigate to: http://localhost:8080/saig-gwserver/
  • Click "Update" and update the server to the latest version
  • Check the conf.sample.php file and compare it to your newly created conf.php file. The update may have added new configurations to the conf.sample.php file. Transfer any new configuration settings over to conf.php.

  • Click "Reinstall"
  • Click "Configure"
  • Enter in your API keys and configure the configuration file as seen fit
  • PLEASE READ THE COMMENTS IN THE CONFIG FILE TO UNDERSTAND WHAT EACH SETTING DOES!
  • Click Save once you are happy with your changes


Mod Installation

Requirements for SE/AE:

Requirements for VR:
Suggested mod load order:
  1. Address Library 
  2. PapyrusUtil
  3. Powerofthree's Papyrus Extender
  4. SkyUI
  5. UI Extensions
  6. Fuz Ro D'oh
  7. HerikaAI


  • Download "Herika - Main File"  file in the downloads page
  • Install it with your mod manager of choice
  • Check that the SimpleGatewayer.ini  (\skse\Plugins) file within the Skyrim mod is pointed to the SAIG server:
  • DwemerAIdDistro:  Copy and paste the output from the terminal.
  •         UWAMP: The default configuration will automatically point to the UWAMP server.


  • MAKE SURE THE UWAMP/DwemerDistro SERVER IS RUNNING BEFORE YOU START THE GAME!

  • Boot up Skyrim and once in-game open the Mod Configuration Menu and click SPG
  • Edit the settings to your liking. Read the comments of each setting to learn what they do
  • Exit out the MCM menu

  • Find Herika in Whiterun to the left of Warmadien's (check the image towards the top of the page if you are having a hard time finding her)
  • Approach her and ask her to follow you
  • The mod should now activate and you will get a response when you talk to her


  • Well done for getting it installed! We hope you enjoy the mod!
  • Check the "Articles" section for more advanced configuration guides
  • You can also change her default Skyrim dialogue with any of the audio packages in the optional files section. You can also generate your own custom audio files using your TTS of choice and replace them