Skip to content

Anuroop128/Dungeon_Master_narrator.ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dungeon_Master.ai

This project implements an intelligent AI Dungeon Master (DM) for a text-based tabletop role-playing game

System Overview

This project implements an intelligent AI Dungeon Master (DM) for a text-based tabletop role-playing game[cite: 7]. The core challenge with using Large Language Models (LLMs) for storytelling is their inability to maintain long-term coherence[cite: 9]. This AI DM solves that problem by using a Retrieval-Augmented Generation (RAG) architecture to create a persistent memory system[cite: 22, 23].

The system is designed with a modular three-part structure:

  • main.py: The main entry point and game loop, handling user interaction.
  • environment.py: Manages all interactions with the Groq API and the LLM, including prompt construction.
  • bot_db.py: Controls the memory system, using ChromaDB to store and retrieve game events.

This architecture ensures that the AI DM can recall past events, maintain narrative continuity, and provide an immersive, evolving gameplay experience where player choices have lasting consequences[cite: 12].


Setup Guide

Prerequisites

  • Python 3.8+
  • pip (Python package installer)

1. Clone the Repository

Clone this repository to your local machine:

git clone https://github.com/Anuroop128/Dungeon_Master_narrator.ai
cd Dungeon_Master_narrator.ai

2. Install Dependencies

Install the required Python packages using the requirements.txt file.

pip install -r requirements.txt

3. Making the memory directory

Make a directory for the memory by using the code below in the terminal.

mkdir memory

4. Set Up Environment Variable

This project requires an API key from Groq (https://console.groq.com/keys).

For Windows:

set GROQ_API_KEY="your_key_here"

For Linux/macOS:

export GROQ_API_KEY="your_key_here"

5. Usage Instructions

To start the game, run the main.py script from your terminal:

python main.py

You will be prompted to introduce your character. From there, describe your actions and watch the story unfold. To end the adventure, simply type " quit ".

Demonstration Recording

YouTube video demonstrating the working model of the code

https://youtu.be/yYkRn1JssCY?si=i0jamFDnS8JC3z1r

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages