An AI companion designed for more humanlike interactions. The goal is to create a humanlike AI system that isn't just an assistant, but a virtual companion that you can form connections with.
Currently uses Mistral AI models. To use this project, you'll need a Mistral AI API key, and store it under MISTRAL_API_KEY
in a .env
file.
- Download this project
- Make sure that Python is installed
- Obtain a Mistral API key at https://console.mistral.ai/
- Store the API key in a
.env
file in the project directory - Make sure to install the requirements:
pip install -r requirements.txt
- Run
main.py
If you find a bug or have a feature request, feel free to open an issue.
Before responding, the AI is prompted to generate a list of thoughts from its perspective. These thoughts are treated as the AI's "inner monologue." This helps make it a bit more realistic, and think as if it truly had its own personality.
Additionally, the AI is designed to look for and gather insights to add to its memory, in order to gain a higher-level understanding of the user.
The emotion system is based on the PAD (Pleasure-Arousal-Dominance) state model. Interactions with the AI will elicit emotions, which affect its mood. Its current emotions may affect its responses.
The AI companion also has a long-term memory system to recall relevant memories and insights from previous conversations. It includes two types of memory: short-term and long-term.
- Short-term memory: Memories that the AI has either experienced recently or recalled recently. This is always available in-context, but has a limited capacity, and any memories that get flushed out of short-term memory are sent to long-term memory.
- Long term memory: Stores the memories and experiences to be retrieved whenever they become relevant. Recalled memories return to short-term memory.