DEV Community

Cover image for LivingGrimoire Lets You Bottle Knowledge Like Potions — And Sell Them
owly
owly

Posted on

LivingGrimoire Lets You Bottle Knowledge Like Potions — And Sell Them

The Kiln and the Creature: How DiImprint Lets You Forge AI Souls — and Sell Them

Tagged: ai, python, architecture, showdev


There is a moment in David Brin's novel Kiln People where a character steps into a clay-duplication machine and imprints their consciousness onto a temporary golem called a ditto. The ditto wakes up with the original's memories, personality, skills, and even emotional state — baked in, ready to go, indistinguishable from the source until the clay runs out.

Brin called the underlying process homologous imprinting: the idea that a complex pattern of thought and identity can be encoded into a substrate and reconstituted later. The ditto doesn't learn who it is over time. It is told who it is, all at once, before it ever opens its eyes.

I kept thinking about that while writing DiImprint.


What DiImprint Actually Does

DiImprint is a Skill in the LivingGrimoire software design pattern — more on that in a moment. Here is the full class:

class DiImprint(Skill):
    """
    Loads kiln.txt and processes each line as a thought,
    imprinting the bot with pre-written content or training data.
    add skill:
        brain.add_skill(DiImprint(brain))
    """

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

    def manifest(self):
        """Runs once when skill is added to the AI. Creates empty kiln.txt if it doesn't exist."""
        kiln_path = Path('kiln.txt')
        if not kiln_path.exists():
            with open(kiln_path, 'w') as file:
                pass  # Creates empty file

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

    def imprint(self):
        with open('kiln.txt', 'r') as file:
            lines = file.readlines()

        # Remove trailing whitespace and skip blank lines and comments
        lines = [line.strip() for line in lines]

        for line in lines:
            if not line or line.startswith('#'):
                continue
            self.chobit.think(line, "", "")

    # noinspection PyMethodMayBeStatic
    def skill_notes(self, param: str) -> str:
        if param == "notes":
            return "Loads kiln.txt and processes each line as a thought"
        elif param == "triggers":
            return "Triggered by the command 'imprint'."
        return "Note unavailable"
Enter fullscreen mode Exit fullscreen mode

It reads a plain text file called kiln.txt, line by line, and feeds each line into the AI brain's think() method — the same method that processes real-time user input. To the brain, there is no difference between a thought that arrived from a human and a thought that arrived from a file. The slate is written before the conversation begins.

This is homologous imprinting. Not fine-tuning. Not prompt injection. Not a system message. The brain processes the content the same way it processes lived experience, and the result becomes part of its associative memory.


The LivingGrimoire Pattern

Before going further, some context on what a Skill actually is here.

LivingGrimoire is a software design pattern for building modular, composable AI systems. The core idea is that behaviour lives in self-contained Skill objects that are attached to a Brain at runtime. Each Skill can:

  • Listen to input (input(ear, skin, eye))
  • Respond via output algorithms (setSimpleAlg(...))
  • Run once on attachment (manifest())
  • Be added or removed without touching the core brain logic
brain.add_skill(DiImprint(brain))
brain.add_skill(DiRailPunk())
brain.add_skill(SomeOtherSkill())
Enter fullscreen mode Exit fullscreen mode

Skills are the grimoire's spells. The brain is the book. You compose the AI you want by choosing which spells to bind.

DiImprint is a particularly foundational spell because it runs before anything else matters. It populates the brain's knowledge base from a file, giving every other skill a warm, pre-shaped mind to work with.


The kiln.txt Format

kiln.txt is deliberately low-tech. It is a plain text file where each line is a thought. Comments start with #. Blank lines are ignored. The format supports several input patterns depending on which PopulatorFunc objects are registered on the underlying bot:

# plain associative thoughts
i live in a cabin in the forest
i like dark and spooky things

# key;value direct pairs
who are you;i am shadow. a forest creature.
favourite food;chocolate

# structured data (parsed by registered populators)
apples costs 10.99 for 2 units
Enter fullscreen mode Exit fullscreen mode

That last line triggers a PricePerUnit populator that computes 5.495 and stores it as apples price per unit → 5.50. The file is not just a list of strings — it is a DSL whose expressiveness grows as you register more populators.

This is the part that makes the kiln.txt sellable, which we will get to shortly.


Beyond Chatbots: Other Places DiImprint Could Live

The pattern is not chatbot-specific. Anywhere a system needs to bootstrap domain knowledge before serving requests, DiImprint is applicable.

Expert systems. A medical triage assistant could be imprinted with symptom-to-condition mappings, drug interaction rules, and escalation thresholds from a clinician-authored kiln file. The clinician never writes code. They write a structured text file and the system absorbs it.

