Upstream Kompile Harness Integration
Elthoria Harness is built specifically to run on top of the upstream Kompile Harness ↗. Instead of reimplementing model providers, auth stores, chat UIs, memory, policy enforcement, or document crawling inside the RPG server, Elthoria delegates all general agent infrastructure to Kompile and focuses strictly on authoritative tabletop roleplay state.
Process & responsibility boundary
┌────────────────────────────────────────────────────────────────────┐
│ Upstream Kompile Harness (`kompile chat` / `kompile chat --web`) │
│ • Model providers, OAuth/API auth, local-runtime GPUs │
│ • TUI / Web Chat, slash commands, transcripts, persistent memory │
│ • Enforcer, Judge, subagents, skills, reminders, peers │
│ • Folder-local crawl, hybrid RAG & .kgraph knowledge reasoning │
│ • Dynamic MCP tool discovery (`mcp_tool_search`, `mcp_tool_call`) │
└───────────────────────────────┬────────────────────────────────────┘
│ stdio (.mcp.json) — ELTHORIA_KOMPILE_HARNESS_CHILD=true
▼
┌────────────────────────────────────────────────────────────────────┐
│ Elthoria MCP Server (`elthoria server --transport stdio --port 0`)│
│ • Authoritative campaign, character, NPC, inventory & spell DB │
│ • Deterministic rules engine, bonus stacking, dice & fate oracle │
│ • Initiative tracker, combat commands & stealth NPC runtime │
│ • Living world simulation, story candidates & counterfactual sims │
│ • Persisted hex & tactical boards, ANTLR map DSL, lorebooks │
│ • Pinned `get_play_dashboard` & guarded PDF Content Workbench │
└────────────────────────────────────────────────────────────────────┘Why the boundary matters
- No schema bloat on every turn. Elthoria registers 300+ domain tools. In the Kompile harness workspace, the
elthoria-gmrole exposes onlymcp_tool_searchandmcp_tool_call(plus Kompile's native knowledge/pipeline tools), discovering and invoking exact Elthoria tools on demand without stuffing hundreds of JSON schemas into every LLM context window. - One folder-scoped knowledge identity.
${ELTHORIA_HOME:-~/.elthoria}/kompile-harnessis the single Kompile project and knowledge-base identity (kompile-harness-knowledge). Managed documents live indata/input_documents/elthoria/, and crawl/graph artifacts persist underdata/crawls/kompile-harness-knowledge/(includinggraph.kgraph). Elthoria never launches a second Kompile server; in child mode (ELTHORIA_KOMPILE_HARNESS_CHILD=true), legacy remote Kompile config is force-disabled. - Separate install roots. Elthoria installs under
~/.elthoria; Kompile lives under~/.kompile. Upgrading either component never clobbers the other's binaries, credentials, or workspaces.
TIP
For a complete architectural breakdown of how Elthoria's authoritative DB, elthoria-memory, journals/Lorebooks, folder-local .kgraph KB, and Kompile's persistent <memory_context> work together on every turn, read the Memory Deep Dive.
Generated harness workspace layout
Running elthoria (or elthoria web, elthoria exec, elthoria crawl) automatically provisions and verifies ${ELTHORIA_WORKSPACE:-~/.elthoria/kompile-harness}:
| Path | Role |
|---|---|
.mcp.json | Spawns elthoria server --transport stdio --port 0 with ELTHORIA_KOMPILE_HARNESS_CHILD=true and configures kompile.dashboard (mcp__elthoria__get_play_dashboard) plus exact mutation refresh triggers. Always regenerated and validated on launch. |
.kompile/roles/elthoria-gm.md | External-GM persona & tool policy. Set ELTHORIA_HARNESS_SYNC=0 to preserve custom local edits. |
.kompile/skills/elthoria-play.md | Prompt orchestration for starting or resuming play sessions. |
.kompile/skills/elthoria-turn.md | Structured GM turn loop (query → roll → mutate → refresh dashboard → narrate). |
.kompile/skills/elthoria-recap.md | Grounded player-facing session recaps from journal/world state. |
.kompile/skills/elthoria-rules.md | Rules & lore lookup workflow combining typed Elthoria tools with local Kompile search/graph reasoning. |
.kompile/skills/elthoria-content.md | Guarded PDF intake, parsing, review, publication, and roll-table catalog import workflow. |
AGENTS.md | Fallback grounding contract, visibility rules, and board/content safety invariants. |
kompile.project.json | Registers the workspace with Kompile's folder-local crawl profile. |
data/input_documents/elthoria/ | Managed retrieval root for user-owned rulebooks and player-safe published derivatives. |
data/crawls/kompile-harness-knowledge/ | Persisted lexical/vector index and graph.kgraph knowledge graph. |
Where to go in the upstream Kompile docs
Use this directory whenever you want deeper configuration or operational tooling beyond Elthoria's roleplay tools:
| Topic | Upstream Kompile Guide |
|---|---|
Install Kompile & channels (prerelease / stable) | Installation & Updates ↗ |
| Provider auth & OAuth (OpenAI/Codex, Claude, Antigravity, Copilot, OpenRouter, Fireworks, Together) | Quickstarts by Audience ↗ & CLI Auth ↗ |
| Starting agents & remote SSH/LAN sign-in | Starting & Remote Sign-In Walkthroughs ↗ |
| CLI TUI vs. browser Web Harness | CLI vs. Web Harness ↗ & Web Harness ↗ |
Slash commands (/model, /usage, /cost, /status, /compact, …) | Slash Commands (/) ↗ |
Local LLMs, embeddings & GPU acceleration (local-runtime) | Local Models & local-runtime ↗ |
Document crawling, RAG & .kgraph reasoning | Graphs & Grounded Reasoning ↗ & Document Ingestion ↗ |
| Enforcer, Judge, Reminders & Persistent Memory | Why Kompile Is Opinionated ↗, The Enforcer ↗, Persistent Memory ↗ |
| Multi-agent workflows, Subagents & Skills | Interactive Workflows ↗, Subagents ↗, Skills & Skill Manager ↗ |
| MCP server architecture, profiles & custom MCP servers | How the MCP Server Works ↗ & MCP Tool Reference ↗ |
Packaging custom .kspin personas | Kompile Spins ↗ |
Public Agent Skill (SKILL.md) | Agent Skill (SKILL.md) ↗ |