Build a chatbot connected to a Knowledge Graph - Writer AI Studio

Documentation Index

Fetch the complete documentation index at: /llms.txt

Use this file to discover all available pages before exploring further.


Agent Builder contains prebuilt UI and blueprint blocks that you can combine to build a full-featured chatbot.

This tutorial demonstrates how to build a chatbot that’s connected to the Palmyra X5 model and integrates with a Knowledge Graph for domain-specific knowledge. It covers the following steps:

  1. Adding a Chatbot block to the UI
  2. Adding a Chat reply block to the blueprint
  3. Connecting a Knowledge Graph to the chatbot

If you are unfamiliar with Agent Builder interface, check out the Agent Builder Quickstart.

Build the UI

The UI for the agent contains a single Chatbot block. This block handles the full UI for the chatbot, including the chat interface and the chat messages.

  1. Add a Chatbot block to the UI

Drag and drop a Chatbot component onto the Interface. In the block’s configuration panel, set the following fields:

Build the blueprint

The blueprint for the agent contains the following blocks:

  1. Add a UI trigger for the chat message event

To run the blueprint when a user enters a chat message, add a UI trigger block to the canvas. In the block’s configuration panel, update the following fields:

  1. Add a Chat reply block

Add a Chat reply block to the canvas, which runs after the UI trigger block. This block manages the chat conversation, including the chat messages and the chat history. Connect the UI trigger block to the Chat reply block by dragging a line from the green dot on the UI trigger block to the Chat reply block. In the Chat reply block’s configuration panel, set the following fields:

You are a helpful assistant for Writer's developer platform. Use the provided documentation to answer questions about Writer's APIs, SDKs, and Agent Builder.

Be clear and concise, include code examples when helpful, and reference specific docs when appropriate. If you're unsure about something, say so and suggest checking the documentation directly.

At this point, the chatbot isn’t connected to a Knowledge Graph, but it’s configured to respond to messages from the user. You can preview the agent to see how it works and then connect a Knowledge Graph to the chatbot to enable the chatbot to answer domain-specific questions.

Preview the agent

To preview the agent, navigate to the Preview tab. Type a message in the chatbot and see the response from the model.

Connect a Knowledge Graph to the chatbot

You can connect one or more Knowledge Graphs to the chatbot to answer questions about data related to your business or a specific dataset. To connect a Knowledge Graph to the chatbot, update the Chat reply block.

  1. Update the Chat reply block

Now when the user asks questions related to data in the connected Knowledge Graphs, the chatbot can reference the data in the Knowledge Graphs to answer the question. If you encounter any issues, refer to the Troubleshooting guide for debugging information.