Game NPC memory. An NPC brain imprinted from a kiln file authored by a narrative designer wakes up knowing the history of the kingdom, the relationships between characters, and the current political situation — before the player ever speaks to them. The designer controls the NPC's knowledge without touching the game engine.

Configuration-driven business logic. Pricing rules, compliance constraints, product catalogue relationships — these are typically hardcoded or stored in databases that require engineering work to update. A kiln file authored by a business analyst and processed by domain-specific populators makes the logic editable by the people who understand it, not just the people who can deploy it.

Lore engines for worldbuilding tools. A writer building a fantasy world could maintain their canon in kiln format — places, characters, historical events, cultural rules — and imprint a query system that answers "what do people eat in the northern provinces?" or "who was king during the plague year?" without a vector database, embeddings, or API calls.

Accessibility assistants. A personalised accessibility helper imprinted with a user's specific needs, communication preferences, and environmental context from an onboarding kiln file could be ready to assist meaningfully from the first interaction rather than learning over dozens of sessions.

The common thread: domain experts have knowledge, and engineers have the machinery to use it. DiImprint narrows the gap by making the knowledge transfer file-shaped.


The Commerce Angle: Selling kiln.txt Files

Here is where it gets interesting for anyone thinking about building a business on LivingGrimoire.

A kiln.txt file, properly authored, is a product. It is the encoded expertise, personality, or domain knowledge that makes a brain useful for a specific purpose. The brain itself is generic infrastructure. The kiln is the value.

Consider what this unlocks:

Writers can become AI content vendors. A fiction writer who has spent years developing a fictional universe can encode that world into a kiln file and sell it as a "lore pack." Developers building games, interactive fiction tools, or creative assistants can purchase it and imprint their brain with a fully realised world they did not have to invent. The writer earns from their creative work in a new medium without writing a single line of code.

Domain experts can monetise knowledge directly. A sommelier, a tax specialist, a marine biologist — anyone whose expertise is currently locked inside consulting hours or textbooks could encode their domain into a kiln file. The file is versioned, updateable, licensable, and distributable. It is expertise as software.

Persona packs. A character designer sells a .kiln bundle containing the personality, speech patterns, backstory, and knowledge base of a specific AI persona. Developers drop it into their LivingGrimoire brain and ship a finished character without the months of training data curation. The persona designer retains authorship credit and recurring licence fees.

Industry-specific populator + kiln bundles. A developer writes a LegalClausePopulator that understands contract language. A legal content firm writes a kiln file formatted for that populator. They sell the bundle together. The developer gets distribution, the firm gets a technical vehicle for their content. Neither could sell the product without the other, but the labour is cleanly divided.

The marketplace shape this points toward is similar to the asset store model that transformed game development — except the assets are knowledge structures rather than 3D models, and the buyers are AI developers rather than game studios.


What This Means for Writers in Tech

One of the persistent frictions in software is that the people who best understand a domain are rarely the people who build tools for it. A historian knows more about medieval trade routes than any engineer, but has no path to encode that knowledge into a queryable system without either learning to code or hiring someone who will misunderstand half of what they say.

LivingGrimoire's kiln format changes the authorship model. Writing a kiln file is closer to writing a structured document than writing code. The syntax is intentionally minimal. The feedback loop is immediate — imprint, query, observe, revise. A careful writer with no programming background can iterate toward a high-quality knowledge base the same way they iterate toward a well-edited manuscript.

This is not dumbing down the technology. It is correctly identifying that knowledge authorship and system engineering are different skills, and building an interface at the boundary between them.


The Brin Parallel, Revisited

What Brin imagined as science fiction was a world where consciousness could be bottled and redistributed. The ditto that steps out of the kiln is not a copy in a degraded sense — it is a genuine instantiation of a pattern, complete with everything the original intended to transfer.

DiImprint is obviously much more modest than that. But the structural analogy holds: a pattern of knowledge and personality, encoded into a medium, baked, and instantiated into a system that can act on it.

The kiln.txt is the clay. The imprint() method is the kiln. What steps out is not you — but it has read everything you wanted it to know.

That is a surprisingly powerful primitive to have in your architecture.


Getting Started

# Add to your LivingGrimoire brain
brain.add_skill(DiImprint(brain))

# Create kiln.txt in your working directory and populate it
# Then at runtime:
# > imprint
# imprinting complete
Enter fullscreen mode Exit fullscreen mode

The skill creates an empty kiln.txt on manifest() if one does not exist. From there, the file is yours to author.

If you build something interesting with it — a lore engine, a domain expert, a character that wakes up knowing who it is — I would genuinely like to hear about it.


Part of the LivingGrimoire series on modular AI architecture.

Top comments (0)