Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌟 Lore: A World-Building RAG Tutorial

License: MIT

Learn how to create and query rich fictional worlds using retrieval-augmented generation (RAG), guidance, and ChromaDB.

Loremaster Banner

✨ Overview

Lore is an educational project, based on the Loremaster 6000 project, which demonstrates how to build a RAG-powered system for creating and managing fictional worlds. Through Jupyter notebooks, it shows how to:

  • Generate coherent, interconnected lore using constrained language models
  • Store and retrieve world elements using semantic search
  • Maintain consistency across a growing body of fictional content
  • Query and analyze relationships between different aspects of your world

🎮 Features

  • Guided World Generation: Create foundational aspects of your world with structured prompts
  • Semantic Lore Storage: Store and retrieve lore using ChromaDB's vector capabilities
  • Consistency Checking: Ensure new lore aligns with existing world elements
  • Relationship Analysis: Explore connections between different parts of your world
  • Interactive Tutorials: Learn through hands-on Jupyter notebooks

🛠️ Technical Architecture

+-------------------+     +-------------------+     +-------------------+
|    LoreManager    |     |    ChromaDB       |     |  Language Model   |
| - Proposal Gen    |<--->| - Vector Storage  |<--->| - Transformers    |
| - Refinement      |     | - Semantic Search |     | - Guidance        |
| - Query/Analysis  |     |                   |     |                   |
+-------------------+     +-------------------+     +-------------------+
         ^                        ^                         ^
         |                        |                         |
         v                        v                         v
+----------------------------------------------------------+
|                     World & Lore Models                   |
| - SettingType (Enum)                                      |
| - World (Base Model)                                      |
| - LoreEntry (Base Model)                                  |
| - LoreProposal/Refinement                                 |
+----------------------------------------------------------+

🚀 Getting Started

Prerequisites

  • Python 3.8+
  • Jupyter Notebook/Lab
  • Required packages (install via requirements.txt)

Installation

git clone https://github.com/Austin-Routt/lore.git
cd lore
pip install -r requirements.txt

Quick Start

  1. Open lore.ipynb for a simple introduction
  2. Explore lore.ipynb further for more complex features

📚 Examples

Lore Generation

# Initialize manager
lore_manager = LoreManager(
    model_path="path/to/model",
    embeddings_path="path/to/embeddings"
)

# Create world
world = World(
    setting=SettingType.horror,
    world_description="A massive dark fantasy work with themes of cosmic horror"
)

# Generate lore proposal
proposal = lore_manager.propose_lore(world, "basic principles")

# Refine proposal
final_lore = lore_manager.refine_proposal(proposal, world)

Querying Relationships

analysis = lore_manager.query_lore(
    "How do basic principles affect key powers?"
)

🤝 Contributing

Contributions welcome! Please read CONTRIBUTING.md for details.

📜 License

This project is licensed under the MIT License - see LICENSE.md

🌟 Acknowledgments

  • Based on the Loremaster 6000 project
  • Inspired by traditional world-building techniques
  • Built with amazing open-source tools

Made with ❤️ for world-builders everywhere

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages