Manta Developers
GitHub
Menu

App guide

Tell the agent what your pages do, how to get to them, and what your terms mean.

What it is

An app guide lists the pages of your app and the terms your app uses. With it, the agent answers “where do I change the budget?”, “what does this page do?” and “what does ROAS mean?” from your own text. Without it, the agent makes up a new answer each time.

appGuideTools turns the guide into one app tool, getAppGuide. The agent calls it only when a question needs the guide, so the guide does not go into every message.

Import

import { EmbeddedChat, appGuideTools, type AppGuide } from "@manta-eu/react/components/embedded-chat";

Example

const guide: AppGuide = {
  pages: [
    {
      path: "/b/{brand}/campaigns",
      title: "Campaigns",
      description: "See every campaign of the brand. Open a campaign to change its daily budget.",
      navPath: ["Work", "Campaigns"],
      shows: ["https://example.com/vocab/Campaign"],
      edits: ["https://example.com/vocab/dailyBudget"],
    },
  ],
  terms: [
    {
      term: "ROAS",
      definition: "Return on ad spend: the revenue the ads brought in, divided by what they cost.",
      iri: "https://example.com/vocab/roas",
    },
  ],
};

const appTools = appGuideTools(guide);

export function Copilot() {
  return (
    <EmbeddedChat user={{ id: "…", email: "you@example.com", name: "You" }} isOperator={false} appTools={appTools} />
  );
}

To lend the agent your own app tools too, spread both objects into one: { ...appGuideTools(guide), ...myTools }.

Request

appGuideTools takes an AppGuide with two lists.

Each page in pages has:

  • path — the page’s address as a URI template, such as /b/{brand}/campaigns.
  • title — the page’s name, as the user sees it.
  • description — one or two sentences: what the user can do on the page.
  • navPath (optional) — the menu labels the user clicks to get there, such as ["Work", "Campaigns"].
  • shows (optional) — the IRIs of the classes and properties that the page shows.
  • edits (optional) — the IRIs of the properties that the user can change on the page.

With shows and edits, the agent links what it finds in the knowledge graph to the page where the user sees or changes it. The agent does not read anything from the shape of an IRI.

Each term in terms has:

  • term — the word or abbreviation, such as ROAS.
  • definition — the one definition the agent gives every time.
  • iri (optional) — the knowledge graph term with the same meaning.

Response

getAppGuide gives the agent the guide as JSON-LD with schema.org terms:

  • Each page is a WebPage with name, description, breadcrumb, and about (the shows IRIs).
  • The page’s potentialAction starts with a ViewAction. Its EntryPoint target holds the path as a urlTemplate.
  • Each edits IRI adds an UpdateAction with the same EntryPoint target.
  • The terms are one DefinedTermSet of DefinedTerms.

When the chat has the tool, the agent answers a “where” question with the menu path, never with a page that is not in the guide, and gives a glossary definition word for word.

Your glossary wins over Manta’s own definitions. If Manta defines ROAS one way and your glossary another way, the agent gives yours, so the chat and your UI use the same words.

Keep the guide next to your routes and update it in the same change as a page. A test that checks every route has a guide entry stops a new page from shipping without one.