Skip to content

[SPEC] Narrative Engine (Ollama Integration) #13

@Fortinbra

Description

@Fortinbra

Spec #13 — Narrative Engine (Ollama Integration)

Spec file: \docs/specs/13-narrative-engine.md\

Summary

Integrates Ollama as the AI Dungeon Master narrative backend via a clean \INarrativeEngine\ abstraction in \DungeonMaster.Core. All AI-generated content (scene descriptions, NPC dialogue, encounter narration, location descriptions, player-action responses) is a proposal subject to Human DM approval before reaching players.

Scope

  • \INarrativeEngine\ interface in Core — zero Ollama/HTTP dependencies
  • Five narrative methods: scene, NPC dialogue, encounter, location, player-action response
  • \OllamaNarrativeEngine\ in Infrastructure — typed \OllamaClient\ wrapping \HttpClient\
  • Human DM approval flow: /dm approve\ | /dm edit\ | /dm reject\ | /dm override\
  • \Campaign.AutoApproveNarrative\ flag (default false)
  • \NarrativeLog\ entity for full audit trail of AI proposals and Human DM decisions
  • Management UI: log viewer, auto-approve toggle, model selector, test prompt panel
  • Configuration: \OLLAMA_BASE_URL, \OLLAMA_MODEL, \OLLAMA_TIMEOUT_SECONDS\

Implementation agents

  • Missy — prompt templates, \OllamaNarrativeEngine, context assembly
  • Rory — \OllamaClient\ HTTP, DI registration, Discord /dm\ commands, API endpoints
  • Clara — management UI (Blazor)
  • Danny — TDD gate (writes failing tests before implementation)

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions