Skip to content

How-to Guides

Task recipes. Each page solves one concrete problem and shows a minimal working example in Unity, Unreal, C++, and Python where applicable. If you are new to Tryll, start with First inference; if you want the why, see Concepts.

Guides marked ★ are the ones to read first in their area.

Setup and connection

Editor tools

Build an agent

  • Build a Chat Agent with a Graph ★ — compose a Generate + guardrail graph. Start here when writing your first agent.
  • Design an NPC Prompt ★ — measurement-backed recipes for writing a role-play system_prompt: what actually improves character dialogue, what provably does not, and how model choice changes the answer.
  • Use Mustache Templates — control exactly how instructions, slots, variables, and retrieved chunks land in the prompt.
  • Stream Answers to a UI — wire streaming tokens into your application's view layer.
  • Send Multiple Answers in One Turn — two speakers, or a thinking channel plus a reply, routed by AnswerText.node_name.

Dialogue and turn control

  • Change Agent Parameters at Runtime — mutate a node's params (prompt, sampling, threshold, …) between turns, and which params are structural and cannot change.
  • Seed and Edit Dialog History — append scripted user/assistant turns, write an opener, or retry by removing the last turn — all without running the graph.
  • Cancel a Turn — stop an in-flight turn (a chat "Stop" button, or a rollback), keeping or discarding the partial reply.
  • Pause and Resume a Turn — suspend a turn between nodes and resume it after acting client-side.
  • Manage an Agent's KV Cache — prefill, evict, and inspect language-model KV caches to trade memory against first-turn latency.

Knowledge and retrieval

  • Create a Simple RAG Assistant ★ — the hero recipe: prepare a knowledge base, add a Retrieve node in front of Generate, see grounded answers.
  • Query Rewriting for RAG — rewrite the user's message into a standalone search query before retrieval, while still answering what they actually asked.
  • Build an Intent-Driven NPC — classify the player's intent against a labelled knowledge base and route to tone-specific replies.

Game state and control flow

The mental model for this section is the per-turn slot blackboard and the per-agent variable store.

Structured output and tools

  • Define and Handle Tool Calls ★ — declare ToolDefs, route on tool_called / no_tool_called, handle the call client-side, and hand the real result back to the model.
  • Constrain Output with a Grammar — force a Generate node to emit exactly a fixed shape (command, choice, JSON) with a GBNF grammar; flip between command turn and free chat at runtime.

Guardrails and safety

Voice

Models and shipping

  • Use Your Own Local Model — register a GGUF file that lives on disk without a Hugging Face download.
  • Pin and Unpin Models — keep a model warm (LoadModelRequest) or release it (UnloadModelRequest).
  • Verify Required Models Before Play — gate Play/PIE on every registered model being downloaded first, and fail the build when a workflow references a model that will not ship.
  • Estimate Memory Footprint — work out the RAM and VRAM a model line-up needs before you ship, so it fits your target hardware.
  • Ship Storage Folders for Builds — lay out canned-response / guardrail / RAG / hotword files so they travel with a packaged build and resolve against the session storage root.

Downloading and registering models from the editor GUI is covered in Manage Models in the Editor.

  • Concepts — the mental model behind each recipe.
  • Reference — field-level detail for every knob.