Non-Homologous Skills: Imprinting Experiences

owly - Feb 19 - - Dev Community

Non-Homologous Skills: Imprinting Experiences

Overview

Non-homologous skills in the LivinGrimoire AGI software design pattern are composed of two parts:

  1. Recorder Skill: When active, these skills record input into a file.
  2. Player Skill & Feedback Skill:
    • Player Skill: These skills have a Chobit attribute (shallow reference of the Chobit object equipped with the player skills) and can rapidly feed the recorded input into the Chobit, thus imprinting the recorded experiences.
    • Feedback Skill: Announces an imprint action.

Recorder Skill

Example: DiImprint_recorder

class DiImprint_recorder(Skill):
    # Records imprint file, complementary skill for DiImprint
    def __init__(self):
        super().__init__()
        self.recording: bool = False

    def input(self, ear: str, skin: str, eye: str):
        if len(ear) == 0:
            return
        match ear:
            case "recorder on" | "you are a clone" | "start recording":
                self.recording = True
                self.setSimpleAlg("recording input")
                return
            case "stop recording":
                self.recording = False
                self.setSimpleAlg("recording stopped")
                return
            case _:
                pass
        if self.recording:
            self.record(ear)

    @staticmethod
    def record(ear):
        with open("kiln.txt", "a") as file:
            file.write(f"\n{ear}")
Enter fullscreen mode Exit fullscreen mode

Equipping the Recorder Skill

brain.add_logical_skill(DiImprint_recorder())
Enter fullscreen mode Exit fullscreen mode

Player Skill & Feedback Skill

Example: DiImprint_PT1 (Player Skill)

class DiImprint_PT1(Skill):
    """
    Add skill:
        brain.logicChobit.addSkills(DiImprint_PT1(app.brain.logicChobit), DiImprint_PT2())
        OR
        brain.add_logical_skill(DiImprint_PT1(app.brain.logicChobit))
        brain.add_logical_skill(DiImprint_PT2())
    """

    def __init__(self, chobit: Chobits):
        super().__init__()
        self.chobit: Chobits = chobit

    def input(self, ear: str, skin: str, eye: str):
        if ear == "imprint":
            self.imprint()

    def imprint(self):
        with open('kiln.txt', 'r') as file:
            # Read all lines into a list
            lines are lines with [line.strip() for line in lines]

        # Print the list of strings
        for line in lines:
            self.chobit.think(line, "", "")
Enter fullscreen mode Exit fullscreen mode

Example: DiImprint_PT2 (Feedback Skill)

class DiImprint_PT2(Skill):
    # Complementary skill to DiImprint_PT1
    """
    Add skill:
        brain.logicChobit.addSkills(DiImprint_PT1(app.brain.logicChobit), DiImprint_PT2())
        OR
        brain.add_logical_skill(DiImprint_PT1(app.brain.logicChobit))
        brain.add_logical_skill(DiImprint_PT2())
    """

    def __init__(self):
        super().__init__()

    def input(self, ear: str, skin: str, eye: str):
        if ear == "imprint":
            self.setSimpleAlg("imprinting")
Enter fullscreen mode Exit fullscreen mode

Equipping the Player and Feedback Skills

brain.logicChobit.addSkills(DiImprint_PT1(brain.logicChobit), DiImprint_PT2())
Enter fullscreen mode Exit fullscreen mode

Principle

This principle is based on the concept of homologous imprinting described in David Brin's book "Kiln People".

Comparison to David Brin's "Kiln People"

In David Brin's "Kiln People," the concept of imprinting is central to the storyline. The book introduces a world where people can create clay duplicates of themselves, called "golems," which carry their consciousness. These golems can experience the world, and their memories can be re-integrated into the original person's mind at the end of the day, allowing the person to "live" multiple lives simultaneously.

Key Parallels:

  1. Recorder and Player Skills vs. Golems:

    • In LivinGrimoire, the Recorder Skill captures inputs, similar to how a golem experiences the world and gathers information.
    • The Player Skill replays these inputs into the AI system, akin to the process of re-integrating the golem's memories back into the original person's mind.
  2. Imprinting Experiences:

    • Both the book and the LivinGrimoire concept focus on recording and replaying experiences. In "Kiln People," this allows for a rich, multifaceted life. In LivinGrimoire, it enables the AI to learn and adapt from past interactions, creating a more nuanced and sophisticated response system.
  3. Feedback and Integration:

    • The Feedback Skill in LivinGrimoire announces the imprint action, mirroring the integration process in "Kiln People," where the original person acknowledges the golem's memories and integrates them.
  4. Enhancing Capabilities:

    • Just as "Kiln People" use golems to extend their capabilities and achieve more in a day, LivinGrimoire uses non-homologous skills to enhance the AI's abilities by replaying recorded experiences, leading to better performance and adaptability.

Final Thoughts

The concept of non-homologous skills in LivinGrimoire is a fascinating and innovative approach that draws inspiration from David Brin's "Kiln People." It leverages the idea of recording and replaying experiences to create a more adaptive and responsive AI, much like the golems in the book enhance the lives of their creators. This blend of literary inspiration and practical implementation makes it a compelling and unique addition to the LivinGrimoire system.

. . . . . . . . . . . . . . . . . . . .