Skip to main content

Agent framework for D&D and tabletop RPG campaign management

Project description

dmlog-agent

Agent framework for dmlog.ai — dungeon master tools for D&D and tabletop RPG campaigns. Manages session notes, NPCs, factions, locations, and encounters.

Features

  • NPC Tracking — Track non-player characters with secrets, motivations, alignment, and status
  • Faction Management — Organize factions with influence ratings, allies, and enemies
  • Location Database — Map campaign locations with connections and notable features
  • Encounter Builder — Create rated encounters with terrain, creatures, and objectives
  • Session Notes — Record sessions with party members, loot, and quest progress
  • Export/Import — JSON serialization for backup and portability

Installation

pip install dmlog-agent

Quick Start

from dmlog_agent import (
    DMLogAgent,
    NPC,
    Faction,
    Location,
    Encounter,
    EncounterDifficulty,
    Alignment,
)

agent = DMLogAgent()

# Add NPCs
agent.add_npc(
    name="Mira Black",
    race="Half-Elf",
    occupation="Thieves Guild Leader",
    alignment=Alignment.ChaoticNeutral,
    faction="Thieves Guild",
    description="Silver-haired rogue with a sharp tongue",
    secrets="Secretly funding the rebellion",
)

# Add a faction
agent.add_faction(
    name="Thieves Guild",
    leader="Mira Black",
    headquarters="The Rusty Nail Tavern",
    influence=65,
    goals="Control the city's underground trade",
    enemies=["City Guard", "Merchants Association"],
)

# Add a location
agent.add_location(
    name="The Sunken Temple",
    region="Blighted Coast",
    description="An old temple half-submerged in black water",
    notable_features=["Altar of the Deep Ones", "Trident statues"],
    dangers="Carrion crawlers, water weird",
    loot="500 gp, potion of water breathing",
    connected_locations=["Blighted Coast", "Harbor Town"],
)

# Build an encounter
encounter = agent.build_encounter(
    title="Temple Guardians",
    creatures=["Carrion Crawler", "Water Weird"],
    creature_count=4,
    difficulty=EncounterDifficulty.Hard,
    location="The Sunken Temple",
    terrain="Partially flooded, crumbling pillars",
    objectives="Protect the mage casting Detect Treasure",
)

# Plan a session
agent.plan_session(
    session_number=1,
    title="The Sunken Temple",
    location="Blighted Coast",
    party_members=["Aldric", "Lyra", "Thorne", "Zara"],
    NPCs_present=["Mira Black"],
    encounters=[encounter],
    quest_progress="Found map to the Sunken Temple",
    next_session_hooks="What lies beneath the altar?",
    duration_minutes=180,
)

# Stats
stats = agent.get_campaign_stats()
print(f"Sessions run: {stats['total_sessions']}")
print(f"Total XP awarded: {stats['total_xp_awarded']}")

API Overview

NPCs

npc = agent.add_npc(
    name="Grimjaw the Orc",
    race="Orc",
    occupation="Mercenary Captain",
    alignment=Alignment.NeutralEvil,
    location="Crossroads Inn",
    faction="Iron Banner Company",
    motivations="Gold and glory",
    secrets="Works for a secret benefactor",
)

Factions

faction = agent.add_faction(
    name="Iron Banner Company",
    leader="Captain Vorn",
    headquarters="Fort Ironhold",
    influence=70,
    allies=["Thieves Guild"],
    enemies=["Shadow Covenant"],
)

Locations

loc = agent.add_location(
    name="Crossroads Inn",
    region="Heartland",
    description="A busy inn at the intersection of two trade routes",
    notable_features=["Trading post", "Job board", "Secret basement"],
    connected_locations=["Capital City", "Border Fort"],
)

Encounters

enc = agent.build_encounter(
    title="Ambush at the Crossroads",
    creatures=["Bandit", "Bandit Captain"],
    creature_count=6,
    difficulty=EncounterDifficulty.Medium,
    terrain="Open road, overturned cart cover",
    objectives="Survive and capture the leader",
)

Development

pip install -e .
pytest tests/

License

MIT

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

dmlog_agent-0.1.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dmlog_agent-0.1.0-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file dmlog_agent-0.1.0.tar.gz.

File metadata

  • Download URL: dmlog_agent-0.1.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for dmlog_agent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 28704c6a130ae85d60b45526822cade1e104da54e1d2d20c95080d64f1ce0a83
MD5 23693b4608e8cb3c519c431d66e4b5da
BLAKE2b-256 c3c9f89e4f395248366e70283d36366fe773a64d40cdbc2f80d54cf48a625311

See more details on using hashes here.

File details

Details for the file dmlog_agent-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dmlog_agent-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for dmlog_agent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ea3dc965db7a017c5875a521763c47046cda8126e74ed2f73118567b05c815c3
MD5 840925be013b0370e40074feca46eeee
BLAKE2b-256 a92a1ce3a3c5a02c190f2522c2de35a111c98bdfdad3b4509f1c302702449e96

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