> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/narrative-design-guide.md).

# Narrative Design Guide

Narrative Design - Narrative based NPCs with convai on web.

Narrative design is a method of structuring interactive stories, particularly for convai non-player characters (NPCs) in web-based environments. It utilizes a graph-based system where each node represents a step in the story progression.

## Convai Playground

1. Select your Character in which you want to enable Narrative Design.
2. Open Narrative Design section in convai playground.\
   \ <img src="https://413558230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2Fdc9mGu8yVcQhXfpX1cCd%2Fimage.png?alt=media&amp;token=e2780e85-f3fa-4c49-b5b7-eda49b4831f8" alt="" data-size="original"><br>
3. According to your storyline create a narrative map/graph. Shown bellow is an example. The blue boxes represent triggers (used to initiate a line in the graph) and the black boxes represent sections (what you want the character to speak about).\
   ![](https://413558230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FfaSJpTOp4xG3KGxuWTlV%2Fimage.png?alt=media\&token=6995e83d-c7f3-4be6-a1b3-fffdd396c7a7)<br>
4. Each section has an objective and decisions. Based on whats written in Objective the character would speak/respond. You can give the character exact dialogues using `<speak>{your dialogue}</speak>` tags.\
   For decisions add messages as context on how the character can decide on which objective to move to own its own. The once you want to control can be through invokeTrigger in the next section.<br>

   <figure><img src="https://413558230-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FrGsRSTjcRc4VIsZdjrxJ%2FScreenshot%20(114).png?alt=media&amp;token=96ff7028-82ce-4989-870a-6629d68de757" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.convai.com/api-docs/plugins-and-integrations/web-plugins/narrative-design-guide.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
