Skip to main content

A Star Wars character AI chat interface using PyQt and LLMs

Project description

HolocronAI

A Star Wars character AI chat interface using PyQt and LLMs. This tool allows users to interact with AI-powered versions of characters from Knights of the Old Republic, leveraging game dialog data to maintain authentic character personalities.

Features

  • Modern PyQt-based UI with dark theme

  • Real-time character-by-character response generation

  • Dialog embedding generation for character personality modeling

  • Customizable LLM backend through LiteLLM

  • Game installation integration through PyKotor

  • Extracts all dialogs from KOTOR installations

  • Uses DITTO self-alignment framework for dynamic response generation

  • Implements Beyond Dialog concepts for contextual understanding

  • No hardcoded patterns or pre-training required

  • Maintains character consistency through embedding-based alignment

Installation

  1. Create a virtual environment:
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install in development mode:
pip install -e .

Usage

Run the application:

holocron-ai
  1. Select your KOTOR game installation directory
  2. Wait for dialog processing and embedding generation
  3. Choose a character to interact with
  4. Start chatting!

The system will:

  1. Extract all dialogs from the installation
  2. Process them through the self-alignment system
  3. Start an interactive session where you can chat with the character

How It Works

HolocronAI uses three main components:

  1. Dialog Processor: Extracts and processes dialogs from KOTOR installations, converting them into embeddings that capture semantic meaning.

  2. Self-Alignment System: Implements the DITTO framework to maintain character consistency without relying on hardcoded patterns. This system:

    • Dynamically learns from dialog embeddings
    • Adjusts responses based on conversation context
    • Maintains character consistency through embedding alignment
  3. Character Agent: Combines the dialog processor and self-alignment system to generate responses that are:

    • Contextually appropriate
    • Character-consistent
    • Based on actual game dialog

Example Interaction

> Hello there!

Character: I see you're not one for subtlety. Very well - I'll be direct as well.

> What do you think about the Jedi?

Character: The Jedi... Their Code is their weakness. The galaxy has far more 
shades of gray than their black and white philosophies would suggest.

Technical Details

  • Uses sentence-transformers for generating embeddings
  • Implements dynamic context weighting based on semantic similarity
  • Maintains conversation history with sliding context window
  • Automatically saves processed data for faster subsequent runs

Requirements

  • Python 3.8+
  • KOTOR installation
  • Dependencies listed in setup.py

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

holocron_ai-0.1.0.tar.gz (12.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

holocron_ai-0.1.0-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

Details for the file holocron_ai-0.1.0.tar.gz.

File metadata

  • Download URL: holocron_ai-0.1.0.tar.gz
  • Upload date:
  • Size: 12.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for holocron_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 638bfe4a867f3a543f12aa058b11591bee568a68a64d7b303bef0379bea19f68
MD5 585f5b139a4aef7a9a959ff7f0f7d5e3
BLAKE2b-256 5408c29aa79e5a68bc6c0b0d74ac5e60ca2443183f503c200a60e863c22ce9b1

See more details on using hashes here.

File details

Details for the file holocron_ai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: holocron_ai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for holocron_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bded4e29d499f1066a5252ed56551df3027769faaae622b632de58223ac3875e
MD5 98a2bfa68c919ec27492c4bfa7e4f5ac
BLAKE2b-256 4f949fa282d405a1676d934d0d51b13e6f0425fa7d4955ead5c9eaf65a9684cb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page