kayori is an interactive Multi Agentic girlfriend designed to deliver a charming and engaging conversational experience. She adapts her personality and mood based on past interactions,also capiable to using multiple tools and services to create dynamic, personalized experience.
- Conversational Agent: kayori is designed with a playful, human-like personality that adapts its mood based on predefined emotional states.
- Permanent momory: Uses Pinecone for storing and retrieving context from past interactions.
- Automates tasks such as updating profile pictures, sending personalized greetings, messaging upon location changes, and weather upates daily.
- Tool Integrations: Connects with Spotify, Google calender, Tavily search, and more for to enhance user experience and engagement..
- Discord Bot: Operates on Discord to provide real-time conversation and interaction.
Before running the project, ensure you have the following installed:
- Python 3.13.2 (or a compatible version, recommand to create venv)
- Required Python libraries (see
requirements.txt
) - A Discord bot token (from the Discord Developer Portal)
- Firebase credentials (
firebase.json
) - Google calender (
credentials.json
) - Pinecone API keys
- Additional API keys for:
- Tavily
- HuggingFace Inference API (for embeddings)
- Google Gemini
- Spotify
- WeatherAPI
-
Clone the Repository:
git clone <repository-url> cd <repository-directory>
-
Install Dependencies:
Use pip to install all required packages:
pip install -r requirements.txt
-
Set Up Environment Variables:
Create a
.env
file in the project root and populate it with the necessary keys (see the Environment Variables section). -
Firebase Setup:
Place your Firebase credentials JSON file (e.g.,
firebase.json
) in the project root. -
Calender Setup:
Place your google calender JSON file (e.g.,
credentials.json
) in the project root.
Ensure that the following environment variables are set in your .env
file:
# API Keys for External Services
TAVILY_API_KEY=
EMBD= # HuggingFace API key for embedding model
API_KEY= # Google Gemini API key
PINECONE= # Pinecone API key
WEATHER_API= # Weather API key
# Discord Bot Credentials
DISCORD_BOT_TOKEN= # Discord bot token from Discord Developer Portal
# Spotify API Credentials
SPOTIFY_CLIENT_ID=
SPOTIFY_CLIENT_SECRET=
SPOTIFY_REDIRECT=
# Miscellaneous
TZ= # Your time zone, e.g., Asia/Kolkata
USER_ID= # Your Discord user ID (Developer mode enabled)
The project concurrently starts both the Discord bot and a backend server. To run the application:
python app.py
To run the application in a Docker container, use the Dockerfile provided in the project.
-
Build the Docker Image:
docker build -t kayori:latest .
-
Run the Container:
docker run -p 80:8080 --env-file .env kayori
To get an memory experience, run the following command for a better experience:
python pastMemories.py
This script contains sample conversation pieces to populate the vector database. You can edit the sample conversation pieces to customize your experience with the Karoi chatbot.
To enable kayori to send location-based weather updates, you need to set up Tasker on your mobile device:
-
Download and Install Tasker:
- Install Tasker from the Google Play Store.
-
Create a New Task to Get Location:
- Open Tasker and navigate to the "Tasks" tab.
- Click the
+
button to create a new task. - Name the task "GetLocation" and tap the checkmark.
-
Add a Location Action:
- Click the
+
button inside the task and select "Location". - Set accuracy preferences as needed.
- Add an action to "Variable Split" the retrieved location into separate latitude and longitude values.
- Click the
-
Store the Location in a JSON Format:
- Add a "Variable Set" action.
- Name the variable
%JSON_BODY
. - Set its value to:
{ "latitude": %LOCN1, "longitude": %LOCN2, "timestamp":"%TIME" }
-
Send the Data to the Server:
- Add an "HTTP Request" action.
- Set the method to
POST
. - In the "Server:Port" field, enter:
http://<your-ip>:80 or 8080
- Set the "Body" field to
%JSON_BODY
.
-
Create a Profile for Recurring Location Updates:
- Go to the "Profiles" tab and click the
+
button. - Select "Time" and set it to trigger every
20
minutes. - Link this profile to the "GetLocation" task.
- Go to the "Profiles" tab and click the
-
Enable Tasker:
- Ensure Tasker is enabled so it runs in the background.
Now, Tasker will periodically send your location data to the kayori server, allowing it to get to know more about you ;).
For any further questions or issues, please refer to the documentation of the respective APIs and services integrated within this project or just contact the SamTheTechi