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.1.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.1-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: holocron_ai-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 3d483fa2f3dbc8310b18d9a331af527b11cfe04933413511b8cec968d34db356
MD5 f6dc37b55de1ddb6fb46e8f33dd36a8b
BLAKE2b-256 e2fe2cc9e019b795bdef44f0947f2f77f279805eb473e7c036f01d5207c18597

See more details on using hashes here.

File details

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

File metadata

  • Download URL: holocron_ai-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5a79e75986441c7d73eceb3b0da0477868014cbfb3d028ef7842571f034a6170
MD5 ed26521a0b77c6cec1562ef39efd05fb
BLAKE2b-256 67a86e56e69ffdc59f417f7270548c090380f2a67a67e2d67ccb21687973d37b

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