Skip to content

feat(platform): ground chat answers about Tale in its documentation - #3773

Merged
yannickmonney merged 8 commits into
mainfrom
feat/chat-docs-grounding
Sep 29, 2026
Merged

yannickmonney merged 8 commits into
mainfrom
feat/chat-docs-grounding

Conversation

@yannickmonney

@yannickmonney yannickmonney commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

When asked how to use Tale itself ("Wie erstelle ich einen API-Key in Tale?"), the chat assistant could only guess a docs.tale.dev address. Folder paths, /en prefixes and invented slugs all returned 404. Failed steps are never hidden, by design, so the timeline filled with red "The server answered 404" reads. Customer feedback described this as "many 404 errors when querying docs.tale.dev".

The persona now has one short paragraph that says:

  • the workspace runs on Tale;
  • for how-to questions about Tale, read the documentation index https://docs.tale.dev/llms.txt (one line per page, with its description), then a page it lists (/de/ or /fr/ after the host for German or French);
  • never guess a docs URL;
  • the docs describe the latest release, so this workspace may differ.

The index URL is one exported constant, TALE_DOCS_INDEX_URL in lib/chat/assistant.ts. The prompt interpolates it and the test imports it. The origin is fixed on purpose and never derived from the deployment's own site origin. On a self-hosted install, docsOriginForSite(TALE_SITE_URL) would name a docs.<their-host> that does not exist. The docblock says why this one product fact belongs in the persona: the wire tool descriptions stay free of real-world domains.

The web_fetch wire description changes in two ways so that it agrees with the persona:

  • It accepts "a URL your instructions name".
  • It treats an index of other pages (a site map, an llms.txt) as a lookup, not a source: stop reading once you have the link you need, then fetch that page.

The index is about 28,000 characters, more than one 20,000-character window, and a turn gets four tool rounds. Without the lookup rule, the partial-read rule would spend a round on the second index window. The API-key entry sits in the first window.

The persona stays under its 1800-character "slim" guard (1783). Its no-URL test allows exactly the one exported address and still bans every other.

The docs page platform/chat/basics (EN/DE/FR) says the assistant looks up the public documentation for questions about Tale. It also says that a server which cannot reach docs.tale.dev (for example a self-hosted install without internet access) shows a failed reading step, and the answer is then not grounded in the documentation. The German line now uses the glossary term and du-voice ("dein Arbeitsbereich").

The branch merges current main. The manual-suite index in tests/manual/readme.md was rebuilt from the real box count of every suite. An earlier conflict resolution had dropped the chat and connectors rows and left a stray sentence in the table. The rebuilt index lists all 21 suites and adds up to 925 boxes: chat 90 with CHAT-F51, plus data-residency 26 and knowledge 54, whose counts were already stale on main.

Pairs with #3769, which makes guessed docs addresses (folders, /en, /de/llms.txt) redirect instead of returning 404.

Follow-ups, not in this PR:

  • suites/responsive.md declares 28 boxes in its header but holds 32. This drift is already on main.
  • lint:manual does not check that every suite has exactly one index row with a matching count, which is how the broken table went unnoticed.

Checklist

  • bun run check passes: not run repo-wide (the machine is shared and loaded), so CI runs it. All chat server tests pass (lib/chat, backend/core/chat, backend/domains/chat: 44 files, 754 tests), and so do the docs tests (35 files, 171 tests), the platform typecheck and typed oxlint on the touched files.
  • bun run lint:sast passes: the scoped Opengrep hook ran on the staged files.
  • Translations: N/A for the persona, which is English by design (the runtime directive sets the reply language). The docs change ships in EN/DE/FR together.
  • Docs updated in docs/{en,de,fr}/platform/chat/basics.md.
  • README: N/A.

Test plan

  • bun run --filter @tale/platform test -- lib/chat/assistant.test.ts lib/chat/tools.test.ts: the tests pin the grounding (the exported index address, "never guess a docs URL", the latest-release caveat), the web_fetch index-as-lookup rule and its acceptance of a URL the instructions name. With the source change stashed, four of these tests fail; with it they pass. The slim guard, the no-other-URL guard and the no-real-domain guard on the wire descriptions still hold.
  • bun run lint:manual and tests/manual/scripts/check-guide.ts suites/chat.md pass. A script checked that every suite has exactly one index row whose count matches its - [ ] boxes, and that the total is 925.
  • Live checks on docs.tale.dev: /llms.txt returns 200 (27,995 characters) and lists the API keys page within its first 20,000 characters. /platform/admin/api-keys.md and its /de/ and /fr/ versions return 200 text/markdown.
  • An earlier review round ran the real Node backend web_fetch executor: it read the public index in two windows and then the linked API-key guide in EN/DE/FR. The docs page renders without errors at phone and desktop widths.
  • Manual: new box CHAT-F51.

Not verified: a live chat turn against a real model, including whether the model stops reading the index early. The behaviour is set by the prompt, and CHAT-F51 is the check for it. The failure path on a server without internet egress is the existing web_fetch failure step; it was not observed on an air-gapped install.

Asked how to use Tale itself, the chat assistant had nothing but its own
guess of a docs.tale.dev address. Folder paths, /en prefixes and invented
slugs all answered 404, and because failed steps are never hidden, the
timeline filled with red "The server answered 404" reads before a reply
that was often wrong anyway.

The persona now says the workspace runs on Tale and points how-to questions
at the documentation index (https://docs.tale.dev/llms.txt, one line per page
with its description) and the pages it lists, with the /de/ and /fr/ prefixes
for German and French. It never guesses a docs URL and says the docs describe
the latest release. The origin is fixed rather than derived from the
deployment's own site origin, which on a self-hosted install would name a docs
host that does not exist. web_fetch already reads the text/markdown pages the
index links. The persona test allows exactly that one address and still bans
every other; CHAT-F51 covers it by hand.
…-3773

# Conflicts:
#	services/platform/tests/manual/readme.md
# Conflicts:
#	services/platform/tests/manual/readme.md
The docs index is about 28,000 characters, more than one 20,000-character
web_fetch window, and the wire description told the model to keep paging
until nextOffset is absent. With four tool rounds per turn, a search, two
index windows and one page left no room for a second page. The web_fetch
description now treats an index of other pages as a lookup: stop reading
once the needed link is found, then fetch that page.

The description also accepts a URL the instructions name, so it agrees
with the persona that points at the docs index. The index URL becomes one
exported constant that the prompt interpolates and the test imports, and
the docblock records why this one product fact lives in the persona.
The chat basics page said the assistant always reads docs.tale.dev. The
lookup is an outbound fetch, so a self-hosted server without internet
access shows a failed reading step instead. The page now says so in all
three locales. The German line also uses du-voice "dein Arbeitsbereich"
from the glossary instead of plural "eure Instanz".
Every open change bumped the same box-count lines in the manual readme, so each merge conflicted with the rest. The totals are recounted once after the batch lands.
@yannickmonney
yannickmonney merged commit f690f85 into main Sep 29, 2026
75 of 76 checks passed
@yannickmonney
yannickmonney deleted the feat/chat-docs-grounding branch September 29, 2026 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant